How to make a LOOP ?

Posted by GIULY 
How to make a LOOP ?
April 27, 2009 03:39PM
Hi,
I use a text transition with SHOW and HIDE parameters but the transition work only once.
How can I make a loop of my transition text?
Thank you for help
by Giuly
Re: How to make a LOOP ?
April 29, 2009 07:44AM
You could either do this by adding enough frames for you animation. Or if you have only one component that does the animation, create an evenListener on the END event. I will give you a small tutorial for both ways:
Do the loop by adding enough frames. Lets say your transitions last 2 seconds each ( 2 sec for the Show and 2 sec for the Hide) and you have another 2 seconds delay, that means that you will need ( 2 + 2 + 2) * fps. The FPS is set from your Fla file. If it's set to 30 than you will need to add 180 frames.
Adding an event listener is a more advance way to loop the animation, but it gives extra options too. Once you learn how to use eventListeners you can loop, start other animation or remove a animation that is on another target.
To add a listener follow this steps:
Name you component ( add an instance name, ie: fe)

fe.addEventListener(FLASHEFFEvents. TRANSITION_END, transitionEndHandler);
function transitionEndHandler(evtObj:FLASHEFFEvents): void {
trace("The transition has ended.");// This will throw you a message
fe.show() // This will start the animation again.
}

Hope this helps.
Re: How to make a LOOP ?
May 15, 2009 10:01AM
Tried the above

I get a compile error


Descriptions:1046: Type was not found or was not a compile-time constant: FLASHEFFEvents.
Re: How to make a LOOP ?
May 15, 2009 01:57PM
import com.jumpeye.Events.FLASHEFFEvents;

Add the line above to import the Event class.
Re: How to make a LOOP ?
May 17, 2009 10:39AM
Ah

that fixed the error - thanks (only been learning AS3 for a few days - it's all a bit new)
and the transition repeats while the movie is playing....nice, but...

...what I actually needed was the transition to fire again when the whole movie looped
currently the text transition runs once at the start of the movie
but when the whole movie runs the second time - the text just appears as if no transition has been applied

any help appreciated


Paul
Re: How to make a LOOP ?
May 18, 2009 07:00AM
There are way too many things to consider before giving you an advice, so please upload the files and I will take a look at them.
Re: How to make a LOOP ?
May 18, 2009 01:51PM
cut down version

just need to have the intro message play each time the main movie loops

on second and subsequent loops it just pops into view

tia

Paul
Attachments:
open | download - vas1.fla (667 KB)
Re: How to make a LOOP ?
May 19, 2009 06:47AM
PT247, you've almost done the loop, you just have to remove all frames beside the first one. Leave only frame one and leave the layers as they are.
There are a couple of ways to do a loop, one is to create a listener on the component or to create enough frames, you will need to multiply the FPS with the tween duration.
The other way to do it is to create only one frame and add the an eventListener on the component. When the event happens call the componentInstanceName.show() function.
Re: How to make a LOOP ?
May 29, 2009 10:26AM
I tried to add this script

fe.addEventListener(FLASHEFFEvents. TRANSITION_END, transitionEndHandler);
function transitionEndHandler(evtObj:FLASHEFFEvents): void {
trace("The transition has ended.");// This will throw you a message
fe.show() // This will start the animation again.
}

to my fla, even changing FLASHEFFEvents with FLASHEFF2Events but it doesn't work. The effect doesn't even start and you can see the Flasheff component in the preview. What should I change?
P.S. I'm using the FlashEff2beta



Edited 1 time(s). Last edit at 05/29/2009 10:44AM by tania.
Re: How to make a LOOP ?
May 29, 2009 10:57AM
Sorry I made a mistake, I was doing it on the text instead of the component :-)
Sorry, you do not have permission to post/reply in this forum.