+ Reply to Thread
Showing results 1 to 2 of 2

Thread: Macromedia Flash 2004: ActionScript Tutorial 1

  1. #1
    Premium Brawler Account Senior Member

    Enlightened
    Ganondorf has a brilliant future Ganondorf has a brilliant future Ganondorf has a brilliant future Ganondorf has a brilliant future Ganondorf has a brilliant future Ganondorf has a brilliant future Ganondorf has a brilliant future Ganondorf's Avatar
    Join Date
    Feb 2005
    Posts
    2,610
    Downloads
    4
    Uploads
    0

    Macromedia Flash 2004: ActionScript Tutorial 1

    Since Noober didn't specify whicih kind of tutorials he wants, I've decided to write a helpful actionscript one.

    Introduction: (you may skip)
    ActionScript is Flash's programming language. It is used to create all the fancy buttons and games you see in Flash. Actionscript is an OOP (object-orientieted programming) language, and is fairly simple. Lets start.

    Tutorial 1: Start an animation on the click of a button

    Section 1: Make a button in Flash. I'll name mine go.



    Open up the actions panel. Make sure your button is selected. Put in the following code:

    Code:
    on (release) {
    play();
    }
    Lets take a look at what this does in parts:

    on (release) {
    When the mouse button is released when over the button, do whats in between the { and the }.

    play();
    Start playing through the timeline from the current frame.

    }
    End up the statement.

    There is only one more thing we need to do to make this work. On default, as soon as Flash player is loaded the movie starts playing. To stop this, open up the actions panel again, and select the first frame. Put in this code:

    Code:
    stop();
    I'm sure this doesn't need explanation. Add another frame in the timeline, insert the stop(); onto that frame too, and draw a circle or such on it. Then test your movie (ctrl+enter) and see if it works. Lets take a look at something a little bit different now.

    Section 2: Lets modify our code to do the same thing in a different way. In your second frame, you will no longer need the stop(); command.

    Code:
    on (release) {
    gotoAndStop(2);
    }
    gotoAndStop(2);
    This tells Flash Player to go to the frame 2 and stop. gotoAndPlay(2) would tell it to go to frame 2, but then continue playing through the rest of the movie.



    I hope this tutorial was helpful, and any feedback is appreciated. If requested I will add more sections to this tutorial, and requests for other actionscript tutorials are welcome too.

    I also realize this isn't the best spot for a programming tutorial, but A. This is FLASH! and B. I felt it belonged here.

    Edit: Fix #2.
    Quote Originally Posted by Lil Javi View Post
    HAHA! u should somehow involve a bj in that though! now that would impress me!

  2. #2
    Wtf is an acolyte?
    Evangelist
    Noober is a jewel in the rough Noober's Avatar
    Join Date
    Feb 2005
    Posts
    1,097
    Downloads
    9
    Uploads
    0

    "Nice tutorial."

    ...but those scripts are kind of self explanatory, and I know them already, so... :(

    What I need is like an intermediate animation tutorial (I can do sine tweening and frame by frame) or a beginner's game making tutorial.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 4
    Last Post: 07-22-2005, 10:47 PM
  2. Website Links : Ultimate Beginners Flash Tutorial.
    By Ganondorf in forum Graphics Tutorials
    Replies: 5
    Last Post: 07-14-2005, 12:43 AM
  3. Flash MX 2004 Professional : Anchor Rotation.
    By Ganondorf in forum Graphics Tutorials
    Replies: 4
    Last Post: 07-10-2005, 07:37 PM
  4. GameThreat
    By Enigma in forum General Chat
    Replies: 71
    Last Post: 09-04-2004, 07:18 PM

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts