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

Controlling flash mc with JS problem

Status
Not open for further replies.

bubu

Programmer
Mar 3, 2002
463
RO
Hello guys!

I have a menu in flash and I want to control the pressed instance from an HTML file using a JS function.

So what I am trying to do .. is to tell the flash movie to go to a certain "label" and to set a _global variable due to the page I am in.

For a closer view:

So each time a menu item is pressed, one of the pages loads in (page1, page2, page3, page4 and page5)...and the right menu item should be highlighted (black) and the _global.menu_selection variable should be updated so that on the selected menu item the rollOver and rolOut events not to be active.

My JS function can't read the _global.menu_selection variable from the flash movie...THIS IS MY PROBLEM...if you delete the line in the JS function that uses GetVariable you will notice that you have another result.

JS function:
function controlFlashMovie(objElement, strValue)
{
var objFlash, currentSelection;
objFlash = eval("document." + objElement);
if (objFlash.PercentLoaded() == 100)
{
try
{
currentSelection = objFlash.GetVariable("_global.menu_selection");
if(currentSelection != strValue)
{
objFlash.TGotoLabel("_root.button" + strValue + "_mc", "pressed");
objFlash.SetVariable("_global.menu_selection", strValue);
}

}
catch(strError)
{
}
}
}

.fla:

All the sources





Regards,
Dragos.
 
Cheers for all the porn popups Dragos - certainly brightened up my day. May be an idea to move your hosting account? ;-)
 
No strange pop-ups on me wangbar...but i'm glad you feel better :)

Regards,
Dragos.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top