Dashed Rectangle Border in Flash Actionscript 3 - getW3Help.com - Free Web Tutorials and Resources
Subscribe
Stay Updated
Dashed Rectangle Border in Flash Actionscript 3
Posted on Oct 4, 2009 by Makubex, 3 comments
I have created class file for drawing dashed rectangle in Actionscript 3. Check out the demo below and click here for the Actionscript file.
Flash CS3, AS 3.0



Demo:





Usage:

import dashed;

dashed.drawRect(this, { x: 50, y: 50, width:100, height: 250, borderColor: 0xff0000, borderAlpha: 1, bgColor: 0xf5f5f5, bgAlpha: 1 } );



Parameters:

First Parameter:
Is the movieclip name where you want to place your dashed rectangle.
In my case I have used "this" which refers to stage. You can use movieclip name instead of "this".

Second Parameter:
They are the properties of the dashed rectangle. There are totally 8 properties.
1. x
2. y
3. width
4. height
5. borderColor : dashed border color of the rectangle.
6. borderAlpha : dashed border alpha of the rectangle.
7. bgColor : background color of the rectangle.
8. bgAlpha : background Alpha of the rectangle.


Download: dashed.as

Labels: , , ,

Comments
Post a Comment

Cool :D

By Blogger knalle, at November 24, 2009 at 11:14 AM  

Thanks for your code; useful;

By Anonymous Neo, at February 19, 2010 at 3:03 AM  

Thanks, your code is really useful !

From France ;)

By Blogger damien, at May 21, 2010 at 6:05 AM  


Hi, I am Karthikeyan VJ (aka makubex). I am a independent Interactive Developer and I am currently focusing on Flash, Flex and AIR