Wednesday 28 November 2012

How to move Clouds in action script 3.0



var value:Number = 0.0;

addEventListener( Event.ENTER_FRAME, onEnterFrame );

function onEnterFrame( e:Event ):void
{
                cloud.y = 40 + ( Math.sin( value ) * 4 );
                value +=  0.1;
}



  • Create a movie clip named as ‘cloud’.

  •  Copy and paste above code on your actionscript panel.

  • Press Ctrl+Enter and check cloud movement in output panel

No comments:

Post a Comment