Feb 15 2009

AS3 resizable curved box with gradients Final

Category: ClassesHadi Tavakoli @ 7:13 pm

in my last post I tried to create curved boxes with a VERY bad practice! and although after I lernt about "DrawRoundRect" I wanted to continue with my other class but now I decided to use the new method because this one is cleaner and more understanable and as we are going ahead, our application will get very heavy so we must save as much CPU as we can. So now I created the very same curved box with gradient colors but this time we will do it all in codes and we won't create any premade movieclips in the library like what we did in the last post here.

This is the class saved with the name of "CurvedRectacgle.as".


		  
		  
		  
		  
		  
		  
		

and whenever you want to draw your curved box with the gradient color in it, you may use it like this:


		  
		  
		  
		  
		  
		  
		

Using this method will save us a lot of CPU and also KB as we are not using all those movieclips in the library and besides that, this class all uses the Sprite and no movieclips involved here :) I'm sure this version is a lot better, don't you?

Regards,
Hadi

Tags: , , , , , , , ,

Leave a Reply

*