Your: class rect { needs to be: class com.drawing.rect { And Either move: private var ref:Object = target_mc; To outside the drawRectangle() function or drop the word private from the declaration.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of murder design Sent: Friday, March 10, 2006 11:46 AM To: Flashcoders mailing list Subject: [Flashcoders] oop[s?] coming from a C/ASM background, and today is my first day trying to convert all of the hundreds upon hundreds of lines of code i use daily to a component/classes. i want to organize it, so i have my main file in the root directory (mysite.com) importing with: // begin code import com.drawing.rect; // end code my folder is setup as such... main directory (com), empty. several subfolders. inside the main folder is a folder named drawing. inside drawing is rect.as. here are the contents of rect.as: // begin code class rect { // ------------------------- public var radius1:Number; public var radius2:Number; public var radius3:Number; public var radius4:Number; public var rWidth:Number; public var rHeight:Number; public var rColor:Number; public var rAlpha:Number; public function drawRectangle(target_mc:MovieClip) { private var ref:Object = target_mc; with(ref) { beginFill(rColor, rAlpha); moveTo(rRadius1, 0); lineTo(rWidth, 0); lineTo(rWidth, rHeight - rRadius2); curveTo(rWidth, rHeight, rWidth - rRadius2, rHeight); lineTo(rRadius3, rHeight); curveTo(0, rHeight, 0, rHeight - rRadius3); lineTo(0, rRadius4); curveTo(0, 0, oRadius4, 0); endFill(); } } } // end code error msg: **Error** G:\mysite.com\com\drawing\rect.as: Line 7: The class being compiled, 'rect', does not match the class that was imported, ' com.drawing.rect'. class rect { **Error** G:\mysite.com\com\drawing\rect.as: Line 18: Attribute used outside class. private var ref:Object = target_mc; Total ActionScript Errors: 2 Reported Errors: 2 what does this mean? ... -edward _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com