----- Original Message ----- 
From: "john fisher" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, November 11, 2008 6:24 PM
Subject: Re: [flexcoders] udefined property error without function


>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.....

in an mxml file all code must be in a method (or an event handler).

Basically define a function and use an event to call it. For an application 
creationComplete should most likely do the trick for you.

Check out the docs.

Paul


>
> 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...
>>
>>
>>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups 
> Links
>
>
>

Reply via email to