Macromedia Flash - Move objects
With this exercise, you will learn how to move any object with the cursor in Flash 8 using the Action Script.
Step 1
Create a new Flash file, go to Modify > Document ( Ctrl + J ) and set Width to 350px and Height to 250px
Step 2
Double click on layer 1 and rename it to Background. Then insert a new layer named Object.
Step 3
Select the Rectangle Tool (R), and draw a rectangle to represent 'Object'
Step 4
When the Object is selected, press F8 key ( Convert to Symbol ) to convert it into a Movie Clip .
Step 5
Double-click the newly created Movie Clip object or right-click and choose Edit in Place .
Step 6
Then press F8 and convert it to the Button icon
Step 7
Select the Object object, open the Action Script (F9) and enter the following script:
on (press) {
swapDepths (2);
_root.cursor.swapDepths (3);
startDrag ("");
}
on (release) {
stopDrag ();
}
Step 8
Go back to the main scene (Scene 1), click on the first frame of the layer Object and open the Action Script (F9), enter the following line:
help = false;
Step 9
Duplicate the Object layer into several copies as you like.
Step 10
Add a new layer and name it Cursor. Then select the Text Tool (T), and type in the words 'Move it' (or any other content).
Step 11
Select the text (Cursor) layer and press F8 to convert it into a Movie Clip.
Step 12
Then, open Properties and enter the cursor text.
Step 13
Next, select the cursor layer again, open the Action Script (F9) and click on the following script:
onClipEvent (load) {
}
onClipEvent (mouseMove) {
xm = getProperty (_root, _xmouse);
ym = getProperty (_root, _ymouse);
setProperty ("_ root.cursor", _x, xm);
setProperty ("_ root.cursor", _y, ym);
}
onClipEvent (mouseDown) {
with (_root.cursor) {
gotoAndStop ("clench");
}
}
onClipEvent (mouseUp) {
with (_root.cursor) {
gotoAndStop ("open");
}
}
So that's it, would you like to see the product available?
You should read it
- Macromedia Flash - Push objects away from the cursor
- Activate 2-layer verification to secure your Apple ID account
- Instructions for creating 2-layer security for GoDaddy accounts
- Macromedia Flash - Photo effects appear with sound
- How to Change Your Cursor
- Cursor this in C ++
- The most beautiful female layer hairstyles 2020
- Instructions for enabling 2-layer authentication for iCloud on Apple devices
May be interested
- Photoshop CS: Creativity with New Year's greeting card (Part II)a little reminder to you: this real lesson consists of many parts. working in each part is always related to each other. if the same operations are repeated in consecutive sections, i will just use the keyboard shortcut, or speak quickly through that section. therefore, to practice well
- Photoshop CS: Creativity with New Year's greeting card (Part III)have you practiced good ground and ball design for this tet card? do you encounter any difficulties? don't be discouraged when you encounter any difficult steps. the result of labor when you create a postcard yourself is the greatest joy
- Corel Draw: Use the photo corner effect in Corel Drawhowever, you should note that corel only creates drawing objects as vector images, so if you want to use the effects of bitmap images you must convert them to bitmap with the bitmaps command> convert to bitmap. please try, the photo corner effect with corel draw.
- Photoshop CS: Creativity with New Year's cards (Last part)after 4 pieces of tet card design. do you find design and good use of photoshop tools is not difficult, important is patience, and creativity when designing any product right?
- Macromedia Flash - Create vertical Flash menuyou have seen many beautiful flash menus and want to do that? take a look at this exercise and you'll know how to create a vertical flash menu.
- Macromedia Flash - Effects with the cubein this article, i will explain how to create an advanced effect with flash 8-based blocks or shapes and of course use action script.