yep that was it - thanks jason

it's left in from when it was a part of the app

thanks again
a



On 17 Mar 2008, at 17:27, Merrill, Jason wrote:

Why are you using "internal" for the class definition?

From the Flex help docs:

"If you do not want a class to be publicly visible outside a package,
place the class inside a package and mark the class with the internal
attribute."


Jason Merrill
Bank of America
GT&O and Risk L&LD Solutions Design & Development
eTools & Multimedia

Bank of America Flash Platform Developer Community


Are you a Bank of America associate interested in innovative learning
ideas and technologies?
Check out our internal  GT&O Innovative Learning Blog & subscribe.






-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Allandt Bik-Elliott (Receptacle)
Sent: Monday, March 17, 2008 1:14 PM
To: flashcoders
Subject: [Flashcoders] classpath issues

hi guys

 i hope you can help me with this:

i am trying to set up a library of classes that i can re-use
in my actionscript but i keep getting the following errors:
1046: Type was not found or was not a compile-time constant:
SimpleRectangle.
1180: Call to a possibly undefined method SimpleRectangle.

i have set up a folder called 'Actionscript Classes' and set
the classpath for as3 (tried as2 as well) to point to it the
folder structure within this folder is: com/receptacle/utils
within the utils folder i have a class called
SimpleRectangle.as which is as follows:
[code]package com.receptacle.utils
{
        //package imports
        import flash.display.Sprite;
        import flash.display.Shape;
        
        internal class SimpleRectangle extends Sprite
        {
                // class variable declarations
                
                // constructor
                public function SimpleRectangle(colour:uint,
outlineColour:uint, rectX:Number, rectY:Number,
rectWidth:uint, rectHeight:uint)
                {
                        simpleRectangle(colour, outlineColour,
rectX, rectY, rectWidth, rectHeight);
                }
                
                private function simpleRectangle(colour:uint,
outlineColour:uint, rectX:Number, rectY:Number,
rectWidth:uint, rectHeight:uint):Shape
                {
                        trace("Rectangle Drawn");
                        var r:Shape = new Shape();
                        r.graphics.lineStyle(1,outlineColour);
                        r.graphics.beginFill(colour, 1);
                        r.graphics.drawRect(0, 0, rectWidth,
rectHeight);
                        r.graphics.endFill();
                        r.x = rectX;
                        r.y = rectY;
                        addChild(r);
                        return r;
                }

        }
}[/code]

the code for my document class is
[code]package
{
        //package imports
        import com.receptacle.utils.*;
        import flash.display.*;
        
        internal class TestApp extends Sprite
        {
                // class variable declarations
                
                // constructor
                public function TestApp()
                {
                        setVars();
                }
                
                private function setVars()
                {
                        var simpleText:SimpleRectangle = new
SimpleRectangle();
                }
        }
}[/code]


when i had the SimpleRectangle class in the same folder as
the rest of my app (with amended package), everything was
working fine but now that i've tried to import from my own
library it's not - my best guess is that i've messed the
classpath up somewhere but i can't see it

thanks a lot

a



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to