Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
timaging

go to end of timeline with button?

Recommended Posts

Hi,

 

I am trying to figure out how to get a button to go to the end of a timeline, around 66 sections. Here is what I have:

buttonSkipOff.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPageS);

function fl_ClickToGoToWebPageS(event:MouseEvent):void
{
yourTimeline.currentProgress = 0.9;
}

 

this however throws an error. I think I have to call "yourtimeline" somehow, but can't quite get it?

 

thanks,

Dave

Link to comment
Share on other sites

I'm now realizing I should probably clarify further.

 

the code I have in the function now works fine, but it's not where the client wants to go:

 

navigateToURL(new URLRequest("rules.html"), "_self");

 

And, my timeline is set up as such:

var yourtimeline:TimelineMax = new
TimelineMax({repeat:0,onComplete:myFunction});

yourtimeline.insert(new TweenLite(buttonSkipOff, 1, {autoAlpha:1, ease:Quad.easeInOut, blurFilter:{blurX:0, blurY:0}, delay:1}));

function myFunction():void {
}

 

the, below that I have the timeline code for the button:

buttonSkipOff.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPageS);

function fl_ClickToGoToWebPageS(event:MouseEvent):void
{
       yourTimeline.currentProgress = 0.9;
}

 

It seems that I have to call that timeline name somehow.

 

I'm also going to re-watch the timeline video and hopefully that will shine some light on my situation.

 

thanks!!

Dave

Link to comment
Share on other sites

hello timaging. I am having difficulty understanding your problem.

 

I am confused by

 

the code I have in the function now works fine, but it's not where the client wants to go:

 

navigateToURL(new URLRequest("rules.html"), "_self");

 

also:

 

I am trying to figure out how to get a button to go to the end of a timeline, around 66 sections.

 

also please post the error.

from what I can tell, your code:

 

buttonSkipOff.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPageS);

function fl_ClickToGoToWebPageS(event:MouseEvent):void
{
  yourTimeline.currentProgress = 0.9;
}

 

appears to be correct.

 

Perhaps if you rephrase the question with just the elements that are not working I can be of better assistance

 

also if you want yourTimeline to stop when it gets to .9 be sure to add

 

yourTimeline.stop();

 

to the button code.

Carl

Link to comment
Share on other sites

Hi Carl,

 

Did my second post clarify further:

 

Here's sort of a compiled setup, but removing several of my timeline requests:

 

var yourtimeline:TimelineMax = new
TimelineMax({repeat:0,onComplete:myFunction});


yourtimeline.insert(new TweenLite(buttonSkipOff, 1, {autoAlpha:1, ease:Quad.easeInOut, blurFilter:{blurX:0, blurY:0}, delay:1}));

function myFunction():void {
}


buttonSkipOff.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandlerS);

function fl_MouseOverHandlerS(event:MouseEvent):void
{
TweenLite.to(buttonSkipOver,  0.2, {autoAlpha:1, blurFilter:{blurX:0, blurY:0}});
}

buttonSkipOff.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandlerS);

function fl_MouseOutHandlerS(event:MouseEvent):void
{
TweenLite.to(buttonSkipOver,  2, {alpha:0, blurFilter:{blurX:20, blurY:20}});
}

buttonSkipOff.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPageS);

function fl_ClickToGoToWebPageS(event:MouseEvent):void
{
       yourTimeline.currentProgress = 0.9;
}

 

my attempt is to get to the end of this timeline using this code above. I just watched the tutorial video and it seems that this could be correct, but maybe the function attached to timelineMax is the issue.

 

I then removed that and still got errors.

 

thanks!

Dave

Link to comment
Share on other sites

here is the error I'm getting:

 

Scene 1, Layer 'Layer 1', Frame 2, Line 211 1120: Access of undefined property yourTimeline.

 

Line 211 in my code is the CLICK function:

 

yourTimeline.currentProgress = 0.9;

 

 

Dave

Link to comment
Share on other sites

cool thanks! here you Go!

 

function fl_ClickToGoToWebPageS(event:MouseEvent):void
{
       yourTimeline.currentProgress = 0.9;
}

should be

 

function fl_ClickToGoToWebPageS(event:MouseEvent):void

{

yourtimeline.currentProgress = 0.9;

}

 

the T should be t in yourtimeline!

 

 

Carl

Link to comment
Share on other sites

oh my god I'm so embarrassed!

 

thank you!

 

Dave

Link to comment
Share on other sites

nothing to worry about. it happens to me all the time :D

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.
×