Skip to main content
April 16, 2006
Answered

HELP! need php variables in flash

  • April 16, 2006
  • 2 replies
  • 198 views
The action script below loads two videos ( first.flv, second.flv) then plays them consecutively. I would like to load the videos as variables from a PHP page that this flash is embeded in - something like:

$first_flv = "first.flv";
$second_flv = "second.flv";

How can I get $first_flv and $second_flv into flash variables that can replace the hard-coded ( "first.flv", "second.flv") below?


//action script

var videoLoaderIndex:Number = 0;
var videoPlayerIndex:Number = 0;
var videoList:Array = new Array( "first.flv", "second.flv");

vidComp.contentPath = videoList[0];

function eready(e:Object):Void {
if( videoLoaderIndex < videoList.length ) {
videoLoaderIndex++;
vidComp.activeVideoPlayerIndex = videoLoaderIndex;
vidComp.load( videoList[videoLoaderIndex] );
}
}

vidComp.addEventListener("ready", eready);
function ecomplete(e:Object):Void {
++videoPlayerIndex;
if(videoPlayerIndex >= videoList.length) {
videoPlayerIndex = 0;
}

vidComp.activeVideoPlayerIndex = videoPlayerIndex;
vidComp.visibleVideoPlayerIndex = videoPlayerIndex;
vidComp.play();
}

vidComp.addEventListener("complete", ecomplete );

This topic has been closed for replies.
Correct answer mongenix1
If you are simply trying to pass vars from a PHP page to a flash movie on a PHP page, take a look at
http://www.permadi.com/tutorial/flashQueryString/index.html
This worked for me.

2 replies

mongenix1Correct answer
Participant
April 16, 2006
If you are simply trying to pass vars from a PHP page to a flash movie on a PHP page, take a look at
http://www.permadi.com/tutorial/flashQueryString/index.html
This worked for me.
April 17, 2006
Thanks, it works great!
Jeff