2 Replies Latest reply on Jun 3, 2009 6:31 PM by Flex harUI

    Can't add children to the stage via a class

    rcanulla Level 1

      Hi there,

       

      I am trying to addChild(displayObject) via a class, and nothing appears when I add it to the stage. Help please!

       

      class

      package com.ryancanulla.utils
      {
           import flash.display.Sprite;
           
           import mx.controls.TextArea;
           
           public class ArchiveData extends Sprite {
                
                private var test:TextArea = new TextArea;
                
      
                
                public function ArchiveData():void {
                     //var testText.text = "this is a test";
                     test.text = "this is a test";
                     addChild(test);
      
                }
                
      
           }
      }
      

      calling the class

               private var archiveData:ArchiveData;
      
               archiveData = new ArchiveData();