you may have to override updatedisplaylist andor
addchild in your thingy class.
here are two ways you can try to access a child of
your main app from within another child:
1- call parentDocument.mycanvas from that other class.
although that will work only if that other class is an
immediate child of your main application - it wont
work if it's wrapped within another class or
component... besides that is not a very good practice
in my opinion.
2 - create a reference to the loading application
component by including a 'caller' property in your
custom thingy class and setting that to your main
application during instantiation. Hence, you can
access the children and public properties of your main
application from within your thingy class using
caller.something .
However I suggest you dispatch a bubbling event
instead from the custom thingy class then listen for
that event within your main application -- then add
the child within the listener. Or use cairngorm's
event mechanism to do away with bubbling events. :)
-leds
--- ronnlixx <[EMAIL PROTECTED]> wrote:
> Hi,
>
> package
> {
> public class MyThingy extends UIComponent
> {
> public function drawThingy():void
> {
> var myThingy: UIComponent = new UIComponent();
> // define thingy....
> addChild(myThingy);
> }
>
> public function updateText():void
> {
> // I want to access and addChild to myCanvas
> // but this does not work
>
> myCanvas.addChild(myTextField);
> }
> }
> }
>
> Im attaching this in the creationComplete event
>
> addChild(new MyThingy);
>
> my app has a canvas with the id of "myCanvas" and I
> want to access it
> from within the updateText() metheod, how can I do
> that?
>
>
>
>
>
>
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news