PDA

View Full Version : Loading a variable into flash from PHP



rhinovalley
April 27th, 2005, 05:30 PM
Hello,

I originally posted this at Flashkit but I never got a response from them. Could somebody help me out with this. I have a simple (I hope) question for all of your php and actionscript programers out there. I want to beable to load a variable from a php script into my flash like the following. On my first frame in my flash movie I have



flash = 1;
loadVariables("variables.php", 0, "GET");


then, on my 20th frame, I have this script:



if (flash == 1) {
gotoAndPlay (5);
} else {
loadMovieNum (flash, 1);
stop ();
}


the if (flash == 1) is just to make sure that the variables.php file has loaded and if it hasn't then the value will still equal 1 until the variables from the file are loaded.<font face="verdana, arial, helvetica" size="2">



<?php
$flash = "sound.swf";
$flash = "&flash=$flash";
?>


Shouldn't all of this together load the value of sound.swf for flash, thus loading sound.swf into layer 1 of my movie? When I load it onto my server, (I do have php on there) it just loops the movie back to frame 5 and keeps playing it. The value of "flash" doesn't change at all. Can somebody help me with this and lead my through this challenge? Any help would be apreciated!

Thanx!

rhinovalley
May 2nd, 2005, 06:26 PM
can anybody help me out here?