Help - Search - Members - Calendar
Full Version: button inside movieclip / actionscript 3.0
Pixel2Life Forum > Help Section > Adobe Flash
crea
(Adobe Flash CS3, Actionscript 3.0)

Hi,

I am a pretty new to AS3 so I'm sorry if this seems like a simple question...

In the process of converting from AS2 to AS3, I am stuck on a problem with buttons that are inside a movieclip. They just don't seem to be 'listening':

I have a movie clip on the stage, and inside the movie clip are some buttons.
The reason I put the buttons inside the movie clip is that I am zoom in and out the movie clip from the main timeline (and this worked fine with as2).

Now, on the main stage, if I had this piece of code, I get the button and it works,

//-------- Testing button -----\\
var testbtn0:testSquareBtn = new testSquareBtn();
addChild(testbtn0);
testbtn0.buttonMode = true;
testbtn0.addEventListener(MouseEvent.CLICK, sayHi);
function sayHi(event:MouseEvent):void{
trace ("HI");
}

But if I copy this to an action layer inside the movieclip on stage, something is wrong because the button doesn't react and the cursor doesn't change...

What am I missing ??? angrylooking.gif

Any help appreciated !
crea
Well the problem seems to be solved actually...
Though I'm not really understanding why, reordering my layers did the job...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.