Is it possible to pass variable to .swf file.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mongkol
Forum Newbie
Posts: 3
Joined: Sun Aug 04, 2002 7:29 am

Is it possible to pass variable to .swf file.

Post by mongkol »

Has anyone have solution for this thing?
I would create dynamic flash form for receiving comment messages but I need to recive ID.
For example, my sysmtem have ID for each program.. when I click at any programs. It will bring up new window that have flash Form for send comment for that program.. That mean this form must be able to received ID variable that is passed from the first page. What should I do?.. Is it possible?...
Thank you in advance.
mongkol
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

You can read variables from an SWF file using JavaScript.

<script language=javascript">
ThisVar=document.TheFlashMovie.GetVariable('VariableName');
</script>


ThisVar is the variable that the read Flash variable will end up.

TheFlashMovie is the name (or id) of your Flash movie.

VariableName is the name of the variable in Flash you want to read.


Hope this helps!
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

..or use Setvariable("variable_name", "value"); to set a variable in an SWF movie.
Post Reply