0 Replies Latest reply on Mar 1, 2013 2:28 PM by chuba21

    How can I reference the symbol that contains the code.

    chuba21 Level 2

      I am trying to create a circle that is dynamically added to the stage.


      Iwant to add all of the programatic animations in the symbol's stage but I can't figure out how to reference teh symbol itself with something I use to do in AS3 using the keyword this


      For example:


      - I create a symbol called Light, with a png inside

      - I open it and place a series of code lines


      var myW = this.width(); // how to reference the symbol from itself?

      var myH = this.height();


      funciton init()


           this.getSymbolElement().css("left", Math.random() * 1024);

           this.getSymbolElement().css("top", Math.random() * 768);

           this.getSymbolElement().css("scale", 1); // how to reset the scale?

           TweenMax.to(this, 2 + Math.random()*4,{opacity:0, scale:4, delay:Math.random()*10, onComplete:init});





      So each time the TweenMax completes the action, the symbol changes its position and resets the scale (how to reset it is another question)

      After that I create the symbols with a for loop and scatter them over the stage randomly.