Makeover Magic 2.1 Documentation
Table Of Contents
Table Of ContentsAuthor: Scott Delamater
Last Modified: 2003/3/3
Generator: gModeler.com.
Availability
Flash Player 6
Description
The Makeover Magic object structure.
Availability
Flash Player 6
Description
Contains a single Fader object and its associated ColorFeature object(s).
Palette Nested Elements
ColorFeatureAvailability
Flash Player 6
Usage
myColorFeature = new ColorFeature();
Parameters
None.
Returns
An instance of the ColorFeature class.
Description
The ColorFeature object is a group of associated movie clips to which color changes are applied using the onApply() method.
For example, an instance of the ColorFeature object might control the coloring of all hair elements, applying a color transform to each hair movie clip to varying degrees.
Example
myColorFeature = new ColorFeature();
myColorFeature.addElement(_root.hair.layer1_mc,_root.hair.layer2_mc,_root.hair.layer3_mc);
ColorFeature Properties
elements : Array
Availability
Flash Player 6
Usage
myColorFeature.elements
Description
Read only; do not modify the elements array except by using the addElement() and removeElement() methods.
Example
myFeature = new ColorFeature();
myFeature.addElement(_root.element1_mc);
ColorFeature Methods
addElement : obj
Availability
Flash Player 6
Usage
myColorFeature = new ColorFeature();
myColorFeature.addElement(_root.eyeball_mc);
Parameters
obj - An object to add to the elements array to be manipulated by the onApply method. An added object will typically have at least an mc property.
Returns
The index in the elements array of the newly added element.
Description
Adds movieclip elements to the colorFeature object's elements array. The onApply() method will typically apply any received color transform objects to each element to varying degrees.
Example
obj1 = {mc: _root.element1_mc, applyPercentage: 80,}
myFeature = new ColorFeature();
myFeature.onApply = function () {
for (i=0;i
}
};
myFeature.addElement(obj1);
apply : colorObj
Availability
Flash Player 6
Usage
myColorFeature.apply([colorObj]);
Parameters
colorObj - an optional parameter defining a color transform object applied to the elements array. If no colorObj is passed, the current color, set by the onChangeColor() method, is applied.
Returns
Nothing.
Description
Method; applies the colorObj transformation to the features elements (to whatever degree specified), and triggers the onUpdate event. The apply method is called from the onMouseDown handler (a private method) of the ColorFeature object.
Example
myColorFeature = new ColorFeature();
t = { ra: '50', rb: '244', ga: '40', gb: '112', ba: '12', bb: '90', aa: '40', ab: '70'}
myColorFeature.apply(t);
disableMouseEvents :
Availability
Flash Player 6
Usage
myColorFeature.disableMouseEvents();
Parameters
None.
Returns
Nothing.
Description
Method; disables the object from receiving mouse events.
enableMouseEvents :
Availability
Flash Player 6
Usage
myColorFeature.enableMouseEvents();
Parameters
None.
Returns
Nothing.
Description
Method; enables the object to receive mouse events.
onChangeColor : colorObj
Availability
Flash Player 6
Usage
myColorFeature.onChangeColor(colorObj);
Parameters
colorObj - a color transform object to apply to the elements array.
Returns
Nothing.
Description
Event Handler; receives the onChangeColor event from an associated Fader object. (By default, the onChangeColor method does not change any elements, it only reserves a color to be applied. Overload this method to change the elements as the slider is moved.)
Example
myColorFeature = new ColorFeature();
t = { ra: '50', rb: '244', ga: '40', gb: '112', ba: '12', bb: '90', aa: '40', ab: '70'}
myColorFeature.onChangeColor(t);
myColorFeature.apply();
removeElement : obj
Availability
Flash Player 6.
Usage
myColorFeature.removeElement(obj);
Parameters
obj - an object to remove from the elements array.
Returns
True if the object specified is found and removed; false if an error is encountered.
Description
Removes a specified element from the elements array.
Example
myColorFeature.removeElement(_root.myMovie_mc);
ColorFeature Events
onUpdate : this
No documentation available.
ColorFeature Associations
Makeover is comprised of ColorFeature
ColorFeature is dependent upon Fader
ColorFeature inherits from EventBroadcaster
Availability
Flash Player 6
Usage
Component
Parameters
None.
Returns
Nothing.
Description
Component; The Fader object incorporates graphical elements and pure data elements to create a gradient slider for color selection.
Example
skin0 = new FadePoint( 0, 255, 211, 173, 100);
skin1 = new FadePoint(33.33, 240, 193, 168, 100);
skin2 = new FadePoint(66.66, 218, 174, 149, 100);
skin3 = new FadePoint( 100, 141, 102, 83, 100);
myFader_mc.setGradient(skin0,skin1,skin2,skin3);
Fader Properties
points : Array
Availability
Flash Player 6
Usage
myFader.points
Description
Read only; do not modify except by using the setGradient() method.
Example
gradient1 = new Gradient();
myFader = new Fader();
myFader.setGradient(gradient1);
Fader Methods
getColorAt : percent
Availability
Flash Player 6
Usage
myFader.getColorAt(percent);
Parameters
percent - a number between 0-100 representing a position on the associated gradient.
Returns
A color transform object with the values corresponding to the position in the gradient.
Description
Method; returns a color transform object corresponding to the slider position specified using the percent argument. This does not set the slider position. (Use the setSliderPos() method.)
Example
getCurrentColor :
Availability
Flash Player 6
Usage
myFader.getCurrentColor()
Parameters
None.
Returns
The currently selected color.
Description
Method; retrieves the currently selected color.
Example
The following example creates a new color feature and applies the currently selected color from the myFader object.cF = new ColorFeature();
cF.apply(myFader.getCurrentColor());
getSliderPos :
Availability
Flash Player 6
Usage
value = myFader.getSliderPos();
Parameters
None.
Returns
The current position of the slider within the associate movieclip (mc).
Description
Method; retrieves the current position of the gradient slider in the associated movieclip.
Example
myFader = new Fader();
myFader.getSliderPos();
setGradient : obj
Availability
Flash Player 6
Usage
myFader.setGradient(point1 [, point2,..,pointN]);
Parameters
point1, point2,...,pointN - a series of FadePoint objects used to define the color gradient associated with the Fader.
Returns
Nothing.
Description
Method; sets the values of the points array equal to the points provided, which are then used in color calculations.
Example
skin0 = new FadePoint( 0, 255, 211, 173, 100);
skin1 = new FadePoint(33.33, 240, 193, 168, 100);
skin2 = new FadePoint(66.66, 218, 174, 149, 100);
skin3 = new FadePoint( 100, 141, 102, 83, 100);
myFader_mc.setGradient(skin0,skin1,skin2,skin3);
setSliderPos : percent
Availability
Flash Player 6
Usage
myFader.setSliderPos(percent);
Parameters
percent - a number between 0-100 representing a position on the associated gradient.
Returns
Nothing.
Description
Method; sets the slider position of the Fader and triggers the onChangeColor event.
Example
gradient1 = new Gradient();
myFader = new Fader();
myFader.setGradient(gradient1);
myFader.setSliderPos(50);
Fader Events
onChangeColor : colorObj
Usage
Parameters
None.
Description
Triggered by the setSliderPos() method; passes the color transform associated with the fader slider's current position.
Example
Fader Associations
ColorFeature is dependent upon Fader
Fader is dependent upon FadePoint
Fader inherits from EventBroadcaster
Availability
Flash Player 6
Usage
name = new PaletteControl();
Parameters
None.
Returns
An instance of the PaletteControl class.
Description
The Palette Control object is used within the Makeover application to control the active Faders and their associated ColorFeatures.
The PaletteControl adds and removes the ColorControl to the active Fader object, and adds and removes the associated ColorFeatures to the ColorControl object.
Example
myPaletteControl = new PaletteControl();
PaletteControl Properties
currentPalette : String
Availability
Flash Player 6
Usage
myPaletteControl.currentPalette
Description
Property (read only); the name of the currently active palette.
palettes : Object
Availability
Flash Player 6
Usage
myPaletteControl.palettes
Description
Property (read only); do not modify except using the addPalette() and removePalette() methods.
PaletteControl Methods
addPalette : name,Fader,Colors
Availability
Flash Player 6
Usage
myPaletteControl.addPalette(name,Fader [, ColorFeature1, ColorFeature2...ColorFeatureN]))
Parameters
name - A string defining the name of the Palette.
Fader - A Fader object associated with the Palette used to manipulate the ColorControl object.
ColorFeature1, ColorFeature2...ColorFeatureN - Any number of ColorFeature objects to be associated with the specified Fader.
Returns
True, if the Palette is added; false if an error is encountered.
Description
Method; adds a Palette to the PaletteControl objects stored palettes. A Palette is a package consisting of at least three parameters passed: a name, a Fader, and at least one ColorFeature object.
Example
myFader1 = new Fader();
myFeature1 = new ColorFeature();
myPaletteControl = new PaletteControl();
myPaletteControl.addPalette("p1",myFader1,myFeature1);
clearPalettes :
Availability
Flash Player 6
Usage
myPaletteControl.clearPalettes();
Parameters
None.
Returns
Nothing.
Description
Private Method; clears the current faders listener array and disable elements from receiving events.
removePalette : name
Availability
Flash Player 6
Usage
myPaletteControl.removePalette(name);
Parameters
name - the name parameter assigned to the palette when created using the addPalette() method.
Returns
true, if the named palette is found and removed; false if an error is encountered.
Description
Removes the named palette from the palettes array of the PaletteControl object.
Example
myPaletteControl.removePalette("p1");
switchToPalette : name
Availability
Flash Player 6
Usage
myPaletteControl.switchToPalette(name);
Parameters
name - the name of the palette to switch to, defined when created using the addPalette() method.
Returns
True if the palette exists, false if it does not.
Description
Switches from the current palette to the named palette by:
-Removing the associated ColorControl object (myColorControl) from the old palette's Fader object's listeners array, and adding it to the new Fader object's listeners.
-Removing the old palette's ColorFeatures from the associated ColorControl object's listeners array, and adding to it the new palette's ColorFeatures.
Example
Fader1 = new Fader();
Feature1 = new ColorFeature();
myPaletteControl = new PaletteControl();
myPaletteControl.addPalette("p1",Fader1,Feature1);
myPaletteControl.switchToPalette("p1");
PaletteControl Events
None.
PaletteControl Associations
PaletteControl is comprised of Palette
Availability
Flash Player 6
Usage
myMakeover = new Makeover();
Parameters
None.
Returns
An instance of the Makeover class.
Description
The Makeover class is the basic data model for the application. All viewstate information - including color feature properties and stamps - is saved in an instance of the Makeover object by the SaveControl object. No instantiation of a Makeover object is required as it is handled by the SaveControl object.
Example
myMakeover = new Makeover();
Makeover Properties
colorFeatures : Array
Availability
Flash Player 6
Usage
myMakeover.colorFeatures
Description
Read-only; do not modify except by using the addFeature(), removeFeature(), and changeFeature() methods.
Example
myFeature = new ColorFeature();
myMakeover = new Makeover();
myMakeover.addFeature(myFeature);
stamps : Array
No documentation available.
Makeover Methods
addFeature : feature,colorObj
Availability
Flash Player 6
Usage
myMakeover.addFeature(ColorFeature,colorObject0;
Parameters
feature - an instance of the ColorFeature object.
colorObj - a color transform object used to initialize that feature.
Returns
True if the feature is added; false if errors are encountered.
Description
Method; adds instances of the ColorFeature object to the colorFeatures array, and associates a color transform with them.
Example
myFeature = new ColorFeature();
myMakeover = new Makeover();
myMakeover.addFeature(myFeature);
addStamps : mc1,mc2,...,mcN
Availability
Flash Player 6
Usage
myMakeover.addStamp(mc1 [,mc2,...,mcN]);
Parameters
mc1, mc2,...,mcN - movieclips to be added to the makeover as a stamp.
Returns
Nothing.
Description
Method; adds movieclips to the Makeover object's stamps array.
Example
myMakeover = new Makeover();
myMakeover.addStamp(_root.stamp_mc);
duplicate :
Availability
Flash Player 6
Usage
myMakeover.duplicate()
Parameters
None.
Returns
An exact copy of this instance of the Makeover object.
Description
Method; duplicates this instance of the Makeover object and returns it.
Example
myMakeover = new Makeover();
myNewMakeover = myMakeover.duplicate();
removeFeature : feature
Availability
Flash Player 6
Usage
myMakeover.removeFeature(feature);
Parameters
feature - an instance of the ColorFeature object added using the addFeature() method.
Returns
True if the feature is removed; false if an error is encountered or the feature does not exist.
Description
Method; removes instances of the ColorFeature object from the colorFeatures array
Example
myMakeover.removeFeature(myFeature);
removeStamp : mc
Availability
Flash Player 6
Usage
myMakeover.removeStamp(mc [, mc1, mc2...mcn]);
Parameters
mc - a movieclip, added using the addStamp() method, to be removed from the Makeover object's stamps array.
Returns
True if the movieclip is removed; false if an error is encountered.
Description
Method; removes a stamp, added using the addStamp() method, from the Makeover object's stamps array.
Example
myMakeover.removeStamp(_root.stamp_mc);
Makeover Events
None.
Makeover Associations
Makeover is comprised of Stamp
Makeover is comprised of ColorFeature
SaveControl is comprised of Makeover
Availability
Flash Player 6
Usage
mySaveControl = new SaveControl();
Parameters
None.
Returns
An instance of the SaveControl class.
Description
The SaveControl object detects any changes to any registered color feature as well as the addition or removal of stamps, and saves those in a new Makeover object, allowing for multiple undos.
Example
feature1 = new ColorFeature();
feature1.addElement(_root.hair.layer1_mc,_root.hair.layer2_mc,_root.hair.layer3_mc);
feature2 = new ColorFeature();
feature2.addElement(_root.skin.layer1_mc,_root.skin.layer2_mc,_root.skin.layer3_mc);
mySaveControl = new SaveControl();
mySaveControl.addListener(feature1,feature2);
SaveControl Properties
currentIndex : Number
Availability
Flash Player 6
Usage
mySaveControl.currentIndex
Description
Property (read only); do not modify except via the redo() and undo() methods. The currentIndex can be retrieved using the getCurrentIndex() method.
saves : Array
Availability
Flash Player 6
Usage
mySaveControl.saves
Description
Read-only; do not modify. The applyCurrent() and revert() methods access and modify this array.
Example
mySaveControl.applyCurrent();
SaveControl Methods
applyCurrent : mc
Availability
Flash Player 6
Usage
mySaveControl.applyCurrent();
Parameters
mc - a master movieclip to which the most recently saved makeover is applied.
Returns
True if the mc exists; false if it does not.
Description
Method; applies the most recently saved makeover to a movieclip containing all the makeover's color features
Example
mySaveControl.applyCurrent();
getCurrentIndex :
Availability
Flash Player 6
Usage
mySaveControl.getCurrentIndex();
Parameters
None.
Returns
A number representing an index in the saves array.
Description
Method; retrieves the index of the most recently saved Makeover from the saves array.
Example
The following example reverts to the last saved Makeover state.mySaveControl.undo(mySaveControl.getCurrentIndex() - 1);
onUpdate : feature
Availability
Flash Player 6
Usage
mySaveControl.onUpdate(feature);
Parameters
feature - an instance of the ColorFeature object.
Returns
Nothing.
Description
Event Handler; creates a new Makeover object with the updated feature and saves it in the saves array, and calls the applyCurrent() method.
Example
myFeature = new ColorFeature();
mySaveControl.onUpdate(myFeature);
redo : index
Availability
Flash Player 6
Usage
mySaveControl.redo(index);
Parameters
index - the index of the Makeover object in the saves array to apply.
Returns
True if a Makeover object exists at the specified index; false if one does not.
Description
Method; applies the Makeover in the saves array specified by the index.
Example
mySaveControl.redo(mySaveControl.getCurrentIndex + 1);
setInitialMakeover : makeoverObj
Availability
Flash Player 6
Usage
mySaveControl.setInitialMakeover(makeoverObj);
Parameters
makeoverObj - an instance of the Makeover class.
Returns
Nothing.
Description
Method; Sets the initial makeover object model. All subsequent saves are built off of this initial model.
Example
The following example creates a new (simple) Makeover object and sets it as the initial model for the saveControl:defaultTransform = {ra: 100, rb: 0, ga: 100, gb: 0, ba: 100, bb: 0, aa: 100, ab: 255};
cF1 = new ColorFeature();
cF1.addElement(_root.movie1_mc);
cF1.addElement(_root.movie2_mc);
cF2 = new ColorFeature();
cF1.addElement(_root.movie3_mc);
mainMakeover = new Makeover();
mainMakeover.addFeature(cF1,defaultTransform);
mainMakeover.addFeature(cF2,defaultTransform);
mySaveControl = new SaveControl();
mySaveControl.setInitialMakeover(mainMakeover);
undo : index
Availability
Flash Player 6
Usage
mySaveControl.undo(index);
Parameters
index - The index (in the saves array) to revert to.
Returns
True if a Makeover object exists at the specified index; false if one does not.
Description
Method; reverts to the Makeover in the saves array specified by the index.
Example
mySaveControl.undo(mySaveControl.getCurrentIndex() - 1);
SaveControl Events
onApply : colorObj
No documentation available.
SaveControl Associations
SaveControl is dependent upon Stamper
SaveControl is comprised of Makeover
SaveControl inherits from EventBroadcaster
Availability
Flash Player 6
Usage
myStamper = new Stamper();
Parameters
None.
Returns
An instance of the Stamper class.
Description
The Stamper creates and tracks stamp objects and their impressions. A "stamp" is the physical object used by the user to create the "impressions".
Example
myStamper = new Stamper();
myStamper.addStamps(_root.stamp1_mc,_root.stamp2_mc);
Stamper Properties
dragging : Boolean
No documentation available.
impressions : Array
Availability
Flash Player 6
Usage
myStamper.impressions
Description
Read-Only Property; do not modify directly. The stamp() method adds elements to the impressions array.
stampCount : Number
Availability
Flash Player 6
Usage
myStamper.stampCount
Description
Read-Only Property; a number representing the number of stamps created.
stamps : Array
Availability
Flash Player 6
Usage
myStamper.stamps
Description
Read-Only Property; stores all of the stampers available to the user.
Stamper Methods
addStamps : stamp
Availability
Flash Player 6
Usage
myStamper.addStamps(stamp1 [, stamp2, stamp3...stampN]);
Parameters
stamp1 - An instance of the Stamp object to add to the Stamper control.
stamp2,stamp3...stampN - Additional Stamp objects.
Returns
True if the stamp(s) are added; false if an error is encountered.
Description
Method; adds new stamps to the Stamper object.
Example
myStamper = new Stamper();
stamp1 = new Stamp(_root.stamp1_mc,"stamp1");
stamp2 = new Stamp(_root.stamp2_mc,"stamp2");
myStamper.addStamps(stamp1,stamp2);
onPickUp :
Availability
Flash Player 6
Usage
Private Method
Parameters
None.
Returns
Nothing.
Description
Method; overload this method to extend the Stamper's capabilities.
Example
myStamper = new Stamper();
myStamper.onPickUp = function () {
trace("stamp has been picked up!");
}
onSetDown :
Availability
Flash Player 6
Usage
Private Method
Parameters
None.
Returns
Nothing.
Description
Method; overload this method to extend the Stamper's capabilities.
Example
myStamper = new Stamper();
myStamper.onSetDown = function () {
trace("the stamp was set down.");
}
onStamp :
Availability
Flash Player 6
Usage
Private Method
Parameters
None.
Returns
Nothing.
Description
Method; overload this method to extend the Stamper's capabilities.
Example
myStamper = new Stamper();
myStamper.onStamp = function () {
trace("A stamp is born.");
};
onStartDrag :
Availability
Flash Player 6
Usage
Private Method
Parameters
None.
Returns
Nothing.
Description
Method; sets the dragging property to true. Overload this method to extend the Stamper's capabilities.
Example
myStamper = new Stamper();
myStamper.onStartDrag = function () {
trace("dragging a stamp...");
};
onStopDrag :
Availability
Flash Player 6
Usage
Private Method
Parameters
None.
Returns
Nothing.
Description
Method; sets the dragging property to false. Overload this method to extend the Stamper's capabilities.
Example
myStamper = new Stamper();
myStamper.onStopDrag = function () {
trace("done dragging this stamp.");
};
removeStamps : mc
Availability
Flash Player 6
Usage
myStamper.removeStamps(stamp1 [, stamp2, stamp3...stampN]);
Parameters
stamp1 - An instance of the Stamp object to remove from the Stamper control.
stamp2,stamp3...stampN - Additional Stamp objects.
Returns
True if the stamp(s) are removed; false if an error is encountered.
Description
Method; removes stampers from the Stamper object.
Example
myStamper.removeStamps(stamp1,stamp2);
stamp :
Availability
Flash Player 6
Usage
Private Method
Parameters
None.
Returns
Nothing.
Description
Private Method; creates an impression of the currently selected stamp.
Stamper Events
onUpdate : this
No documentation available.
Stamper Associations
SaveControl is dependent upon Stamper
Stamper is comprised of Stamp
Stamper inherits from EventBroadcaster
Availability
Flash Player 6
Usage
stamp1 = new Stamp(_root.stamp1_mc,"stamp1");
Parameters
id - the identifier of the library element to be used as the stamp's impression.
mc - the movieclip to be used as the stamp.
Returns
An instance of the Stamp class.
Description
Object; a simple container for the movieclip and library element to be used in stamping.
Example
stamp1 = new Stamp(_root.stamp1_mc,"stamp1");
Stamp Properties
id : String
Availability
Flash Player 6
Usage
Read-Only Property
Description
Property; the identifier of the library element to be used as the stamp's impression.
mc : MovieCip
Availability
Flash Player 6
Usage
Read-Only Property
Description
Property; the movieclip to be used as the stamp.
Stamp Methods
None.
Stamp Events
None.
Stamp Associations
Makeover is comprised of Stamp
Stamper is comprised of Stamp
Availability
Flash Player 6
Usage
myFadepoint = new FadePoint(pos,r,g,b);
Parameters
pos - the position (0-100) in the gradient spectrum on which the point exists.
r - a number 0-255 representing the red value of the FadePoint's color.
g - a number 0-255 representing the green value of the FadePoint's color.
b - a number 0-255 representing the blue value of the FadePoint's color.
Returns
An instance of the FadePoint class.
Description
The FadePoint object stores information for a single point on a gradient spectrum, including the point's RGB values and the position of the point on the spectrum.
Example
The following code creates a new gradient array (an array composed of FadePoint objects), and utilizes that gradient in a new Fader object.red = new FadePoint(0,255,0,0);
green = new FadePoint(50,0,255,0);
blue = new FadePoint(100,0,0,255);
rgbGradient = [red,green,blue];
myFader = new Fader(_root.fader_mc,rgbGradient);
FadePoint Properties
aa : Number
Availability
Flash Player 6
Usage
myPoint.aa
Description
Property; a number 0-100 representing the alpha percentage of the FadePoint's color.
Example
bb : Number
Availability
Flash Player 6
Usage
myPoint.bb
Description
Property; a number 0-255 representing the blue value of the FadePoint's color.
gb : Number
Availability
Flash Player 6
Usage
myPoint.gb
Description
Property; a number 0-255 representing the green value of the FadePoint's color.
pos : Number
Availability
Flash Player 6
Usage
myPoint.pos
Description
Property; the position (0-100) in the gradient spectrum on which the point exists.
rb : Number
Availability
Flash Player 6
Usage
myPoint.rb
Description
Property; a number 0-255 representing the red value of the FadePoint's color.
FadePoint Methods
None.
FadePoint Events
None.
FadePoint Associations
Fader is dependent upon FadePoint
Availability
Flash Player 6
Usage
EventBroadcaster.initialize(obj);
Parameters
None.
Returns
An instance of the EventBroadcaster class.
Description
The Event Broadcaster enables any object to broadcast events by adding three methods to the object: broadcastMessage(), addListener(), and removeListener(). It also endows the object with a listeners array.
Example
#include "EventBroadcaster.as"
myObj = new Object();
EventBroadcaster.init(myObj);
EventBroadcaster Properties
None.
EventBroadcaster Methods
initialize : obj
Availability
Flash Player 6
Usage
EventBroadcaster.initialize(obj);
Parameters
obj - Any object. (Object)
Returns
Nothing.
Description
Method; adds the EventBroadcaster methods (addListener(), broadcastMessage(), and removeListener()) and properties (the listeners array) to an object.
Example
#include "EventBroadcaster.as"
myObj = new Object();
EventBroadcaster.init(myObj);
_addListener : obj
Availability
Flash Player 6
Usage
myObject.addListener(obj);
Parameters
obj - An object to receive events broadcast by the object to which this method is added.
Returns
True if the object is added successfully; false if errors are encountered.
Description
Private Method - do not invoke directly. This method is added to an object (using the initialize() method) enabling it to add its own listener objects.
Example
master = new Object();
slave = new Object();
EventBroadcaster.initialize(master);
master.addListener(slave);
_broadcastMessage : event,args
Availability
Flash Player 6
Usage
myObject.broadcastMessage(event,args);
Parameters
event - The event name. (String)
args - An argument (or series of arguments) to pass to the event handler. (Object)
Returns
Nothing.
Description
Private Method - do not invoke directly. This method is added to an object (using the initialize() method) enabling it to add its broadcast events to its listener objects.
Example
master = new Object();
slave = new Object();
EventBroadcaster.initialize(master);
master.addListener(slave);
master.broadcastMessage("onClick",Mouse.x,Mouse.y);
_clearListeners :
Availability
Flash Player 6
Usage
myObject.clearListeners();
Parameters
None.
Returns
Nothing.
Description
Method; clears all listeners from an object.
Example
myBroadcaster.clearListeners();
_removeListener : obj
Availability
Flash Player 6
Usage
myObject.removeListener(obj);
Parameters
obj - An object added using the addListener method. (Object)
Returns
True if the object is removed; false if it is not found.
Description
Private Method - do not invoke directly. This method is added to an object (using the initialize() method) enabling it to remove listener objects.
Example
master = new Object();
slave = new Object();
EventBroadcaster.initialize(master);
// add the listener
master.addListener(slave);
// now remove it
master.removeListener(slave);
EventBroadcaster Events
None.
EventBroadcaster Associations
Stamper inherits from EventBroadcaster
ColorFeature inherits from EventBroadcaster
Fader inherits from EventBroadcaster
SaveControl inherits from EventBroadcaster