How can i loop this, without using loop() ?

  • I all,

    here is my tour :
    http://www.gabrielacoca.fr/egin

    and, as you see, hotspots tweens with differents delayedcalls
    i want to loop this action.

    This action is call via the first hotspot :

    Code
    onloaded="action1"


    then action1 is working, and at the end :

    Code
    delayedcall(82,tween(hotspot[hotspot21].alpha,0,2););
    delayedcall(84,action1(););

    but this don't work *cry*

    A other thing that is that the quality of the image decrease with the time: at the beginning it's ok, but when the action starts, the image is "blurry". Maybe it's because there is a fade , but all the images are made from the same point, using a trigger, so normally, it doesn't move.


    Thank you and have a nice year.


    Gabriel.

  • You shouldn't use delayedcall for counters, creating animations etc. Even if you can stop specific delayedcall (using name) you almost have no control on these functions - eg. you cannot check if any delayedcall function was "in progress".

    Action1 is not a good action - delayedcall functions are not triggered sequentially - in fact you triger 50 delayed calls at the same time, then you want to loop it. It's hard to control it.

    Here's the better way:

    Such created actions give you 2 advantages:

    1. you can start hotspot animation with any frame (not the first one)
    2. you can stop animation anytime using

    Code
    stopdelayedcall(nextframe);

    Of course you can do it even better using self triggered action with counter, but try to do it in the way I wrote above.

  • Thank you Panomaster for the time you take and for the lesson you give me.

    Your code is simple, effective, and ... logical !

    i learn 3 things with your answer :

    -it's possible to tell "nextframe"
    -use less images than 22 !
    -try to be simple as possible

    Thanks again and have a nice day.

    Gabriel.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!