Hi there... This is a question which gets asked on a weekly basis (which does show a serious design flaw in AS2!).
You can find the answer in the Flashcoders Wiki AS2 FAQ here: http://www.osflash.org/flashcoders/as2 In short, it's all easier if you use the mx.utils.Delegate class or one of it's replacements. HTH, Ian On 11/28/05, old9 <[EMAIL PROTECTED]> wrote: > > Hi list~, first post here. > > I'm a totally newbie to AS2.0, so I think this might be a dumb question . > o_o > I got a problem when I try to call a private function in the onload handle > of a inner XML object. > > // MyClass.as > class MyClass{ > private var myxml:XML; > function MyClass(){ > myxml = new XML(); > myxml.onLoad = myXMLLoad; > myxml.load("somexml.xml"); > } > private function myXMLLoad(){ > trace("xml loaded"); > myPrivateFunc(); > } > private function myPrivateFunc(){ > trace(this); > } > } > > //FLA file > import MyClass; > var t = new MyClass();//the output window shows "xml loaded" only. > > when I try to call the myPrivateFunc, it fails. > How to invoke that func when the XML instance is loaded? > > many thanks > _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

