Jump to content
Search Community

Really restart();...really?

sondanz test
Moderator Tag

Recommended Posts

Hey peeps,

 

I'd love some help trouble shooting this restart button...

 

View the .swf here: http://www.cleanplate.biz/storage/za_extreme/

 

As you can see, my 'play again' button (at the end of the animation) is restarting with my skydiver already onscreen. It's kinda creepy...she's just floating there...blankly staring at you...judging you...

 

Here's my actionscript (AS2):

// clickTag
stuff.dlButton.onRelease = function () {
getURL(_level0.clickTag,"_blank");
};

// repeat button
stuff.playAgain.onPress = function() {
  myTimeline.restart();
}

////////////////////////////////////////////////////////////////////////////////////

// animation
import com.greensock.TweenLite;
import com.greensock.TimelineLite;
import com.greensock.easing.*

var myTimeline:TimelineLite = new TimelineLite();

myTimeline.insert(new TweenLite(clouds1,	15, {_y:"-1500"}), 0);
myTimeline.insert(new TweenLite(clouds2,	15, {_y:"-1500"}), 0);
myTimeline.insert(new TweenLite(clouds3,	15, {_y:"-1500"}), 0);
myTimeline.insert(new TweenLite(clouds4,	15, {_y:"-1500"}), 0);
myTimeline.insert(new TweenLite(clouds5,	15, {_y:"-1500"}), 0);

myTimeline.insert(new TweenLite(girl,		2, {_y:"200", ease:Expo.easeOut}), 0);
myTimeline.insert(new TweenLite(chute1,		24, {_x:"40", _y:"850"}), 2);
myTimeline.insert(new TweenLite(girl,		1.25, {_y:"600", ease:Expo.easeIn}), 1.75);

myTimeline.insertMultiple([ 
new TweenLite(clouds1,				1, {_alpha:0}),
new TweenLite(clouds2,				1, {_alpha:0}),
new TweenLite(clouds3,				1, {_alpha:0}),
new TweenLite(clouds4,				1, {_alpha:0}),
new TweenLite(sky,					1, {_alpha:0}),
new TweenLite(stuff,					1, {_alpha:100})], 
6.5, myTimelineLite.duration);

stop();

 

Any thoughts?

Link to comment
Share on other sites

Your 2nd girl tween is overwriting the first because you didn't space them out properly (the 1st one lasts 2 seconds and the 2nd one starts at 1.75 seconds so as soon as it begins, it kills the first tween)

 

myTimeline.insert(new TweenLite(girl, 2, {_y:"200", ease:Expo.easeOut}), 0);

myTimeline.insert(new TweenLite(girl, 1.25, {_y:"600", ease:Expo.easeIn}), 1.75);

 

If you make the first one last 1.75 seconds OR make the 2nd one start at 2 seconds, you'll be fine (basically, don't let them overlap). Make sense now?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...