angelaa
09-29-2009, 09:06 PM
hello friends ,
i have this problem , can any body help ?
i have this button in html code :
<html>
<form method="post">
<input type="submit" value="I Agree">
</form>
</html>
can i have its action script 3 code ?
johnpeter
10-21-2009, 12:04 PM
HI,
1. Create a button, just as you would in Flash 8.
2. Select the instance, and add the instance name monkey_btn in the Property inspector.
3. Insert a new layer, and rename it actions.
4. Open the Actions panel (Window > Actions), select frame 1 of the actions layer, and add the following ActionScript in the Script pane.
monkey_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("http://www.flashthusiast.com/"));
}
5. Choose Control > Test Movie to test your document.
And that’s all there is to creating a clickable button with AS3. All you need to do is change the URL to make it work in your own document. Or, you can change that entire line to be something else, such as go to and play a frame number: gotoAndPlay(6);
You can also change the MouseEvent from MOUSE_DOWN to, say, MOUSE_OVER to change how the interaction works. Search Flash Help for MouseEvent, and look at the Class in the ActionScript 3.0 Language Reference.
THANK U..
web design chennai (http://www.websitedesignerschennai.com)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.