Δευτέρα 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

Τρίτη 10 Μαρτίου 2009

How we can set the position of our movieClip inside from the property panel

The movie clip starts count the position and width of our movie clip from the top and left see below:


So what is That Numbers?

The W:132.0 is the Width of our Shape


The H:132.0 is the Height of our Shape


For the position We have two axis X,Y Like that:


So when we Move Our Shape, we move it over this axis

X: is the Left and Right


And Y: is the Up and Down


So if we want to move it, we can drag it to the position that we want Or we can write the position into the properties panel.


For Example if we want to live 10pixels from the right side we have to do that execution:

550 (Our movie) - 132 (our MovieClip) - 10 (the pixels that we want to have space from right)

= 408 (the number that we have to write at the properties panel):

Τετάρτη 4 Μαρτίου 2009

1st Design Tutorial in Flash Motion Tween

Now let’s Design simple objects and let’s go to make them (move).

1.  Create a New Flash Document in AS2

2. Leave the default settings

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


and draw a rectangle like this:


4.Now let’s transform it. Use the selection tool (v) and click once on your object

Go to the properties panel and give the values like below

W: is the width of your Shape

H: is the Height of your Shape

And X,Y are the position in your movie (starts to counter in top and left of your movie) of your Shape (you can put it ever you want). BUT be

careful to chose only integer numbers as shown above, we do this to have a smooth Movie or

else it’s possible to have “brakes” and it’s not so pretty.

An example not to follow is shown bellow

(Wrong)

5. Now transform it into a Symbol. Go to Modify à Convert to Symbol…, or press f8.


You have three options:

Movie Clip - you create similar objects with the one you are now. It’s the most effective Symbol

Button - it’s pretty easy to make some nice buttons, but with the action script Movie Clips are

better than buttons (I will tell you why In the Action Script tutorial)

Graphic – I don’t really like them so I don’t use them when I need Graphics I convert my objects

to Movie Clips to.

Chose the Movie clip option and name it Rectangle_mc. There should be a movie clip object in

your library named Rectangle_mc.

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

7. on frame 15


8. Get your Rectangle_mc and drag it on the bottom and right of your Clip. Or go to the properties of your Rectangle_mc and write:

9. Now in the 1st frame the Rectangle_mc is on the top of your movie and in the 15th frame it is in

the bottom. Let’s make it move. Go to a frame between the 1st and the 15th right click on the

time line and press Create Motion Tween

10. Now Let’s test our movie, press CTRL+ENTER to test it

That’s it It works....



Take the source files from here

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

Introduction in Flash

Before you start Flash, you have to know the most basic tools which you cannot avoid, when you use Flash. So we are going to start with the Design part of Flash which is easier and l8r, I will show you how you can use the Action Script in your flash. Let’s get Start.


1.       Open your Flash and go to Flash File (Action Script 2.0). U can also use Action Script 3.0, but most movies and tutorials in flash are based in Action Script 2.0. So that’s why I’m going to show you AS2.

2.       Your Basic menu in flash:


3.       In the left Side you have the tools (for design).

·         Selection tool (you can press V of your keyboard to selected), It’s the tool that you can select and move objects on your movie.

·         Text tool (can press T of your keyboard to selected), you can write a text with that tool.

·         Rectangle (you can press R of your keyboard to selected). It’s from most basic tools and you can draw objects with that.

·         Fill Color, Stroke Color, are basics to objects and with the Fill Color you set the color you want to have the inside of your object, and the stroke color you set the color you want to have the outline of your object. Most of your Design objects needs to disable the stroke color. To disable stroke color you have to, selected and press in:

                That are the most basic tools in flash that you have to know before start.

4.       On the top you have the time line. Which have Frames. Default fps in flash are 12, this is mean that every 12 frames it pass a second so we call that relation fps (Frames per Second). It’s to low for a nice video that’s why we use 30 or 40 fps (to be more smooth our video). Time line has many uses you can make a video in only one Frame or you can use many frames in your timeline (I will show you l8r how you can do it). Also On time line you can put your Actions to do your Flash more interactive.


5.       On the bottom you have properties panel it configure according which object you have select. If you have nothing selected (like now) you can modify globalize your movie like background color, fps, the size of your document, etc.


6.       On the right is the library here you can find all stuff that’s your flash have. You can find your primordial material like images you have inserted, or material that you just create like your buttons or your movie clips.


That’s the introduction of flash that you need to know before do anything on that program.