If you can show the heirarchy of your objects and which one you're
trying to add that's failing, that'll help. Also explain what "does
not work" means (do you get an error?).

On 4/26/07, Jason C Reynolds <[EMAIL PROTECTED]> wrote:
>
>
> Sorry for the vauge subject... here's what I'm trying to do that does not
> work.
>
> I am creating a MainApp class instance in my mxml project file. I want to
> use this to control the basic common stuff throughout the application, and I
> have made an instance of a Canvas object that I will be using as a container
> to the constantly changing part of the screen. I made a ContentTemplate
> class that extends UIComponent (I had problems with addChild in actionscript
> before I realized if it's not pure as3 it needs to be a UIComponent to
> work). From this ContentTemplate class, I have created several classes that
> extend it and want to use addChild/removeChild to change that canvas part of
> the program.
>
> So, in MainApp I have a variable contentScreen of type ContentTemplate. Lets
> just say all ContentTemplate is doing is making a new text control. I tried
> to make this text control in the ContentTemplate, and since it is extending
> UIComponent - I thought just a this.addChild would work... Then in mainApp
> just add it to the display list of the Canvas object. This does not work.
>
> If I pass a reference to that canvas object in the constructor, then
> addChild from there it works.
>
> Hopefully I somewhat clear what I'm trying to do - and anyone have any
> suggestions why this would not work?
>
> Thanks for any response, Jason
>
>
>
>   

Reply via email to