Nevermind Got it working Thanks

--- In flexcoders@yahoogroups.com, "Jason B" <[EMAIL PROTECTED]> wrote:
>
> is this what you mean i've tried to access but i still get a #1009 error
> 
> 
> public var dynamicallyCreatedComponents:Object = {};
> 
> 
>        public function loaditems(){
>               
>                         create_text = new TextInput();
>                         create_text.percentWidth = 100;
>                         create_text.id = "test";
>                         create_text.text =create_text.id;
>                   dynamicallyCreatedComponents["test"] = create_text; 
>                         dataBox.addChild(create_text);  
> 
>           }
> 
>        public function saveall(){
>               
>              var t:TextInput = dynamicallyCreatedComponents["test"];
>                               try{
>                       Alert.show(                                     
> dynamicallyCreatedComponents["test"].text);
>               }catch(errObject:Error){
>                       Alert.show(errObject.message);
>               }       
> 
> 
> 
> 
>           }
> 
> 
> --- In flexcoders@yahoogroups.com, "Gordon Smith" <gosmith@> wrote:
> >
> > Declare an instance variable of type Object or Dictionary for storing
> > named references to dynamically created components:
> > 
> >  
> > 
> >     public var dynamicallyCreatedComponents:Object = {};
> > 
> >  
> > 
> > In a method where you create a component at runtime, do
> > 
> >  
> > 
> >     var b:Button = new Button();
> > 
> >     b.label = "OK";
> > 
> >     dynamicallyCreatedComponents["okButton"] = b;
> > 
> >  
> > 
> > Later you can access this button as follows:
> > 
> >  
> > 
> >     dynamicallyCreatedComponents["okButton"]
> > 
> >  
> > 
> > Gordon Smith
> > 
> > Adobe Flex SDK Team
> > 
> >
>


Reply via email to