all groups > flash actionscript > april 2006 >
You're in the

flash actionscript

group:

Importing a Class


Importing a Class MediaMisfit
4/20/2006 11:44:50 PM
flash actionscript: So what I'm trying to do is import a class in action script. Right now I'm
using
import actionscriptbible.drawing.DrawingUtilities;

Any it's saything that it can't import to the variable for some reason.
My global classes folder I'm assuming is in the /flash/en/firststart/classes
directory

My error is this.
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 15: The class or
interface 'DrawingUtilities' could not be loaded.
var duDrawer:DrawingUtilities;

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 20: The class or
interface 'DrawingUtilities' could not be loaded.
duDrawer = new DrawingUtilities(mMask);

Total ActionScript Errors: 2 Reported Errors: 2

Basically my variable are choking because the class isn't working.
Any help would be appreciated. I'm working with Flash 8 Pro.
Re: Importing a Class myIP
4/21/2006 1:00:07 AM
You have the class located correctly, but it is the way you are calling it that
is incorrect. You have;

duDrawer = new DrawingUtilities(mMask);

This will give you errors as you know. Try the line of code below and get rid
of the ?import? line and the variable declaration that you have.
.

duDrawer = actionscriptbible.drawing.DrawingUtilities(mMask);

I don?t know exactly how this works yet. But if you have the class in the
FLA?s subdirectories then use ?import? at the top of the class.
AddThis Social Bookmark Button