Packagecom.bourre.events
Classpublic class BasicEvent
InheritanceBasicEvent Inheritance flash.events.Event
SubclassesBasicFaultEvent, BasicResultEvent, BeanEvent, BooleanEvent, ChannelListenerEvent, ConstructorEvent, ContextParserEvent, DimensionEvent, DisplayObjectEvent, DynBasicEvent, GlobalSoundManagerEvent, IterationEvent, LoaderEvent, LoopEvent, MethodEvent, NumberEvent, ObjectEvent, PropertyEvent, ResourceEvent, ServiceEvent, ServiceLocatorEvent, SoundEvent, StringEvent, TweenEvent, ValueObjectEvent

Player version: Flash Player 9.0
Language version: ActionScript 3.0

The BasicEvent class adds the ability for developpers to change the type and the target of an event after its creation.

Target and type redefinition is usefull when creating macro objects, which dispatch events, but according to their children event flow. The macro object may only change event's type or target of the child event and then redispatch it to its own liteners. You could take a look to the QueueLoader class fo a concret usage of this concept.

See also

../load/QueueLoader.html


Public Properties
 PropertyDefined by
  target : Object
The source object of this event
BasicEvent
  type : String
The type of this event
BasicEvent
Protected Properties
 PropertyDefined by
  _oTarget : Object
The source object of this event, redefined to provide write access
BasicEvent
  _sType : String
The type of the event, redefined to provide write access
BasicEvent
Public Methods
 MethodDefined by
  
BasicEvent(type:String, target:Object = null)
Creates a new BasicEvent event for the passed-in event type.
BasicEvent
  
clone():Event
Clone the event
BasicEvent
  
getTarget():Object
Returns the current source of this event object.
BasicEvent
  
getType():String
Returns the type of this event, which generally correspond to the name of the called function on the listener.
BasicEvent
  
setTarget(oTarget:Object):void
Defines the new source object of this event.
BasicEvent
  
setType(en:String):void
Defines the new event type for this event object.
BasicEvent
  
toString():String
Returns the string representation of this instance.
BasicEvent
Property detail
_oTargetproperty
protected var _oTarget:Object

Player version: Flash Player 9.0
Language version: ActionScript 3.0

The source object of this event, redefined to provide write access

_sTypeproperty 
protected var _sType:String

Player version: Flash Player 9.0
Language version: ActionScript 3.0

The type of the event, redefined to provide write access

targetproperty 
target:Object  [read-write]

Player version: Flash Player 9.0
Language version: ActionScript 3.0

The source object of this event

Implementation
    public function get target():Object
    public function set target(value:Object):void
typeproperty 
type:String  [read-write]

Player version: Flash Player 9.0
Language version: ActionScript 3.0

The type of this event

Implementation
    public function get type():String
    public function set type(value:String):void
Constructor detail
BasicEvent()constructor
public function BasicEvent(type:String, target:Object = null)

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Creates a new BasicEvent event for the passed-in event type. The target is optional, if the target is omitted and the event used in combination with the EventBroadcaster class, the event target will be set on the event broadcaster source.

Parameters
type:StringString name of the event
 
target:Object (default = null) — an object considered as source for this event

See also

Method detail
clone()method
public override function clone():Event

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Clone the event

Returns
Event — a clone of the event
getTarget()method 
public function getTarget():Object

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the current source of this event object.

Returns
Object — object source of this event
getType()method 
public function getType():String

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the type of this event, which generally correspond to the name of the called function on the listener.

Returns
String — the type of this event
setTarget()method 
public function setTarget(oTarget:Object):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Defines the new source object of this event.

Parameters
oTarget:Object — the new source object of this event
setType()method 
public function setType(en:String):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Defines the new event type for this event object.

Parameters
en:String — the new event name, or event type, as string
toString()method 
public override function toString():String

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the string representation of this instance.

Returns
String — the string representation of this instance