This content has been marked as final. Show 3 replies
But where are you calling getXML()? It's a private member so you must make the call in the class but... and that's why it fails. As the last line in your constructor add getXML();
Using a local variable (owner) to solve scope is perfectly legal. Another way is using the Delegate Class. And yes, you can setup custom events to broadcast to other objects (remember classes are custom objects). Dive into the EventDispatcher Class.
Thanks -- indeed a crucial call might be missing. I was doing this until 3 yesterday morning.
Would this be the correct sample code to use? : http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm ?context=Flash_MX_2004&file=00000846.html
It seems to work (although someone cautions in the page comments that it doesn't).
Part of my trouble in working with AS 2.0 is that I feel I shouldn't have to do such complicated things (Delegate classes, etc) in order to get simple things done (loading XML files). This is not a complaint per se -- rather I feel that I must be missing something, that it is my inexperience that is causing me to bend through so many hoops: programming "should" be elegant and simple. So, any links helpful. Thanks.
Might be missing? It is missing. Without it, the code won't do anything. Apart from that, the code is fine. And about complicated things, nothing complicated about it. It's just the way it works in AS2. You have several options to resolve the scope. Use a local variable, use the Delegate Class, not using callback handlers but listeners. With experience you won't even think about it anymore. Read Moock again, again and probably again. But hey, it's worth the effort.