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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading variables with embed 1

Status
Not open for further replies.

PaulFynch

IS-IT--Management
May 23, 2002
105
CA
i am bringing in variables through an embed code
the typeof the imported variable is "undefined"
i need it to be a string or something that will cocantenate with this path

_root.movieToLoad=_root.reldir+"/swf/"+_root.currentIndex+".swf";

_root.reldir is the var that is loaded

String(reldir); doesn't seem to work

any suggestions?


cheers
 
What's your actual object and embed code to pass the variable(s)?
 
<embed src="wag_slide_show.swf<? echo "?index=".count(scandir("logos/swf","swf"))."&reldir=logos&reload=".randomize(); ?>"

i have a dynamic text box on the root that has a variable property of _root.reldir. (relative directory)
it displays the value (which is "logos")
but when i echo my path "_root.movieToLoad" it comes up "/swf/11.swf" and leaves the reldir out
 
Is the flash movie getting the variables correctly the first time it loads?

Wow JT that almost looked like you knew what you were doing!
 
the variable is available on the root as
reldir=logos
when the movie loads

i need to convert that to a string or something

trace(typeof(reldir));
returns "undefined"

i need to cocantenate that variable reldir into this new variable to load a movie

_root.movieToLoad=_root.reldir+"/swf/"+_root.currentIndex+".swf";

when i trace(_root.movieToLoad);
it returns
"/swf/11.swf"
it should be
"logos/swf/11.swf"

i have tried everything i can think of, there has to be a simple way to do this.

thanks for your time....

paul
 
It sounds like you are trying to call the variable from a level other than 0. Do you have a loaded movie (level 1+)that is trying to reference the variable?

If that is what you have you will need to be sure to pass the variables when you load the movie.

Code:
loadMovieNum("myMovie.swf",1,"GET");

That will make the _root.reldir variable available to the loaded movie.

You could also assign a global variable.
Code:
_global.relDir = _root.relDir;

That's about all I can think of without more particulars or seeing your flash.

Hope it helps!

Wow JT that almost looked like you knew what you were doing!
 
In the object and embed tags...

...
<PARAM NAME=movie VALUE="reldir.swf?reldir=logos">
...
<EMBED src="reldir.swf?reldir=logos" loop=false...>
...

In the movie, I have a "message" textfield...

stop();
message = reldir;
_root.currentIndex = 11;
_root.movieToLoad = reldir+"/swf/"+_root.currentIndex+".swf";
message = _root.movieToLoad;

And on a button...

on (release) {
loadMovieNum(_root.movieToLoad, 5);
}

Loads logos/swf/11.swf fine, or course tested through the html, where you're passing the variable "reldir"...
 
seems like such a complicated way to get the variable from php to concatenate with a string....but it works.
thank you everyone for your help


"If you build it....it won't work the first time.....or the second ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top