03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - 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.

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

duplicateMovieClip(), <strong>ActionScript</strong> 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 <strong>ActionScript</strong> 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 <strong>ActionScript</strong> class called theClass that inherits<br />

the properties of the MovieClip class:<br />

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

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6 - If you are using <strong>ActionScript</strong> <strong>2.0</strong> classes, you<br />

can use the <strong>ActionScript</strong> <strong>2.0</strong> Class field in the Linkage Properties or Symbol Properties dialog<br />

box to associate an object with a class instead of using this method.<br />

Parameters<br />

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

for the <strong>ActionScript</strong> class.<br />

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

null to unregister the symbol.<br />

Returns<br />

Boolean - A Boolean value: if the class registration succeeds, a value of true is returned;<br />

false otherwise.<br />

See also<br />

attachMovie (MovieClip.attachMovie method), duplicateMovieClip<br />

(MovieClip.duplicateMovieClip method)<br />

1014 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!