views:

319

answers:

2

I have a menu with button objects in As3. I want to display the page where user is and for this I must show buttons' over state (which is mc) when flash loads. I'm sending the page parameter to flash. I just need to play the movie clip inside the specific button.

Looking for something like:

btn1.m1.gotoAndPlay(1); or btn1.m1.play();
+1  A: 

try:

btn1.getChildByName("m1").play();

EDIT: ...oh, sorry I thought you where talking about a generic button but you are using SimpleButton class: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/SimpleButton.html

the class by default should play any movieClips you put in there, but accessing it's childs it's a different story, take a look into this: http://www.xtyler.com/code/254

dome
"Call to a possibly undefined method getChildByName through a reference with static type flash.display:SimpleButton."
HasanGursoy
I want to show over state when user opens a specific page. That is why I need this. I want to over button without any action.
HasanGursoy
+1  A: 

Okay Adobe's documentation helped to solve the problem. It toked one day to figure it out but finally I found the appropriate code. It's not maybe the best but it does the trick.:

btn1.upState = btn1.overState;
HasanGursoy