Select Page

Dynamic Events in AS3.0

Ever wondered how to send parameters with your event in AS3.0?

package {
	dynamic public class DynamicEvent extends Event {
		public function DynamicEvent(t:String,
                                         b:Boolean = false,
                                         c:Boolean = false){
			super(t, b, c);

By setting this class to be dynamic (using dynamic keyword) you are able to add values to your event object:

_dynEvent = new DynamicEvent(LOAD_PROGRESS); = _id;
_dynEvent.bytesLoaded = bytesLoaded;