4 Replies Latest reply on Jan 29, 2010 9:51 PM by Flex harUI

    this[id] doesn't see dynamically created objects????

    Aphalin1

      Hey all!

      If i have

       

       

      <mx:Canvas id="TopCanvas" initialize="Init()">

      <mx:Canvas id="VisibleCanvas" >

      </mx:Canvas>

      </mx:Canvas>

       

      <fx:Script>

       

       

      1. function Init(){
      2. var NewO = new Canvas();
      3. NewO.id="InvisibleCanvas";
      4. TopCanvas.addChild(NewO);
      5. if (this["VisibleCanvas"]){
      6. //We can see non-dynamically created canvas
      7. }
      8. if (this["InvisibleCanvas"]){
      9. //ERROR we cannot see the new one!
      10. }
      11. }

       

      Help please! How to access dynamically created Canvases via their id? I know i can save linkage to them in array, but i need to do it through id.

      Cheers!