Created
May 10, 2010 21:40
-
-
Save trxcllnt/396592 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<rx:Skin | |
xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:graphics="reflex.graphics.*" | |
xmlns:layout="reflex.layout.*" | |
xmlns:rx="http://rx.reflex.io/2010" | |
xmlns:s="library://ns.adobe.com/flex/spark" | |
> | |
<rx:states> | |
<s:State name="over"/> | |
<s:State name="down"/> | |
</rx:states> | |
<fx:Declarations> | |
<graphics:Draw | |
id="drawingObj" | |
fillColor="0x00" | |
fillColor.down="0x00FF00" | |
fillColor.over="0xFF0000" | |
strokeColor="0xCCCCCC" | |
strokeColor.down="0xFF0000" | |
strokeColor.over="0x00FF00" | |
/> | |
</fx:Declarations> | |
<graphics:Rect | |
height="30" | |
width="100" | |
fill="{drawingObj}" | |
stroke="{drawingObj}" | |
/> | |
<graphics:Rect | |
x="100" | |
height="20" | |
width="50" | |
fill="{drawingObj}" | |
stroke="{drawingObj}" | |
includeIn="over" | |
/> | |
</rx:Skin> | |
package reflex.graphics | |
{ | |
import flash.display.Graphics; | |
import flash.events.EventDispatcher; | |
public class Draw extends EventDispatcher | |
{ | |
[Bindable] | |
public var strokeColor:uint = 0x0; | |
[Bindable] | |
public var fillColor:uint = 0x0; | |
public function apply(g:Graphics, ... args):void | |
{ | |
g.lineStyle(1, strokeColor); | |
} | |
public function begin(g:Graphics, ... args):void | |
{ | |
g.beginFill(fillColor, 0.5); | |
} | |
public function end(g:Graphics, ... args):void | |
{ | |
g.endFill(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment