Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manipulating Flash Controls How To?? 1

Status
Not open for further replies.

zakkar

Programmer
Dec 3, 2002
72
0
0
GR
Hello,
I have an swf control which i have successfully registered in Vb.NET.In my code i use the setvariable command which offers me the component and change some properties of the control.The problem is that i am trying to call a function in the swf control (Flash) from .NET but all my efforts are unsucessfull.The control has a text field not a button which is called by the instance name calc_btn.The label is calculate.I have tried TcallLabel but nothing seems to work.Inside the control there is a script which i want to run it from my_button in VB .NET.The question is how can i do that?Can i call a function which is written inside the control from VB .NET.Does anyone has a full example of manipulating flash controls and calling their functions from Vb .NET?
Thank you in advanced
zkar Programmer
 
You cannot call flash functions from vb. You have to send them via fscommand from flash to vb and then catch them in vb.
 
Hello,
Can you give me an example?I have found via internet that fscommand needs some arguments.But i cannot understand them.For arguments needs target and something a string .The name of the button in flash is calc_btn.But when i put this in the target argument nothing seems to happen.Do you have an example ?It is a little confusing for me.
Thank you very much
zkar programmer
 
First: the commands between VB and Flash are strings!

So on the flash button you put a command:

on (release) {
fscommand("nameofthecommand","argument")
}

Note that the argument is optional, you also can pass only the command. Or you pass the command everytime with another argument. But only 1 argument each time!

Then in VB.NET receive it:

Private Sub Flash1_FSCommand(ByVal sender As Object, ByVal e As AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent) Handles Flash1.FSCommand

If e.command = "nameofthecommand" Then
if e.args="argument" Then
'do some stuff
End if
End If

To pass a variable from VB to Flash:

Flash1.SetVariable("_root.Yourtextfield", "sometext")

This will write the text directly into the flash field. But it does it normally only onload, so if you want to catch it during runtime, you have to make some function to actualize the field.

Hope this will help you.

Fritz

 
Thank you Fritz.I'll try it and i will tell you
Have a nice day.
 
Hi, I've followed the instructions above to use flash.ocx item on a web form and can't get it to work. The Flash.ocx has some proporties name, movie etc which I set but doesn't pick up the fscommand property. Also in the Code the Handles Flash1.FSCommand is not recognised (flash1 is underlined) Is there a reference or something I'm missing. Any help would be greatly appreciated.
Cheers
Rob

 
Well, if it is a web form things are quite diferent!

The ocx is only for Windows forms (local applications; exe). For Htm stuff (web form) you must use the activeX which generally is in the web-editors (i.e. frontpage) and embed the Flashmovie in the page with html code. See examples on macromedias site or search in some htm forum.

To pass commands to web forms you will need php or asp or something like that, I don't think VB.net can do that.

"Flash1" => of course you will have to change the name, according to the name of your own control.

fritz
 
Hi Fritz, Thanks for the reply. I wonder if I'm going about this the right way. I've basically designed a system in asp.net and vb.net but I'm not happy with the interface. I've looked at dreamweaver MX but couldn't find a way to connect to a vb.net backend, which is why I've tried to create flash buttons and pass on command messages to vb.net. Do you know a way to connect Flash components in Dreamwaever to a VB.net backend. I've looked everywhere for an answer but no luck. Cheers Rob
 
As I said, for web stuff you need php, maybe asp, to comunicate with any database. VB.net won't do it. Search for some flash forum, here's one:


Sorry but I am not very experienced in web stuff.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top