Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

Ball crossing around screen with if else

$
0
0

Hi There

I wish to make a ball go across the screen ( eventually it will be clouds )

I wish that the ball will reach the end of the screen anf then do the animation again.

This is the code I have written but the part that doesn't work is the part inside the else....

 

Thanks

Guy Lev

Israel AUGM

 

//setting the initial position of the ball

var xpos = -100;

 

// calling the symbol from library

var myball = sym.createChildSymbol("ball", "Stage");

 

//referencing the symbol

var myballsym = myball.getSymbolElement();

 

//setting the left posistion according tho the xpos var

myballsym.css({"position":"relative","left":xpos});

 

//checking the position of the ball

if ( xpos <=200 ) {

myballsym.animate({ "left": "400px" }, 2000);

}else  {

var xpos = -100;

};


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>