Click to See Complete Forum and Search --> : how to make a mc reappear after animation is over?


Kbee
08-08-2006, 08:41 PM
If you go to

http://www.enhancedwireless.net/Technology/keyMechtest.shtml

I need to know how to make the play_mc fade out ALL the way upon clicking it (if you look closely there's a remnant of it after it's supposed to have faded out) and how to come fully back at the end.

Currently this play_mc is on the same frame on the main timeline as the main movie clip, KeyMech_mc, and has action script (on an actions layer) on frame one of the timeline as below -

_root.KeyMech_mc.stop();

play_mc.onRollOver = function(){
this.gotoAndStop("over");
}
play_mc.onRollOut = function(){
this.gotoAndStop("out");
}
play_mc.onRelease = function(){
this.onEnterFrame = function(){
so = this;
rate = 15; // choose number between 1 and 100

newAlpha = so._alpha - rate; // subtract rate from current volume
if(newAlpha > 0) { // continue fade
so._alpha = newAlpha; // set newVolume to decrease volume

}else if(newAlpha == 0)
delete onEnterFrame;
}
}

(The above script was kindly given to me)

And on the play_mc clip itself is this:

on(press){
_root.KeyMech_mc.play();
}

Inside the main KeyMech_mc in the actions layer on the last frame is this:

gotoAndStop("Scene 1", 1);

Lastly, there is a stop action on frame 1 inside the play_mc. And there is a drop shadow on the word "play" which I added in "filters" using Flash 8 Prof. Don't know if that's the remnant I'm seeing, if so how to get rid of?

So given what I'm trying to do, what do you suggest?

Thanks much
KB

Natdrip
08-09-2006, 06:11 PM
this.mc.up_btn.onRelease = function(){
_root.playtype = "reverse"
}
at the end of your mc layer after you use a tween to fade the pic stop it on an empty clip. the user will not see anything.

then when you want it to refade use the function provided and in frame 1 of the mc time line action layer put this
playtype = "normal"

this will solve your problem.

Kbee
08-09-2006, 06:43 PM
Thanks very much for the reply - being new to Flash 8, I'm struggling to understand -

Inside my play_mc (the word play and its hover state) I have 3 layers - 1.) actions layer with a stop action on frame one, 2.) TEXT LAYER - the up state of the word "play" on first frame, the over state of "play" on frame two... 3.) a layer named labels, with 2 frames, 1st one has frame label of "out", 2nd frame is "over"

How do I put a tween on the above if I even need it?

Is this:

this.mc.up_btn.onRelease = function(){
_root.playtype = "reverse"
}

intended to be placed on the last frame of my play_mc or the last frame of my main keyMech_mc? Why is the code this.mc.up_btn? Should it be this.play_mc.onRelease?

Lastly where does

playtype = "normal"

go? After all that alpha code on main timeline on actions layer as below?

_root.KeyMech_mc.stop();

play_mc.onRollOver = function(){
this.gotoAndStop("over");
}
play_mc.onRollOut = function(){
this.gotoAndStop("out");
}
play_mc.onRelease = function(){
this.onEnterFrame = function(){
so = this;
rate = 15; // choose number between 1 and 100

newAlpha = so._alpha - rate; // subtract rate from current volume
if(newAlpha > 0) { // continue fade
so._alpha = newAlpha; // set newVolume to decrease volume

}else if(newAlpha == 0)
delete onEnterFrame;
}

playtype = "normal"
}

These are detailed beginner questions I realize...thanks for your time.

KB