Δευτέρα 23 Μαρτίου 2009

Flash Action Script 2.0 - onPress

Take the First movie that you made in tutorial of Motion tween and get make it Stop, and play.

Now Open it and Start

1. Go  to your time line menu and insert a new layer


Name it Action

2.   Now press f9 or go to Window -> Actions


Go to 1st frame of your Action layer and write in Actions panel

stop();


If you press CTRL+ENTER to test your movie you will see that the clip it doesn’t move

3. Let’s make a button 2 make the movie move again. Create a new layer above Actions and layer 1 and name it button. To take it in the middle you just drag it to the middle

    

     4.      Now get the Rectangle tool (R) and make a rectangle on that position

    

    5.       Select the new rectangle and press f8 to convert into a symbol and press button. Name it Button_bt

    

    6.       Now Select the Button_bt and go to Properties panel and give it for Instance name Button_bt

      

    

      It’s a glorius simasia the name that to be right because with this name you call your movie to do something.

      7.   After that go to Action layer in the first frame, open the Action panel and write under the stop();

     

     Button_bt.onPress = function(){

gotoAndPlay(2);

}

This is mean Button_bt - the name of your button (now you call your button to do something)

onPress - when someone press it

function - do something

gotoAndPlay(2) - your movie go to frame 2 and play



    You can Download The source files from here


First Knol In Action Script

Action Script 2.0 & 3.0 in Flash have Tags. This is mean that many words are Loked by Flash and do some specific actions. Tags are to many to remember them. But now we are going to see the most basic Tags that you need to know. Except that Flash AS 2.0 & 3.0 has a Syntax that you have to learn it. It’s not the same in AS 2.0 & 3.0 but if you know the syntax of AS 2.0 it easy to learn and 3.0.

Basic TAGS:

stop(); - that mean your movie stops

play(); - that mean your movie starts play

gotoAndStop(); - that mean (example gotoAndStop(4);) your movie goes to frame 4 and stops

gotoAndPlay(); - that mean (example gotoAndPlay(4);) your movie goes to frame 4 and play

onRelease – that we use it for buttons and we told them on release do something for example: Example_bt.onRelease = function(){}

 

on (release)

onPress

on (press)

etc.

When we encounter them we will explain them.

 

Syntax

When you have two words you can’t use space for example ( on release). This is wrong you have to start the next word close with the previus word, but with Capital like that (onRelease). When you want to call a movie to do something you are going to write the name in front of the Action that you want to do like that (ExampleMc.gotoAndPlay (2);)

Παρασκευή 13 Μαρτίου 2009

Shape Tween In Flash

Now let’s Design simple objects and let’s go to make them Shape.

1.       Create a New Flash Document in AS2

2.       Let it on default settings

3.       Get the Rectangle tool (R) block the stroke color

 and draw a rectangle like that:

  Now let’s get transform it. Take the selection tool (v) and press once in your object

Go to the properties panel and give the values like the image

Now go to the frame 15 and press right click and then press insert key frame or press f6.



Your Shape have to be selected so go to the Fill Color and take a blue color (or something that you want)

Now go to the middle of your time line and press right click and chose Create Shape Tween


Press CTRL+ENTER to test your movie


2 Download the sorce file click here