[flexcoders] Using Container.addChild(), can we not assign the id property and use it to refrence the new control?

2006-11-27 Thread Tracy Spratt
When I try, I get an error that the control is not a property of the app. For example: I add a Canvas, and set the ID private function addCanvas(oEvent:Event):void { caNew = new Canvas(); caNew.id = canvas1 caNew.name = canvas1; caNew.width = 300; caNew.height = 100;

RE: [flexcoders] Using Container.addChild(), can we not assign the id property and use it to refrence the new control?

2006-11-27 Thread Gordon Smith
Since most classes in the Flex framework are non-dynamic, assigning the value canvas1 to the 'id' property at runtime can't create an instance variable called canvas1 that contains a reference to your new Canvas, which is what the MXML compiler does when it processes the id=canvas1 attribute at

RE: [flexcoders] Using Container.addChild(), can we not assign the id property and use it to refrence the new control?

2006-11-27 Thread Tracy Spratt
I get it, thanks! Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Gordon Smith Sent: Monday, November 27, 2006 5:45 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Using Container.addChild(), can we not assign the id