Forum Moderators: open
You have a variable in Flash,
var current_page='';
When you pass a variable value using FlashVars or addVariable,
flashVars="current_page=home"
flashObject.addVariable('current_page','home');
this sets the variable to that value.
Somewhere in your ActionScript, you set the state of the buttons. This is not working code, but gives you an idea, operating on an array of the buttons in the movie:
for (j=0;j<allButtonObjects.length;j++) {
allButtonObjects[j].displayState =
(allButtonObjects[j].name==current_page)?'highlighted':'up';
}
The above says,
"go through all the button objects and set the display state, either by a function or setting the object attribute."
"If the object name matches the variable current_page, set it as highlighted, otherwise, set it for the up or 'normal' state."
As said this is not working code and will highly depend on how the menu is coded, but should give you a working idea.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="837" height="80" align=middle id="aboutus">
<param name=movie value="aboutus.swf">
<param name=quality value=high>
<embed src="aboutus.swf" quality=high width="837" height="80" name="aboutus" align=middle type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>