layer or hotspot animation

  • Hello,
    I want to share the code for the animation.
    Create a vibrational motion of a layer or hotspot.

    Code
    <action name="wobble" scope="local" args="attribute, min, max, time">
    	set(local.vverh, false);
    	calc(cal,'caller.' + attribute);
    	setinterval(calc('merc_' + caller.name), get(time), 
    			if(vverh,tween(get(cal),get(max),get(time)); set(vverh,false);
    				,
    				tween(get(cal),get(min),get(time)); set(vverh,true);
    			);
    		);
    </action>


    start the action, for example, changing the scale from 0.5 to 1 in 1 second

    Code
    onloaded="wobble(scale,0.5,1,1);"


    example

  • San,

    Thank you for sharing your example. It's really "code with taste" . I highly appreciate it.
    (I'm not grasping the subject of the post.)

    Pavel

    P.S.
    San, thanks for giving a reference. I also like the tweens types where the values go out of limits (e.g. easeOutElastic). Interesting. I haven't realized it...
    Thanks,
    Pavel

    Edited once, last by pur (December 9, 2018 at 10:42 PM).

Participate now!

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