stick an init method or something like that... The script tag translates to "class scope" you can see that from the import statements and so on...
on the component you want add a creationComplete="initme" and then in initme put the code that you want On Tue, Nov 11, 2008 at 8:24 PM, john fisher <[EMAIL PROTECTED]> wrote: > I am calling addChild inside the mx script section of a mxml file. If it > has to be called inside a method, then I need some instruction..... > > JF > > > Fotis Chatzinikos wrote: > >> public var myDemoClass:Zdemos ; > >> public var myDataFilePath:String = "http://.....realdata2.xml" ; > >> > >> myDemoClass = new Zdemos(myCanvas,myDataFilePath); > >> myCanvas.addChild(myDemoClass.getUIComponent()); > >> > > > > Are you trying to call addChild in the class itself? In your first > example > > (that is working) > > addchild is called inside a method > > > > In the second example (not working) the code is in no method... > > > > > > > > -- Fotis Chatzinikos, Ph.D. Founder, Phinnovation [EMAIL PROTECTED],

