03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

See also<br />

__proto__ (Object.__proto__ property)<br />

registerClass (Object.registerClass method)<br />

public static registerClass(name:String, theClass:Function) : Boolean<br />

Associates a movie clip symbol with an ActionScript object class. If a symbol doesn't exist,<br />

Flash creates an association between a string identifier <strong>and</strong> an object class.<br />

When an instance of the specified movie clip symbol is placed on the Timeline, it is registered<br />

to the class specified by the theClass parameter rather than to the class MovieClip.<br />

When an instance of the specified movie clip symbol is created by using<br />

MovieClip.attachMovie() or MovieClip.duplicateMovieClip(), it is registered to the<br />

class specified by theClass rather than to the MovieClip class. If theClass is null, this<br />

method removes any ActionScript class definition associated with the specified movie clip<br />

symbol or class identifier. For movie clip symbols, any existing instances of the movie clip<br />

remain unchanged, but new instances of the symbol are associated with the default class<br />

MovieClip.<br />

If a symbol is already registered to a class, this method replaces it with the new registration.<br />

When a movie clip instance is placed by the Timeline or created using attachMovie() or<br />

duplicateMovieClip(), ActionScript invokes the constructor for the appropriate class with<br />

the keyword this pointing to the object. The constructor function is invoked with no<br />

parameters.<br />

If you use this method to register a movie clip with an ActionScript class other than<br />

MovieClip, the movie clip symbol doesn't inherit the methods, properties, <strong>and</strong> events of the<br />

built-in MovieClip class unless you include the MovieClip class in the prototype chain of the<br />

new class. The following code creates a new ActionScript class called theClass that inherits<br />

the properties of the MovieClip class:<br />

theClass.prototype = new MovieClip();<br />

Parameters<br />

name:String - String; the linkage identifier of the movie clip symbol or the string identifier<br />

for the ActionScript class.<br />

theClass:Function - A reference to the constructor function of the ActionScript class or<br />

null to unregister the symbol.<br />

528 ActionScript classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!