BasicEvent
| Kind of class: | public class |
|---|---|
| Package: | com.bourre.events |
| Inherits from: | Event |
| Known subclasses: |
|
| Author: | Francis Bourre |
| Classpath: | com.bourre.events.BasicEvent |
| File last modified: | Tuesday, 15 April 2008, 09:25:44 |
The
developpers to change the
BasicEvent class adds the ability fordeveloppers 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:
- com.bourre.load.QueueLoader
Summary
Constructor
- BasicEvent (type:String, target:Object = null)
- Creates a new BasicEvent event for the
Instance properties
Instance methods
- setType (en:String) : void
- Defines the new event type for this event object.
- getType : String
- Returns the type of this event, which generally correspond
- setTarget (oTarget:Object) : void
- Defines the new source object of this event.
- getTarget : Object
- Returns the current source of this event object.
- clone : Event
- Clone the event
- toString : String
- Returns the string representation of this instance.
Constructor
BasicEvent
public function BasicEvent (
type:String,
target:Object = null)
Creates a new
passed-in event type. The
if the target is omitted and the event used in combination
with the
target will be set on the event broadcaster source.
BasicEvent event for thepassed-in event type. The
target is optional, if the target is omitted and the event used in combination
with the
EventBroadcaster class, the eventtarget will be set on the event broadcaster source.
Parameters:
type :
String name of the eventtarget:
an object considered as source for this event
Instance properties
target
override public target:Object
(read,write)
The source object of this event
type
override public type:String
(read,write)
The type of this event
Instance methods
clone
override public function clone (
) : Event
Clone the event
Returns:
- a clone of the event
Overrides:
- Event.clone
getTarget
public function getTarget (
) : Object
Returns the current source of this event object.
Returns:
- object source of this event
getType
public function getType (
) : String
Returns the type of this event, which generally correspond
to the name of the called function on the listener.
to the name of the called function on the listener.
Returns:
- the type of this event
setTarget
public function setTarget (
oTarget:Object) : void
Defines the new source object of this event.
Parameters:
oTarget:
the new source object of this event
setType
public function setType (
en:String) : void
Defines the new event type for this event object.
Parameters:
en:
the new event name, or event type, as string
toString
override public function toString (
) : String
Returns the string representation of this instance.
Returns:
- the string representation of this instance
Overrides:
- Event.toString