Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

swf works on its own, but only flashes when called from html

Status
Not open for further replies.

jadeg93

Technical User
Apr 24, 2007
2
US
Hi all,

I'm not new to flash, but I haven't done much passing of parameters between flash and php. What I'm trying to do is create a flash file that will load swfs that are randomly chosen from a directory full of swfs. The random choosing is done by a php script.

When I call the swf directly, it functions properly but opens a new window, which I don't want. When I run the html page generated by flash (I'm using v8), the loaded swf is embedded, which is what I want, but it just flashes and leaves me looking at a blank page.

The swf is at The html is at The php code is at
The actionscript in the master flash file is:

/* first create a new instance of the LoadVars object */
myVars = new LoadVars();
// call the load method to load my php page
myVars.load("// once vars have been loaded, we will have these variables:
myVars.swfToLoad // URL of swf
yVars.onLoad = function( success ){
if(success){
trace("variables loaded");
for( var prop in this ) {
loadMovie (this[prop],"photo_clip");
}
} else {
trace("Error loading page");
}
}
stop() ;

I've been messing with this for hours, so I know it must be something obvious . . .

TIA,
JadeG
 
I would change the script a bit:
Code:
/* first create a new instance of the LoadVars object */
myVars = new LoadVars();
// call the load method to load my php page
myVars.load("[URL unfurl="true"]http://www.teryg.net/test/image/RandomSwf.php");[/URL]
// once vars have been loaded, we will have these variables:
[b]//[/b]myVars.swfToLoad;
// URL of swf
myVars.onLoad = function(success) {
	if (success) {
		trace("variables loaded");
		[b]loadMovie(this.swfToLoad, "photo_clip");[/b]
	} else {
		trace("Error loading page");
	}
};
stop();
I did a quick test and it works well in your HTML.

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top