1 Reply Latest reply on May 24, 2013 12:24 PM by resdesign

    Setting javascript to make falling snow

    ella1234nallen

      I have managed to make a flake in Edge to flash randomly after following a tutorial on lynda.com

       

      My javascript knowledge is fairly limited but I used the following code on a trigger inside the flake symbol I made:

       

      var randomFrame = Math.floor(Math.random()*5000);

      var maxWidth = $('#Stage').width();

      var randomX = Math.floor(Math.random()*maxWidth);

      var randomY = Math.floor(Math.random()*300);

       

       

      sym.play(randomFrame);

      var myName = sym.getSymbolElement();

       

       

      $(myName).css({'position':'absolute','top':randomY+'px','left':randomX+'px'});

       

      This all works as a randomly appearing flake which doesn't look like snowfall. Can anyone give me advice on code to make the symbol float down from the top of the stage and repeated lots of times to look like snowfall?

       

      Any help we be really appreciated,

       

      Many thanks