hey i just want to know,how can i do when i rollover a buton on cs4 to play a scene.
i have this code from 2.0,but i dont know on 3.0.
on (rollOver)
{
gotoAndPlay(1);
}
thank you
hey i just want to know,how can i do when i rollover a buton on cs4 to play a scene.
i have this code from 2.0,but i dont know on 3.0.
on (rollOver)
{
gotoAndPlay(1);
}
thank you
you need to first name the button giving it an instance name in the poperties panel. So let's say its submit_btn. The code for a button in AS 3 is
submit_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
want the button to do here;
}
so basically you are listening for the click of submit_btn and then running a function called mouseDownHandler. Then after that line of code you action write out what the function mouseDownHandler will do when you click the button. Hope this helps!
I believe that gotoAndPlay(); still works in AS3. So just stick that code between the curly brackets and change the name of the button to whatever you named your button in flash and it should jump to that frame.]
gotoAndPlay(1) will go to frame 1 of the current scene.
gotoAndPlay("scene1") should play scene "scene1" (iirc).
Paultechdocs asked for a rollover, not the mouse down.you need to first name the button giving it an instance name in the poperties panel. So let's say its submit_btn. The code for a button in AS 3 is
submit_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
want the button to do here;
}
So basically its the same code, except you change the MouseEvent to MOUSE_OVER
Code:submit_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseDownHandler); function mouseDownHandler(event:MouseEvent):void { want the button to do here; }
true true... but odd user interaction to change a scene on mouseover....![]()