Beruflich Dokumente
Kultur Dokumente
Open Flash and start a new project with dimension of 400 X 300, set the frame rate
at 36 fps, set the background colour as whatever you like, I used white for this
example. See the picture below.
Step 2
Step 3
While the picture is still selected, go to the Align panel (Ctrl+K), and do the
following in the Align panel:
Step 4
Take the Selection Tool (V) and double click on layer 1 to rename its name in
picture. After that, create a new layer above layer picture and name it object.
Step 5
Draw, or Import any object. I will use balloon for this example.
Step 6
Take the Selection Tool (V), select the object and press F8 key (Convert to Symbol)
to convert this object into a Movie Clip symobl. See the picture below.
Step 7
While the object is still selected, go to the Properties Panel (Ctrl+F3) to its
left side. You will find the Instance name input field there. Call this Movie Clip:
object_mc. See the picture below.
Step 8
Create a new layer and name it text. After that, take the Text Tool (T) and in the
Properties Panel (Ctrl+F3) below the stage, select the following options:
After that, click and drag out a text field on the stage. See the picture below.
Step 9
Then,in the Properties Panel for type (call this Dynamic Text) information_txt. See
the picture below.
Step 10
Create a new layer and name it Action. Select it, click on the first frame, press
F9 or select Window > Actions to open the Actions panel.
After that, enter the following ActionScript code inside the Actions panel:
2 .var speed:Number = 4;
2. Set the speed for the object
3. object_mc.onEnterFrame = function() {
3. Capture the onEnterFrame event of the object_mc movie clip
4. if (Key.isDown(Key.RIGHT)) {
this._x = this._x + speed;
} else if (Key.isDown(Key.LEFT)) {
this._x = this._x - speed;
}
5. if (Key.isDown(Key.UP)) {
this._y = this._y - speed;
} else if (Key.isDown(Key.DOWN)) {
this._y = this._y + speed;
}
};
We're done!