MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 374

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

Description
Keyword; specifies that objects based on the specified class can add and access dynamic properties
at runtime.
Type checking on dynamic classes is less strict than type-checking on nondynamic classes, because
members accessed inside the class definition and on class instances are not compared to those
defined in the class scope. Class member functions, however, can still be type checked for return
type and parameter types. This behavior is especially useful when you work with MovieClip
objects, because there are many different ways of adding properties and objects to a movie clip
dynamically, such as
MovieClip.createTextField()
Subclasses of dynamic classes are also dynamic.
For more information, see
Example
In the following example, class B has been marked as dynamic, so calling an undeclared function
on it will not throw an error at compile time.
// in B.as
dynamic class B extends class_A {
function B() {
/*this is the constructor*/
}
function m():Number {return 25;}
function o(s:String):Void {trace(s);}
}
// in C.as
class C extends class_A {
function C() {
/*this is the constructor*/
}
function m():Number {return 25;}
function o(s:String):Void {trace(s);}
}
// in another script
var var1 = B.n();
var var2 = C.n()
See also
,
class
extends
374
Chapter 12: ActionScript Dictionary
MovieClip.createEmptyMovieClip()
.
"Creating dynamic classes" on page
// no error
// error, as there is no function n in C.as
and
173.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents