Jump to content
Search Community

FrameLabel -> nextframe? [SOLVED]

HH54 test
Moderator Tag

Recommended Posts

Hi,

 

I tried to use the FrameLabel function in combination with nextFrame(), but it doesnt work.

How can I use nextFrame here? onClick -> go to next or last frame!

 

function vor(event:MouseEvent):void 
{	
      TweenLite.to(thumbs_only, 1, {frameLabel:"nextFrame()", ease: Back.easeOut}); 
};

 

I tried to do also this

 

 

function vor(event:MouseEvent):void 
{	

   TweenLite.to(thumbs_only, 1, {x:"-406", ease: Back.easeOut});

};

 

But the problem here is that the script is not waiting for the last tweens "onComplete .... ",

so if you click before the tween is finished allready, it´s not working. Can anybody help?

Link to comment
Share on other sites

"nextFrame()" is not a label. It's a function. If you want to tween to the next frame, you can just do TweenLite.to(mc, 1, {frame:mc.currentFrame + 1}) (you'll need to activate the FramePlugin first of course). I'm not sure why you'd ever want to do that, though, because you'd never really see the tween because it would just go to the next frame - there's no inbetween states if you're just going from one frame to the next.

Link to comment
Share on other sites

ah, Ok so if the tween is not visible this function is not interesting.

 

so I have to try the other way with

 


function vor(event:MouseEvent):void
{   
   TweenLite.to(thumbs_only, 1, {x:"-406", ease: Back.easeOut});   

};

 

But dont know how to define the : next Click just in case of tween complete.

Link to comment
Share on other sites

I don't understand - please rephrase the question.

 

If you're asking how to make sure every click advances to the next "slot" (which looks like they're 406 pixels apart in your case), you can just track that in a variable, like:

var destX:Number = thumbs_only.x;
function onClick(event:MouseEvent):void {
   destX -= 406;
   TweenLite.to(thumbs_only, 1, {x:destX, ease:Back.easeOut});
}

Link to comment
Share on other sites

sorry, i´m just new in as3 and just a pure designer which is trying to understanding some basics ;)

 

my problem with this "preview slider"

 

 

function nextpic(event:MouseEvent):void

{

TweenLite.to(thumbs_only, 1, {x:"-406", ease: Back.easeOut});

};

 

 

function lastpic(event:MouseEvent):void

{

TweenLite.to(thumbs_only, 1, {x:"+406", ease: Back.easeOut});

 

};

 

is, that if you are clicking to fast (before the first tween is completed)

the + 406 starts at the point of current tweenposition and not at the end.

 

So i need a function which says block the button, or wait with the next click until tween

is finished.

 

I don´t no what "destX" does, could that help me?

Link to comment
Share on other sites

Yeap, I found a solution. maybe not the best one, but my ;)

 

but_current.visible = false;

 

TweenLite.to(thumbs_only, 1, {x:"+406", ease: Back.easeOut,onComplete:onFinishTween});

 

function onFinishTween(){

 

but_current.visible = true;

Link to comment
Share on other sites

  • 4 months later...

Hi of a french user,

Thanks for your excellent plugin.

I have a little problem with the "frameLabel" class. (plugin is activate)

 

I want to go on next image on the current scene. I use a timeline.

var timeline:TimelineLite = new TimelineLite();
...
timeline.append( new TweenLite(chalet.art.carte1, 0.5, {_y:38, ease:Cubic.easeIn, autoAlpha:0}) );
timeline.append( new TweenLite(_level0, 0, {frameLabel:"article40"}) );

 

This last line doesn't work...

I would to move on the principal scene of Flash and not in a clip. I test _root, this, _level0, _currentframe with any succes.

gotoAndStop(); and play(); doesn't work on timeline. They are play before the rest of the actions.

 

Have you a solution for me ?

Thank you.

Link to comment
Share on other sites

zero-duration tweens render immediately by default (which makes sense if you think about it), but if you don't want it to render immediately, just set immediateRender:false in the vars object.

 

new TweenLite(_root, 0, {frameLabel:"article40", immediateRender:false});

Link to comment
Share on other sites

No. it's not a problem of the '0'.

 

The action who goes on 'article40' image is not executed when i test.

The animation is stopped.

 

after this action :

timeline.append( new TweenLite(chalet.art.carte1, 0.5, {_y:38, ease:Cubic.easeIn, autoAlpha:0}) );

I would go to the next image in the current scene.

 

but this line :

timeline.append( new TweenLite(this, 0.1, {frameLabel:"article40"}) );

must be false.

 

Simply i would say in the animation :

After the last action of TimelineLite, go to 'article40' (or image4) of the scene (i hope you understand)

Thank you (and sorry for my english)

Link to comment
Share on other sites

Sorry, I'm having a hard time understanding what you're asking and it's always difficult to troubleshoot without seeing the problem in context (please upload an FLA that demonstrates the issue). You could use an onComplete to call gotoAndStop() if you want, kinda like:

 

timeline.append( new TweenLite(chalet.art.carte1, 0.5, {_y:38, ease:Cubic.easeIn, autoAlpha:0, onComplete:_root.gotoAndStop, onCompleteParams:["article40"], onCompleteScope:this}) );

 

You should also make sure that the frame is loaded when you're trying to go to it (if the swf hasn't loaded enough, that frame may be unavailable).

Link to comment
Share on other sites

Ok,

 

I understand it's very difficult to known whow i created the animation.

I sent you an simplified fla where the code is false but i would known how to realise each actions of TimelineLite after the previous.

"gotoAndStop" and "sound" are the 2 problems.

I have no problem to use them in 'classical animation' but not with the timelite...

 

Many thanks for your help.

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