Jump to content
GreenSock

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

Reply button on Adobe Animate CC?

Recommended Posts

Hi Guys any help how can I develop (( Reply button ))

into Adobe Animate?

 

THank you in advance 

Link to comment
Share on other sites

Can you provide some more details? I'm just not sure what you mean by "develop (( Reply button )) into Adobe Animate". These forums are focused on answering GSAP-specific questions, so if you have one of those we'd be happy to help. 

Link to comment
Share on other sites

Thank you Jack, for you instant answer 

 

I meant a button to make the banner Repeat after the animation ends.

So when the people want to see the animation again they can click on it

 

I attached a picture to what I mean a button as shown.

29209-200.png

Link to comment
Share on other sites

Oh, absolutely. You'd just need to put your animations into a TimelineLite or TimelineMax and then hook up that "replay" button to call the timeline's restart() method. 

 

If you haven't worked with TimelineLite or TimelineMax yet, you're going to love them :)

https://greensock.com/sequence-video

https://greensock.com/position-parameter

  • Like 3
Link to comment
Share on other sites

I will check the links,

Thank you so much :x

Link to comment
Share on other sites

If you're doing timeline animation, all you need to do is create a replay button symbol, give it an instance name of "replay" and add this code & your button to the end frame:

 

this.replay.addEventListener("click", fl_ClickToGoToAndPlayFromFrame.bind(this));
 
function fl_ClickToGoToAndPlayFromFrame()
{
  this.gotoAndPlay(1);
}

 

Be sure to put the replay button on a layer above your clickTag button or the replay functionality won't work.  Also, you have to use a button and not target the whole canvas... that issue comes up a lot on the Animate CC forums: https://forums.adobe.com/message/8720575

  • Like 3
Link to comment
Share on other sites

I Tried it, but it's not working,

 

when I change the frame to 0 it works first time and then when I click the banner it opens multiple pages?

 

 

this.replay.addEventListener("click", fl_ClickToGoToAndPlayFromFrame.bind(this));

 function fl_ClickToGoToAndPlayFromFrame()
  {

   this.gotoAndPlay(0);
}
    

My timeline

________________________

var root = this,
    tl; 
 
tl = new TimelineMax( { repeat: 1, repeatDelay: 1 } );

tl
.addLabel( 'myLabel1' )


.from( this.t1, 1, { alpha:0,x:this.t1.x-50,  ease:Expo.easeOut  }, 'myLabel1+=1' )

.to( this.t1, 0.75, { alpha:0,  ease:Expo.easeOut }, 'myLabel1+=4' )


.from( this.t2, 1, { alpha:0,x:this.t2.x-50,  ease:Expo.easeOut  }, 'myLabel1+=4.5' )
.from( this.t3, 1, { alpha:0,x:this.t3.x-50,  ease:Expo.easeOut  }, 'myLabel1+=5' )

.to( this.t2, 0.75, { alpha:0,  ease:Expo.easeOut }, 'myLabel1+=7' )
.to( this.t3, 0.75, { alpha:0,  ease:Expo.easeOut }, 'myLabel1+=7' )


.from( this.t4, 1, { alpha:0,x:this.t4.x-50,  ease:Expo.easeOut  }, 'myLabel1+=7.5' )
.from( this.t5, 1, { alpha:0,x:this.t5.x-50,  ease:Expo.easeOut  }, 'myLabel1+=8' )

 

.addLabel( 'myLabel2' )


.from( this.seemore, 0.75, { scaleX:0, scaleY:0,alpha:0, ease:Back.easeOut }, 'myLabel2' )
.from( this.reply, 1, { scaleX:0, scaleY:0,alpha:0, ease:Back.easeOut }, 'myLabel2+=2' )
 

 

 

Link to comment
Share on other sites

Make sure your instance names match up.  replay not reply.

 

Since you're using scripted animation with GSAP and not the Animate timeline, you should use

 

this.replay.addEventListener("click", clickToReplay.bind(this));
 function clickToReplay()
  {
   tl.restart();
}

 

  • Like 3
Link to comment
Share on other sites

Wooow

Wonderful good guys,

it's working now :x

 

THank you @ohem  

  • Like 1
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.
×