views:

111

answers:

1

I have an ActionScript 2.0 file that contains a small library. This library parses an XML file. I have assigned an onComplete function on the onLoad function of the XML.

For example:

------------ mysmalllib.as --------------
r_xml = new XML();
r_xml.onLoad = onComplete;

function onComplete(success:Boolean) {
        // some stuff
        OtherFunction();
     }

------------ mainProgram.fla --------------
import mylib.mysmalllib;

var flashCall = new mylib.mysmalllib;

function toBeCalled() {
     //
}
------------------------------------------------

The thing that I want is, whenever the OtherFunction is called (that exists in mysmalllib), another function in my main program to be notified (toBeCalled). I suppose it has something to do with dispatch but I'm not any good in AS.

Thx

+1  A: 

I did a quick google search and found this:

http://flash-creations.com/notes/asclass_eventdispatcher.php

It seems to cover what you need to know about EventDispatcher in AS2

Charlie boy

related questions