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.
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.