Raising ActionScript 2.0 events from another project

I have an ActionScript 2.0 file that contains a small library. This library parses an XML file. I assigned the onComplete function to the onLoad function for 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 I want is, whenever the OtherFunction (which exists in mysmalllib) is called, another function in my main program should be notified (toBeCalled). I suppose it has something to do with the submission, but I'm not very good at AS.

thank

0


source to share


1 answer


I did a quick google search and found this:

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



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

+1


source







All Articles