Importing the Proper Classes into your Package

Page 1

Importing Classes/Packages to Make your External ActionScript Files Work Properly 漏2010 mkelly/robert morris university

first of all, which Classes/Packages does Flash need to make your external actionScript work and secondly, why? if you try to publish and you don始t have your base Classes available for Flash to scrutinize, Flash will let you know:

so there始s the which, and note that there may be several which始s. so what about the why? to keep your file size small and your execution speed quick, Flash operates on a need to know basis which means it only wants to carry the essential class definitions that it gathers from Packages (pathways) after you tell it to. so now you know you need to import the base MovieClip class and why. the import process itself almost always start out like this: or in some cases: so how do you know which one? and how do you know what comes next? if you want to know all about such package solutions... ...if you highlight disabled), Flash Help will open to:

, and hit F1 or (fn F1 if your hotkeys are


you can also click on Packages above pretty much from anywhere in the Help menu to see the base classes hidden away in their proper Packages as on the next page.

so you can see some of the Package pathways above including flash.display and flash.events, two of the most popular ones. remember flash.events means that there are two folders out there: one named flash, the other events that Flash will look into to find snuggly nestled inside the MovieClip.as class file.


if you , you始ll see among others under flash.display so now you know the proper pathway is flash.display.MovieClip. an even better way is to type in

so now just type

and

and F1 to get:

and you are good to go.

the same thing will be true for any other base Class that Flash tells you that you are missing.


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.