Lesson 2 - My First Actionscript

Don Von Alpha Dom
by Don Von Alpha Dom · 6 posts
14 years ago in Flash
Posted 14 years ago · Author
Warning: the way to add code to buttons has changed since these videos were made

How do add actionscript to a button:
1) click on your button, and name your button in the properties tab
2) add a new layer
3) right click the stage in the new layer and click actions to open the actionscript window
4) add the following code
Code
yourButtonNameHere.addEventListener(MouseEvent.CLICK, myButtonNameHereFunction);

function myButtonNameHereFunction(event: MouseEvent)
{

 WRITE CODE FOR THIS BUTTON HERE

}


Watch the following videos in order:
1) http://www.youtube.com/watch?v=U49_tSB_HrE
2) http://www.youtube.com/watch?v=nYkIMVO5 ... 1B&index=7
3) http://www.youtube.com/watch?v=rmhc8Dsy ... 1B&index=9

Assignment:
For this assignment we will be creating a music video. Your flash assignment should include your favorite song, some animations, custom buttons, and a link to the band's website.

01) Draw your own play, stop, pause, skip, back, and jump button onto the stage, do not use buttons that are already in the library

02) Convert each button you drew into button symbols, re-watch video 3 if you do not remember how to create custom buttons

03) Import your favorite song into the project

04) Drag the song onto the stage, see assignment 1 instructions if you do not remember how to add sound

05) Name your first layer "GUI", and stretch it to the length time line to the length of the song

06) add an action to the play button, and code the movie to play when the button is clicked

Code
On(release)
 {
 play();
 }


07) add an action to the stop button, and code the movie to stop when the button is clicked

Code
On(release)
 {
 gotoAndPlay(1);
 }


08) add an action to the pause button, and code the movie to pause when the button is clicked

Code
On(release)
 {
  stop();
 }


09) add an action to the jump button, and code the movie to jump when the button is clicked, place the frame number of the frame containing your favorite part of the song into the "gotoAndPlay" method

Code
On(release)
 {
  gotoAndPlay();
 }


10) coming soon
Last edited by Don Von Alpha Dom on Mon Nov 30, 2009 2:32 pm, edited 1 time in total.
Posted 14 years ago · Author
Ok, I am going to have to ask that no one goes past lesson 2.

I have the assignment done, but actionscript has changed enough over the past year, that these videos will do not provide with the information needed to complete assignment 2. I have not been able to find an up to date video, so I am going to make my own. I have already gathered the necessary software and hardware. I will be making the new video for this lesson on Tuesday, and should have it online by Thursday morning.

Thank you for your patience, and I am sorry for the delay,
Professor Don Von Free Credits =;
Posted 14 years ago
Don did you make the new video tutorial or not yet ?
Posted 14 years ago
cool
Posted 12 years ago
Thanks! :wink:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT
Select a forum Protection     Help & Support     Introductions     Mafia News     IMVU News General Discussion     IMVU Lounge        IMVU Series / Roleplaying        Social Games     Mafia Market     Mafia Tools        Premium IMVU Tools        Off Topic Tools     Off Topic     Contests Creator Corner     Graphics Design        Photoshop        GIMP     Basic Creator Help     Catalog And Product Showcase     3D Meshing        3Ds Max        Sketchup        Blender Gangsters with Connections     White Hat Activities        Google Hacking        Trackers Programming Corner     Coding        Python        .Net (C#, VB, etc)        Flash        JAVA        Autoit        Batch        HTML & CSS        Javascript        PHP        Other        IMVU Homepage Codes           General           About me Panel           Messages Panel           Special Someone Panel           Visitors Panel           New Products Panel           Rankings Panel           Wishlist Panel           My Badges Panel           Outfits Panel           Url Panel           Groups Panel           Slideshow Panel           My Room Panel           Sandbox panel           Layouts     Help & Requests Free Credits     Approved Methods     Submit Methods Free Money     Approved Methods     Submit Methods Adult Corner     Get Mafia AP Here     AP Lounge        AP Social Games        Casual Dating Tips     IMVU Slave Market & Escorts