|
|||
|
I have a question, didn't find anything about that in forums and help :/
I've found an example of how Setvariable (servar.zip) is working here in forums, but in this example it shows how to set text in the text field component. It doesn't show how to define AS variable from FFishScript . To be short the problem is that.. I have an SWF file and for example I want to define _root.somevar in it BEFORE swf file starts, not after pressing the button etc.. but before it starts.. nothing works for me. I've tried many things, was calling FFishScript function from AS using fscommand at the beginning of AS script, was trying to bind vars.. nothing works. When movie loads _root.somevar is undefined , looks like FFishScript functions run after SWF loads. Is this true? if so what is the solution? how can I set variable in SWF movie from the very start taking it from FFishScript? |
|
|||
|
I'm not a SWFKit expert, so I'd suggest the admin helping here if I'm incorrect, but try something like this in the Initialize script of your SWFkit projector:
FlashPlayer.setVariable("_root.somevar",somevar_fr om_swfkit); This way this variable will be set in the Flash movie when the projector runs. As a safety thingy, leave like 3 frames blank at the start of the movie, I've noticed that when working in Flash with loadvarnum and ActionScript like that, it will take about 3-4 or so frames before the variables are loaded. |
|
|||
|
You cannot define an AS variable in FS. You can only set the values of variables in AS by calling the FlashPlayer.setVariable method in FS. The AS and The FS are two different worlds connected by fscommands(in AS) and the FlashPlayer object(in AS).
All FFish scripts will be called in AS using fscommand except the "Initialize" script. The "Initialize" script is called automatically just after the main window is created, before the main movie is loaded. You cannot set the variables of the main movie in "Initialize" script for the main movie hasn't been loaded while calling the "Initialize" script. |
|
|||
|
How about writing the required variable as a name&value pair to a file in the SpecialFolders.appath during the Initialize script.
Then get the Flash movie to access the variables with the LoadVars class Rob |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|