I have created class file for drawing dashed rectangle in Actionscript 3. Check out the demo below and
for the Actionscript file.
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