Re: [Flashcoders] Custom DrawRectangle Question

2008-03-26 Thread Omar Fouad
Oh yeah I'll make the variables private and make their setters and getters. Any ways thanks for the help everybody. Hasta! On Wed, Mar 26, 2008 at 1:07 PM, Allandt Bik-Elliott (Receptacle) < [EMAIL PROTECTED]> wrote: > It seems to me that that would work as a Sprite too - less memory > overhead

Re: [Flashcoders] Custom DrawRectangle Question

2008-03-26 Thread Allandt Bik-Elliott (Receptacle)
It seems to me that that would work as a Sprite too - less memory overheads (not by much, mind, but it'll help if there's a lot of them) also, would you be better off making your class variables protected or private? Those variables are being set by the constructor, anyway, and if you use g

Re: [Flashcoders] Custom DrawRectangle Question

2008-03-25 Thread jonathan howe
Right. I guess I was trying to address your issue about having to add it to the display list twice. You'd still need to addChild( ); But having DrawRectangle extend Sprite and then drawing directly on this.graphics solves the problem of doing it twice. -jonathan On Tue, Mar 25, 2008 at 4:55 PM,

Re: [Flashcoders] Custom DrawRectangle Question

2008-03-25 Thread Omar Fouad
Yeah A good method to do rectangles fast On Tue, Mar 25, 2008 at 9:30 PM, Cor <[EMAIL PROTECTED]> wrote: > Mmm, sounds familiair. :-) > It has to be added to the Displaylist otherwise it isn't visible. > > Cor > > -Oorspronkelijk bericht- > Van: [EMAIL PROTECTED] > [mailto:[EMAIL

RE: [Flashcoders] Custom DrawRectangle Question

2008-03-25 Thread Cor
Mmm, sounds familiair. :-) It has to be added to the Displaylist otherwise it isn't visible. Cor -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Omar Fouad Verzonden: maandag 24 maart 2008 22:01 Aan: Flash Coders List Onderwerp: [Flashcoders] Cust

Re: [Flashcoders] Custom DrawRectangle Question

2008-03-24 Thread Omar Fouad
Nothing Changed..The Code is the same and it is not autoadding... By the way I Know that There is allready drawRect() but I will be adding some more functionalities to the class that drawRect has not. On Tue, Mar 25, 2008 at 1:36 AM, jonathan howe <[EMAIL PROTECTED]> wrote: > You could just dra

Re: [Flashcoders] Custom DrawRectangle Question

2008-03-24 Thread jonathan howe
You could just draw the rectangle directly on the graphics of the DrawRectangle: graphics.lineStyle(1, 0xFF); graphics.beginFill(0xFF, .3); graphics.drawRect(_x,_y,_w,_h); Because it extends MovieClip (or Sprite, hopefully, as Steven suggests, it has its o

Re: [Flashcoders] Custom DrawRectangle Question

2008-03-24 Thread Omar Fouad
Aha I get it... But can I make a work out in order not to put addChild() in the main Class? I mean that once I Make an Instance of the class it adds it on the stage by itself. Thanks On Mon, Mar 24, 2008 at 11:27 PM, Cory Petosky <[EMAIL PROTECTED]> wrote: > To clarify Jason's response: > > You

Re: [Flashcoders] Custom DrawRectangle Question

2008-03-24 Thread Cory Petosky
To clarify Jason's response: You're adding two different things. In the first case, you're adding a child movieclip (with a rectangle drawn inside it) to the empty DrawRectangle instance. In the second case, you're adding the DrawRectangle instance to the screen. You should rewrite your init func

RE: [Flashcoders] Custom DrawRectangle Question

2008-03-24 Thread Merrill, Jason
Because within your class which extends MovieClip, you are creating a new MovieClip, which you draw on, and thus also has to be added to the display list. Also, you do know about : sprite.graphics.drawRect() right? So what is this class going to accomplish? Any reason you are using MovieClip