madasczik
asked on
How do you express if a passed in variable is defined?
I'm using 2 instances of a single swf file on my webpage, one on the left nav and one on the right nav. Both of which I'm trying to output from flash, the height of the movieclip that is generated dynamically. Since i'm using the same swf I changed the id on the param and embed tags so the javascript function can resize each accordingly. I'm having trouble with some syntax though to specify wheather a variable is defined or not in flash.
How do I express if a variable is defined in flash?
I also need to add on the same variable to the javascript function name, confused on the syntax.
Here's what I got so far:
if (_root.siteID ???is defined???) {
var jsFunction = "resizeMovie" + _root.siteID;
}
else {
var jsFunction = resizeMovie;
}
getURL("javascript:jsFunct ion('" + navWidth + "','" + startLeftNavY + "');");
-------------------------- ---------- ---
or should it go something like this:
if (_root.siteID ???is defined???) {
getURL("javascript:"resize Movie" + _root.siteID('" + navWidth + "','" + startLeftNavY + "');");
}
else {
getURL("javascript:resizeM ovie('" + navWidth + "','" + startLeftNavY + "');");
}
-------------------------- ---------- ---
I think the first one is more on track but I am unsure, any help would be greatful.
How do I express if a variable is defined in flash?
I also need to add on the same variable to the javascript function name, confused on the syntax.
Here's what I got so far:
if (_root.siteID ???is defined???) {
var jsFunction = "resizeMovie" + _root.siteID;
}
else {
var jsFunction = resizeMovie;
}
getURL("javascript:jsFunct
--------------------------
or should it go something like this:
if (_root.siteID ???is defined???) {
getURL("javascript:"resize
}
else {
getURL("javascript:resizeM
}
--------------------------
I think the first one is more on track but I am unsure, any help would be greatful.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
and then in page script:
function resizeMovie(mywidth,myheig
But you can also use VBscript and FScommand to have flash talk to Html and back. See a nice and complete tutorial here where multiple methods are explained in detail:
http://www.moock.org/webdesign/flash/fscommand/