Then click on the picture of the bird and open the properties box. Select "movie clip" and underneath there is "instance name" and input the instance name: "bird". After that, click on the picture of the bird and actions open the box and enter this code:
onClipEvent(load)
{ function reset()
{
if(this._name=="face")
{
this._visible=false;
}
else
{
this._visible=true;
}
this.dead=0;
this.speed=random(4)+3;
this._x=600;
this._y=random(400);
}
this.reset();
}
onClipEvent(enterFrame)
{
this._x-=this.speed;
if(this._x<-40 data-blogger-escaped-code="" data-blogger-escaped-this.reset="">
Enter the code at the bottom of the layer 1 frame 1 in the actions box:
for(i=1;i<=5;i++)
{
_root["burung"].duplicateMovieClip("burung"+i,i+1000,burung);
}
The next stage we created animations for the dead bird bird clip by clicking and right click select "edit" (Gated to create animations) as the following example:
Then we click on the main fame and enter the following code:
stop();
Now create a second frame by right clicking next to the main frame and select insert frame insert frame and what image you want to create here. And enter the code below in fame to 2:
this.dead=1;
Example:Then click on the last frame and enter the code below:
this.reset();
Then we create the drawing using a drawing tool cursor. Selection of the cursor image and convert into a movie clip symbol. Click the cursor, open the action panel and typing the following action:
onClipEvent (load)
{
startDrag(this, true);
Mouse.hide();
this.swapDepths(9999);
}
onClipEvent(mouseDown)
{
playsounds = new Sound(this);
playsounds.attachSound("shot");
playsounds.start(0, 1);
for(i=1;i<=5;i++)
{
if(this.hitTest(_root["face"+i])&&_root["face"+i].dead==0)
{
_root["face"+i].gotoAndPlay(2);
}
}
}
The last stage try and run the movie, then move the mouse.
No comments:
Post a Comment