|
|||
|
How can I pass variables from FFish to Actionscript so that I can use them in my Flash Movie? My problem is that I use the file.exists command to check whether a certain file exists or not. Depending on that I would like to make a button in my Flash Movie visible/not visible. So I have to send the true/false statement of the file.exists command to Actionscript.
|
|
|||
|
I can think of 2 ways
1. I should use the FlashPlayer.setVariable(name, value) command. But previously when I wanted to transfer a Number variable, it didn't work. I had to convert the variable to a string variable. So maybe you'll have to do that too. So i should do something like this: Code:
// check if file exists
var1 = File.exists("c:\\test.txt"))
// convert var1 to a string
varstring = new String(var1)
// set the status var of the root of my flashplayer to the varstring
FlashPlayer.setVariable("_root.status", varstring)
In flash you can make an extra frame which contains the code to make your button visible or invisible. then from whitin ffish you can call the actions of that frame according to the state of the file.exists Code:
if (File.exists("c:\\test.txt"))){
FlashPlayer.targetCallLabel("_root","actionframe")
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|