From:
www.flashvault.net
Step 1
First of all, download images of button symbols that we will use for this lesson.
Step 2
Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the dimensions of your document as whatever you like. Select any color as background color. Set your Flash movie's frame rate to 32 and click ok.
Step 3
Call the current layer button symbols. Double-click on its default name (Layer 1) to change it. Press Enter once you have typed in the new name!
Step 4
Choose File > Import > Import to Library. In the file explorer window that appears, find a three images (button, button1 and button2) and Shift-click to select them all. Then click open. If you now open your flash library (Ctrl+L key) you will see three images that you just imported. See the picture below.

Step 5
Select the Selection Tool (V) and using the drag and drop technique, move all button symbols from the flash Library on the flash stage and place it on the position like it is shown on the picture below!

Step 6
Select now just left rotation button like it is shown on the picture below!

After that, hit F8 key (Convert to Symbol) to convert it into a Button Symbol.

Step 7
While the new made Button is still selected, go to the Properties Panel below the stage. On the left side, You will find the Instance name input field there. Call this Button RightRotate_btn. See the picture below.

Step 8
Select now just up arrow button and hit F8 key (Convert to Symbol) to convert it into a Button Symbol.


Step 9
While the new made Button is still selected, go to the Properties Panel below the stage. On the left side, You will find the Instance name input field there. Call this Button UpArrow_btn. See the picture below.

Repeat this process also for every other button symbols but for instance name choose (DownArrow_btn, RightArrow_btn, LeftArrow_btn and LeftRotate_btn.
Step 10
It's time for Movie Symbol, so create a new layer above the layer button symbols and name it Movie Symbol.
Step 11
Select Movie Symbol layer and draw or import any object, image which will represent movie symbol.
Step 12
While the image or object is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.

Step 13
While the new made movie clip is still selected, go again to the Properties Panel below the stage. On the left side, You will find the Instance name input field there. Call this Movie Clip object_mc. See the picture below!

Step 14
It's time for action script, so create a new layer above the layer Movie Symbol and name ti action script.
Step 15
Select now the first frame of layer action script and enter this code inside the actions panel:
UpArrow_btn.onPress = function() {
object_mc.onEnterFrame = function() {
this._y -= 4;
};
};
UpArrow_btn.onRelease = function() {
delete object_mc.onEnterFrame;
};
DownArrow_btn.onPress = function() {
object_mc.onEnterFrame = function() {
this._y += 3;
};
};
DownArrow_btn.onRelease = function() {
delete object_mc.onEnterFrame;
};
RightArrow_btn.onPress = function() {
object_mc._x += 4;
};
First of all, download images of button symbols that we will use for this lesson.
Step 2
Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the dimensions of your document as whatever you like. Select any color as background color. Set your Flash movie's frame rate to 32 and click ok.
Step 3
Call the current layer button symbols. Double-click on its default name (Layer 1) to change it. Press Enter once you have typed in the new name!
Step 4
Choose File > Import > Import to Library. In the file explorer window that appears, find a three images (button, button1 and button2) and Shift-click to select them all. Then click open. If you now open your flash library (Ctrl+L key) you will see three images that you just imported. See the picture below.
Step 5
Select the Selection Tool (V) and using the drag and drop technique, move all button symbols from the flash Library on the flash stage and place it on the position like it is shown on the picture below!
Step 6
Select now just left rotation button like it is shown on the picture below!
After that, hit F8 key (Convert to Symbol) to convert it into a Button Symbol.
Step 7
While the new made Button is still selected, go to the Properties Panel below the stage. On the left side, You will find the Instance name input field there. Call this Button RightRotate_btn. See the picture below.
Step 8
Select now just up arrow button and hit F8 key (Convert to Symbol) to convert it into a Button Symbol.
Step 9
While the new made Button is still selected, go to the Properties Panel below the stage. On the left side, You will find the Instance name input field there. Call this Button UpArrow_btn. See the picture below.
Repeat this process also for every other button symbols but for instance name choose (DownArrow_btn, RightArrow_btn, LeftArrow_btn and LeftRotate_btn.
Step 10
It's time for Movie Symbol, so create a new layer above the layer button symbols and name it Movie Symbol.
Step 11
Select Movie Symbol layer and draw or import any object, image which will represent movie symbol.
Step 12
While the image or object is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.
Step 13
While the new made movie clip is still selected, go again to the Properties Panel below the stage. On the left side, You will find the Instance name input field there. Call this Movie Clip object_mc. See the picture below!
Step 14
It's time for action script, so create a new layer above the layer Movie Symbol and name ti action script.
Step 15
Select now the first frame of layer action script and enter this code inside the actions panel:
UpArrow_btn.onPress = function() {
object_mc.onEnterFrame = function() {
this._y -= 4;
};
};
UpArrow_btn.onRelease = function() {
delete object_mc.onEnterFrame;
};
DownArrow_btn.onPress = function() {
object_mc.onEnterFrame = function() {
this._y += 3;
};
};
DownArrow_btn.onRelease = function() {
delete object_mc.onEnterFrame;
};
RightArrow_btn.onPress = function() {
object_mc._x += 4;
};
LeftArrow_btn.onPress = function() {
object_mc._x -= 4;
};
LefttRotate_btn.onPress = function() {
object_mc.onEnterFrame = function() {
this._rotation += 3;
};
};
LefttRotate_btn.onRelease = function() {
delete object_mc.onEnterFrame;
};
RightRotate_btn.onPress = function() {
object_mc.onEnterFrame = function() {
this._rotation -= 3;
};
};
RightRotate_btn.onRelease = function() {
delete object_mc.onEnterFrame;
};
We're done now!
Test your movie and enjoy!
object_mc._x -= 4;
};
LefttRotate_btn.onPress = function() {
object_mc.onEnterFrame = function() {
this._rotation += 3;
};
};
LefttRotate_btn.onRelease = function() {
delete object_mc.onEnterFrame;
};
RightRotate_btn.onPress = function() {
object_mc.onEnterFrame = function() {
this._rotation -= 3;
};
};
RightRotate_btn.onRelease = function() {
delete object_mc.onEnterFrame;
};
We're done now!
Test your movie and enjoy!

No comments:
Post a Comment