Skip to main content
Inspiring
June 2, 2009
Question

Why button duplicates itself and stays on stage?????

  • June 2, 2009
  • 1 reply
  • 498 views

Hi all,

I have a little quirk that I cannot think of why or how to solve. swf1 - I have buttons on stage and in the first frame actions;

med.med_btn.onRollOver = function() {
   TweenLite.to(med.med_btn, 1, {_x:10, ease:Elastic.easeOut});
   TweenLite.to(content_mc.contMed, 1, {_alpha:100});
}
med.med_btn.onRollOut = function() {
   TweenLite.to(med.med_btn, 1, {_x:0, ease:Elastic.easeOut});
   TweenLite.to(content_mc.contMed, 1, {_alpha:0});
}
med.med_btn.onRelease = function() {
   //loadMovie("webPoet.swf", "blank");
}

All works fine. This is loaded inside another swf(swf2). Then the parent swf(swf2) calls for the play to go to the next frame of this movie(swf1), where each button(inside its own MC) has onClipEvent(onEnterFrame) action to drop them off the screen.
Everything works perfectly except the last button you have rolled over, creates a double and stays there!!! It happens on only the last one you have touched with the mouse. If you dont touch any they all drop off as required.

Any help would be really gratefully received. I'm lost.I've attached the fla.. not the parent one. Also i created a dirty big next frame button so you can see what happens...

Cheers,
Martin

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
June 2, 2009

it's amazing that's the only problem.

to remedy, clear the frame 2 keyframe in your btn layer and remove all the code that's attached to your buttons.  use tweenlite to tween your buttons into position in frame 1 and use tweenlite to tween your buttons off-stage in frame 2.

Inspiring
June 2, 2009

Hi Kglad,

thanks for the feedback. But I have to ask why? Why are you amazed that is the only problem. Am I missing something? Am I coding wrongly? I'm here to learn and I'm lost at the moment. It makes sense to me. I like the effect of the gravity, rather tweening it out.

Could you fill me in on it.

Cheers,

Martin

kglad
Community Expert
Community Expert
June 2, 2009

because tweenlite is also creating enterframe loops for each of those movieclips.  so, each movieclip has more than one enterframe loop and each is targeting the same movieclip.  it's amazing that there's not more conflict between those loops.

tweenlite can use easing effects (including a gravity like easing and much more).  open your tweenlite.as file and read the comments.  gs shows how to use tweening with his class.