Link to home
Start Free TrialLog in
Avatar of petersego
petersego

asked on

how do I import packages

I simply cant seem to import packages like in the .as-file below.
It is placed in the same folder as my .fla-file that is totally empty.
I have been told that I do not have to do anything if the package havent got a name.
The package is an example from the help-menu that should show something, but what should I do in the .fla-file to have it show me the example...
package {
    import flash.geom.Matrix;
    import flash.display.Sprite;
    import flash.display.GradientType;
 
    public class MatrixExample extends Sprite {
 
        public function MatrixExample() {
            var myMatrix:Matrix = new Matrix();
            trace(myMatrix.toString());    // (a=1, b=0, c=0, d=1, tx=0, ty=0)
 
            myMatrix.createGradientBox(200, 200, 0, 50, 50);
            trace(myMatrix.toString());    // (a=0.1220703125, b=0, c=0, d=0.1220703125, tx=150, ty=150)
 
            var colors:Array = [0xFF0000, 0x0000FF];
            var alphas:Array = [100, 100];
            var ratios:Array = [0, 0xFF];
            graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, myMatrix);
            graphics.lineTo(0, 300);
            graphics.lineTo(300, 300);
            graphics.lineTo(300, 0);
            graphics.lineTo(0, 0);
        }
    }
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of moagrius
moagrius
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of petersego
petersego

ASKER

Thanks