EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Understanding Classes and Scope

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Understanding classes and scope 283
To delete ASO files:
If you are editing a FLA file, and you want to delete an ASO file, select one of the following in
the authoring environment:
Select Control > Delete ASO Files to delete ASO files and continue editing.
Select Control > Delete ASO Files and Test Movie to delete ASO files and test
the application.
If you are editing an ActionScript document in the Script window:
Select Control > Delete ASO Files to delete ASO files and continue editing.
Select Control > Delete ASO Files and Test Project to delete ASO files and then test
the application.
There is a limit to how much code you can place in a single class: the bytecode for a class
definition in an exported SWF file cannot be larger than 32,767 bytes. If the bytecode is
larger than that limit, a warning message appears.
You cant predict the size of the bytecode representation of a given class, but classes up to
1,500 lines usually dont go over the limit.
If your class goes over the limit, move some of the code into another class. In general, it is
good OOP practice to keep classes relatively short.
Understanding classes and scope
When you move ActionScript code into classes, you might have to change how you use the
this keyword. For example, if you have a class method that uses a callback function (such as
the LoadVars classs
onLoad() method), it can be difficult to know whether the this
keyword refers to the class or to the LoadVars object. In this situation, it might be necessary to
create a pointer to the current class, as the next example shows.

Table of Contents

Related product manuals