Macromedia Flash - Advanced masking with action script
In this exercise, I will show you how to mask dragging with the action script code. How to create is very simple, follow the steps in this lesson sequentially!
Drag the circle below with the mouse!
Step 1
First, select the picture as the background for this exercise.
Step 2
Create a new flash file. Press Ctrl + J ( Document Properties ) and set the width and width (Hight) of the file to the width of the image. Select any background color and set the Frame rate of the file to 32 , then click OK .
Step 3
Select the file, go to Import > Import to stage (Shortcut: Ctrl + R ) and import it into the image you selected.
Step 4
While the image is still selected, go to the Align Panel ( Ctrl + K ) and follow these steps:
1. Make sure that the Align / Distribute to Stage button is selected,
2. Click the Align horizontal center button
3. Click the Align vertical center button
Step 5
While the image is still selected, press F8 key ( Convert to Symbol ) to convert the image into a Movie Clip.
Step 6
When the new Movie Clip is still selected, go to the Properties Panel below. On the left side of the Instance name field, enter the name of the Movie Clip. In this example will be photo .
Step 7
Create a new layer and name it mask . Use the Oval Tool (O) to draw a circle like the image below (hold Shift in the drawing process).
While the circle is still selected, press F8 key ( Convert to Symbol ) to convert this circle into a Movie Clip.
Figure 8
When the new made Movie Clip is still selected, go to the Properties Panel below the stage. In the left part, enter the name Movie Clip in the Instance name field, in this example enter the mask
Step 9
Create a new layer above the layer mask and name it action .
Step 10
Select the first frame of layer action, go to Action Script (F9) and enter the following code:
stop ();
photo.setMask (mask);
mask.onPress = function () {
startDrag (this);
}
mask.onRelease = function () {
stopDrag ();
}
Check the newly created product (Ctrl + Enter)
You should read it
- How to Make a Mask Using the Olsen Mask Pattern
- Amazfit Aeri self-sterilizing mask, supports unlocking the smartphone with the face even when wearing a mask
- Warning: New research has identified the corona virus to remain on the mask for more than a week
- How to Find the Subnet Mask
- Macromedia Flash - Making fireworks effects
- How to wear a mask without blurry glasses
- Explore the process of researching and manufacturing masking salt, steaming of cajeput oil in Vietnam
- How to sharpen images in Photoshop in 2 ways
May be interested
- Macromedia Flash - Create premium banners with flashwith this article, you will learn how to create fuzzy flash banners by using masks without using action script code.
- Macromedia Flash - Create flash menu with soundin this flash tutorial, we will guide you to create a dynamic flash menu with sound. you can use this menu on any website.
- Macromedia Flash - Text display effectthis lesson will show you how to create a very nice text effect that can be used in some banner effects, advertisements, and presentation files ...
- Macromedia Flash - Create current date and time notificationsin this lesson, you will learn how to create a file that announces the current date with flash. just use the given code to quickly create this file.
- Macromedia Flash - Zoom in / Zoom out with the buttonthis exercise will show you how to create a zoomed in and out movie clip using the buttons and action script in flash 8.
- Macromedia Flash - Create photo album using mask techniquein this tutorial, we will show you how to create a stylish photo album display using a mask technique in the flash program. you will not have to use any action script fragment in this tutorial. this article can be applied to create photo albums, website banners, advertising galleries ...
- Macromedia Flash - Create a simple menuin this article, i will explain how to create a simple flash menu in flash 8 using the action script.
- Macromedia Flash: Create effects for nature photosthis tutorial will show you how to create simple effects for nature images using some special flash tips. this tutorial is implemented on flash cs5, there may be some differences if you use another flash version.
- Macromedia Flash - Dynamic cursor objectread this exercise and see how to create a dynamic cursor with just a few basic steps and of course use action script in flash 8.
- Macromedia Flash - Mysterious wordsyou want to hide an image or a text under a photo and it will only appear when you hover your mouse over? this exercise will give you a way to create a mysterious text effect in flash 8 using the action script.