Jump to content
GreenSock

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

Flash Rotating Banner with Navigation - AS2

Recommended Posts

Hi Greensock,

 

Long time no talk but I could use your help once again.

 

I'm basically creating a flash banner that is a slideshow with different animations for each slide. I have it set up so when the animation is onComplete it goes to the next slide. But if the navigation button is pressed before the onComplete happens it starts the animation but then kicks back once the onComplete is reached. How can I stop that from happening?

 

import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;
TweenPlugin.activate([MotionBlurPlugin]);

function slide2(){
_root.gotoAndPlay(2);
};

var logoAndWhiteBar:Array = new Array(enviLogo, whitebar);

var timeline:TimelineMax = new TimelineMax();
timeline.append( TweenMax.from(whiteBar, 1, {_x:-250, _alpha:10, ease:Quart.easeOut}) );
timeline.append( TweenMax.from(enviHeater, 1, {_x:0, _alpha:10, motionBlur:true, ease:Quart.easeOut}),-1 );
timeline.append( TweenMax.from(enviLogo, 1, {_x:-355, ease:Cubic.easeOut}),-.7 );
timeline.appendMultiple( TweenMax.allTo([enviLogo,whiteBar], 1, {_alpha:0, onComplete:slide2, onCompleteScope:this}),.5 );

 

Thanks man for all your help!

 

Brian

Link to comment
Share on other sites

have you tried stopping the timeline with

 

timeline.stop() 

when the user navigates away?

 

It might be less troublesome to build all your animation into one TimelineMax so that you don't have to jump back and forth between frames on the main timeline.

http://www.snorkl.tv/2011/03/bullet-pro ... o-section/

 

its as3 but the TimelineMax concepts would be exactly the same

Link to comment
Share on other sites

That link is awesome but a little more help. Not the most savvy with Actionscript and just want to get this to a working state and will use that template on my next project.

 

The menu is on it's own layer and it's using old school coding to get it to work.

 

Basically the menu needs to get to the root timeline, go inside the slide 1 and call that timeline actionscript to stop()

 

on (release)
{
   if (_root.link != a)
   {
       this._parent["btn"+_root.link].gotoAndPlay("Out");
       _root.link = a;
   } // end if

_root.gotoAndStop(2);
trace("slide2");	
_root.slide1.timeline.stop();
}

 

But it doesn't work.

 

Much appreciated and thanks!

Link to comment
Share on other sites

there is perhaps something else calling it.

 

i just created a moveclip called slide.

inside of it i have a simple timelinemax:

 

import com.greensock.*

var tl:TimelineMax = new TimelineMax();

tl.append(TweenMax.to(mc, 10, {_x:500}));

 

 

on the main timeline a i have this code

 

btn.onRelease = function(){
gotoAndStop(2);
trace("hello")

_root.slide.tl.stop();
}

stop();	

 

 

it works fine in targeting the timelinemax inside of slide.

 

perhaps you have something else going on. feel free to zip up a simple demo.

 

c

Link to comment
Share on other sites

So here is the test.fla file but I'm thinking in the meantime I'm going to dive into more of the link you sent over and play with as3.

 

For that one example you sent over could the link you are on stay highlighted/indicated? Basically I want it to be a rotating banner. When they select a nav button I want it to go to that slide and animate for 5-7 seconds. Once the animation ends I want it to continue on to the next slide once when animation onComplete is called. Pretty basic but a pain in my butt when setup incorrectly! :)

 

Once that is setup I think I could go to town on each of the animations.

 

Thanks for your help.

 

 

EDIT: Not to make your head explode but we could just start on the AS2 animation. Didn't mean to just throw the as3 question at ya.

Link to comment
Share on other sites

in your file slide1 doesn't have an instance name, that's why you couldn't target timeline inside of it from your button.

 

in frame 1, select slide1 clip, go to properties panel. give it instance name slide1

 

in your button2 code use:

 

on (release)
{
   if (_root.link != a)
   {
       this._parent["btn"+_root.link].gotoAndPlay("Out");
       _root.link = a;
   } // end if


trace("slide2");
_root.slide1.timeline.stop();
_root.gotoAndStop(2);
}

Link to comment
Share on other sites

Aahhhh. I could have swore I had that set up. My bad. I got it setup to 99% where I need it to be so thanks for your help. But. One final request. When the slide moves to the next one, the button reflects which slide it is on and so on.

 

I've got it close but now when I press the button there is a brief flash of the over state. Reason that's happening is the function is being called for the onRollOver in the navigation and on the slide for when the onComplete happens. Silly but it appears I just need an if than statement? Can you take a look and point me in the right direction. If not it really isn't a big issue.

 

Now all I need is to put this format to AS3 in a much cleaner way. Then I can do all the tweening I want :)

 

Thanks again!

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