Go Back   BWHacks > General > Graphics & Arts > Graphics Tutorials

Reply
 
LinkBack Thread Tools

Old 05-19-2005, 03:07 AM   #1 (permalink)
Ganondorf
Premium Brawler Account
Senior Member

Enlightened
 
Ganondorf's Avatar
 
Join Date: Feb 2005
Posts: 2,575
Ganondorf has a brilliant futureGanondorf has a brilliant futureGanondorf has a brilliant futureGanondorf has a brilliant futureGanondorf has a brilliant futureGanondorf has a brilliant futureGanondorf has a brilliant future
Send a message via AIM to Ganondorf Send a message via Yahoo to Ganondorf Send a message via Skype™ to Ganondorf
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.
__________________
Ganondorf 15 0FF11|\|3   Reply With Quote
Advertisement
 
Advertisement
Sponsored links


Old 05-19-2005, 09:51 PM   #2 (permalink)
Noober
Wtf is an acolyte?

Evangelist
 
Noober's Avatar
 
Join Date: Feb 2005
Posts: 1,116
Noober is a jewel in the rough
Send a message via AIM to Noober
Default

"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.
Noober 15 0FF11|\|3   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Advertisement

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash MX 2004 Professional : Beginners Flash Tutorial (released). Ganondorf Graphics Tutorials 4 07-22-2005 10:47 PM
Website Links : Ultimate Beginners Flash Tutorial. Ganondorf Graphics Tutorials 5 07-14-2005 12:43 AM
Flash MX 2004 Professional : Anchor Rotation. Ganondorf Graphics Tutorials 4 07-10-2005 07:37 PM
GameThreat Enigma General Chat 71 09-04-2004 07:18 PM


All times are GMT. The time now is 01:54 AM.


vBulletin style developed by Transverse Styles

Powered by vBulletin Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
Copyright © 2004-2008 BWHacksAd Management by RedTyger