Hello i am using Flash AS2 and i was wondering if there is a way to fade out a movie clip when the playhead reaches a certain frame on the main timeline...

I am sure that i should use this._alpha but i dont know how to tell flash to fade out when it reaches frame 300.

Any ideas?

Thanks in advance...

Do you want it to fade to white or black?

Do you want it to be completely faded by frame 300 or start at frame 300?

You can always make a graphic symbol of a black or white box. Insert a keyframe and drag the symbol to the stage where ever you want the fade to start. Set a keyframe where you want the fade to end. Make it a motion tween. Set the first symbols alpha channel to make it disappear and you are done.

Hi and thanks for your quick reply...

I have the following AS code on my mc..

onClipEvent (enterFrame) {
                this._x = this._x-0.5;
}

And i want it start fading out at frame 300...

If i do it manually with tweens its wont do it.,..the clip keeps moving..

This depends on whether you are using actionscript on a single layer to play your movie, or you are playing your movie accross several frames say 300 frames manually.

if you are using several frames then its better to set the motion tween at frame 300.

then set the alpha of the movie clip to 100 in the properties panel
got to the last frame on the time line and set the motiion teen and the alpha of the movieclip to 0. then you will have it fade from frame 300.

if you are using actionscript code.

since you have set the movieclip to start moving on enterframe then
you can set a varriable equal to the x position of the movieclip
set the code to set the alpha of the clip to fade in once the x position is a certain value
say 100.
code is this

var xCounter:Number;
       xCounter = mc_Clip._x

code step 2

if (xCounter >100) {
           mc_Clip._alpha += 5;
       }

remeber "mc_Clip" is your movie clips instance name. make sure its set.
you can put this code in your first frame and you will be done with the harsle of frames.

great...thanks for all your help!!!

Hi guys i've found this thread and im having the same problem, my code is

onClipEvent (enterFrame) {
     i = getProperty(this,_rotation);
     setProperty(this,_rotation,i + 0.5);
}

When i insert the line posted above, my movie clip stops spining. My objective is to make my MC keep rotating and start to fade out in a specific frame. Any ideas?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.