Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

How to make Actionscript 3.0 Buttons in Flash! - READ DISCRIPTION Part 3/3

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
19,915
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Aug 20, 2009

Here we'll top the entire tutorial off with some coding! Welah!

Here's the coding we used, but I suggest you memorize it. Copying and pasting code isnt very professional.. :

//Home button code

homebtn.addEventListener(MouseEvent.CLICK, btn1);
function btn1(event:MouseEvent):void{
gotoAndStop(2);
}

//Anim button code

animbtn.addEventListener(MouseEvent.CLICK, btn2);
function btn2(event:MouseEvent):void{
gotoAndPlay(3);
}

//Site button code

sitebtn.addEventListener(MouseEvent.CLICK, btn3);
function btn3(event:MouseEvent):void{
navigateToURL(new URLRequest("http://www.youtube.com/user/mcvdigital"));
}

NOT READ THIS!
SOME CODE MIGHT MESS UP! IF IT DOESNT WORK WATCH THE VIDEO AND TYPE IN THE CODING. THE REASON WHY IT MESSES UP? BECAUSE OF THE DESCRIPTION. IT MIGHT CUT SOME OFF BECAUSE OF THE SIZE OF THE DESCRIPTION BOX!

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 4 dislikes

Link to this comment:

Share to:

Uploader Comments (mcvdigital)

  • yes mate u saved my ass! LOL i have a flash assignment to do at university and this has help loads THANK YOU SUBBED! :)

  • @iAmMasterF Aha glad I could help!! And thanks for the sub :D

  • Why is it when I type the "stop();" code it rarely ever works when I play the movie? I've heard that it doesn't work when it is placed with a button code is that the reason?

  • @thepixelizer Of course! You can't put a Stop(); code in a button! Are you trying to tell the button to stop? Nah, but you want the Frame to stop, correct? So taking a lucky guess, I think you'd have to put the Stop(); code on the frame. Hmm..

    So click on the Frame, and press F9 and then type in your Stop(); code there, and like magic, I guarantee it'll stop.

  • can you help me how can i integrate my code on my flash to my visual basic.. just like when i try to click a button on my flash it pops up a form from my visual basic..

    thanks ..waiting for you mr,,

  • @yantzkieboy Haha, sorry man, I don't get what you're saying.

    What's a visual basic?

see all

All Comments (67)

Sign In or Sign Up now to post a comment!
  • @mcvdigital Lol im eating a sub right know xD

  • do you still read the comments? help please.

    We need to know how to make a button go to the next scene, from scene 1 to scene 2.

  • literally learnt more in half an hour than a whole day at uni

  • how old are u

  • The best tutorial. you took a classic program that changed into a hard to use application and simplified it. You explained better than any other book i have read on the subject. And i love the way you explained it. You was articulate, expressive and you kept the viewer attention.

  • how can i delay.

    like you press a button but the object will appear in 4 sec.

    please please answer

  • Thanks! The hardest thing for me in migrating to AC3 was figuring out how to reference items on the stage without attaching code to them... problem solved! ^_^

  • THIS IS A GREAT DEMONSTRATION BUT CAN SOMEONE SHOW ME HOW TO DO THIS FOR AN ACTUAL F4V MOVIE AND NOT AN ANIMATION! CAN SOMEONE MAKE A TUTORIAL TO PLACE A PLAY / PAUSE BUTTONS ON F4V MOVIE? IT IS WITH THE F4V MOVIE IMPORT WHERE I GET IN TROUBLES WITH TIMELINE. THANKS IN ADVANCE...

  • THANK YOU SO MUCH! ive been trying to make a button, for an android app i am making, but it is SO diferent from as2 o_0 thanks to u, i can start working on it again :D

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more