I’m making a website and I want to make MouseEvent.ROLL_OUT and then be able to click on the object i deffined as button. How can i do that?
I tried this but it’s not working…
b2.addEventListener(MouseEvent.ROLL_OVER, b2_out);
b2.addEventListener(MouseEvent.CLICK, b2_clicked);
function b2_out(event:MouseEvent):void
{
this.gotoAndStop("page1");
}
function b2_clicked(event:MouseEvent):void
{
this.gotoAndStop("page6");
}
If Adobe Flash cs6 you can choose either “MovieClip” or “Button” as you convertig an object ( image or a simple rectangle ) to a symbol. ( rightclick -> convert to symbol )
the easy way is to choose “button”, there you already have the diferend button states.
but animation is complicated this way. so if you dont have transition effects, this will be your bet.
you can simply key one of the 4 frames if you go inside that BUTTON-movieclip you’ve just created.
the other way would be to choose “MovieClip”.
that way you have to use the timeline to animate the transition effect.
the code for that is pretty simple.
in yout parent movieclip ( or root ):
hope this is helpful. rate and mark as answer if it is.
also you could check on youtube for video tutorials or sites like developphp.com.
the web is full of tutorials on flasch / as3.
have fun. Ace