How to pass parameters through dispatchEvent.
Hi,
I've written an imageLoader class. I want to dispatch an event after the completion of image loading to the document class from which imageLoader has been initialized.
public function onLoaderProgress(e:ProgressEvent) {
imgLoader.removeEventListener(ProgressEvent.PROGRESS, onLoaderProgress);
trace(e.bytesLoaded, e.bytesTotal);
}
public function onLoaderComplete(e:Event) {
imgLoader.removeEventListener(Event.COMPLETE, onLoaderComplete);
dispatchEvent(new Event("Image Loaded"));
imgContainer.addChild(imgLoader);
}
onLoaderComplete is the image loading complete event and onLoaderProgress is the image loading progress event. Here i have dispatched an event in inLoaderComplete event. I want to send parameters along with the dispatchEvent. How it can be done?
Regards,
Sreelash