Correction to the post. The import statement should be;
import EventTry;
Hello, I'm having troubles implementing the EventDispatcher class with
flash8.
I do the same I use to do before, but now the class doesn't fired the
event. Here is a sample class:
___
import mx.events.EventDispatcher;
//
class EventTry {
//event functions;
private var dispatchEvent:Function;
private var addEventListener:Function;
private var removeEventListener:Function;
//
//fired events;
public var onEvent:Function;
public function EventTry(){
EventDispatcher.initialize(this);
this.addEventListener("onEvent",this);
init();
}
//
private function init(){
dispatchEvent({type:"onEvent", target:this});
die();
}
private function die(){
removeEventListener("onEvent",this);
this=null;
delete this;
trace("EventTry die");
}
}
___
And here is the fla code:
import com.mg.temp.EventTry;
//
var etry:EventTry=new EventTry();
etry.onEvent=function(){
trace("onEvent fired");
}
//end
___
Here I doesn't get the "etry. onEvent" function fired. Also no error,
it just ignore the statement.
Curiously my older classes run well with such a code.
Any help would be appreciate,
thanks,
Javier.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders