I am trying to load an image dynamically to the Image control and then add it to a sprite and add the sprite to the UIComponent.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
applicationComplete="init()">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<fx:int id = "_rows" />
<fx:int id = "_cols" />
</fx:Declarations>
<s:layout>
<s:VerticalLayout>
</s:VerticalLayout>
</s:layout>
<fx:Script>
<![CDATA[
import as3isolib.geom.Pt;
import as3isolib.utils.IsoDrawingUtil;
import mx.controls.Alert;
import mx.core.IVisualElement;
private var sprite:Sprite;
[Binable]
private var imgUrl:String = "http://localhost/greenrev/images//marketitems/menu_houses.png";
//[Bindable]
// private var _rows:int = 1;
// //[Bindable]
// private var _cols:int = 1;
private var _cellSize:int=40;
private function init(){
sprite = new Sprite();
//Alert.show(sprite.numChildren.toString());
imgContainer.addChild(sprite);
//Alert.show(sprite.numChildren.toString());
loadImage(imgUrl);
}
private function loadImage(url:String):void{
//img.source = url;
img.load(url);
}
private function loadingComplete(event:Event):void{
if (sprite.numChildren>0){
sprite.removeChildAt(0);
}
sprite = new Sprite();
sprite.addChild(img);
sprite.cacheAsBitmap = true;
sprite.graphics.clear();
sprite.graphics.beginFill(0xffff00, 0.3);
_rows = int(rows.text);
_cols = int(cols.text);
Alert.show(_rows.toString() + "," + _cols.toString());
IsoDrawingUtil.drawIsoRectangle(sprite.graphics,new Pt(0,0),_cellSize * _rows,_cellSize * _cols);
sprite.graphics.endFill();
if (imgContainer.numChildren>0){
imgContainer.removeChildAt(0);
}
imgContainer.addChild(sprite);
// imgContainer.addChild(img);
//Alert.show("loading complete");
}
private function loadingFail(event:IOErrorEvent):void{
Alert.show(event.text);
}
]]>
</fx:Script>
<s:BorderContainer id="main" verticalCenter="-244" horizontalCenter="-422" width="80%" height="90%">
<s:layout>
<s:VerticalLayout verticalAlign="middle" horizontalAlign="center">
</s:VerticalLayout>
</s:layout>
<s:BorderContainer>
<mx:UIComponent id="imgContainer">
</mx:UIComponent>
</s:BorderContainer>
<s:BorderContainer>
<s:layout>
<s:HorizontalLayout>
</s:HorizontalLayout>
</s:layout>
<s:VGroup>
<s:TextInput id="rows" minWidth="100" text = "{_rows}"/>
<s:TextInput id = "cols" minWidth="100" text = "{_cols}"/>
<s:TextInput id = "txtImgUrl" minWidth="400" text="{imgUrl}"/>
<s:Button label="Refresh" click="loadImage(imgUrl)"/>
</s:VGroup>
</s:BorderContainer>
</s:BorderContainer>
<mx:Image id="img" complete="loadingComplete(event)" visible="true" ioError="loadingFail(event)">
</mx:Image>
</s:Application>
I have no clue why the image is not being shown. Like you can see, I am trying to add the image after the COMPLETE event occurs. Please help
I changed the URL to "http://horses-bg.net/wp-content/uploads/2009/11/2752_beloved-horses.jpg" and the image appeared.
I've also commented out the IsoDrawingUtil.drawIsoRectangle(..) cause i don't have the lib you're using.
The problem might be in your URL or in that IsoDrawingutil thing :]
Hope this helps,
Good luck!
Blaze
Related
Hi can anyone tell me why is my Seekbar's background and progress always have some opacity and just can't be removed even I have set the alpha to 1.0. Below is my progress_drawable.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="#android:id/background">
<shape>
<corners android:radius="5dip" />
<gradient
android:alpha="1.0"
android:startColor="#000000"
android:endColor="#000000"/>
</shape>
</item>
<item android:id="#android:id/secondaryProgress">
<clip>
<shape>
<corners android:radius="5dip" />
<gradient
android:alpha="1.0"
android:startColor="#000000"
android:endColor="#000000" />
</shape>
</clip>
</item>
<item android:id="#android:id/progress">
<clip>
<shape>
<corners android:radius="5dip" />
<gradient
android:alpha="1.0"
android:endColor="#2e2dff"
android:startColor="#2e2dff" />
<solid android:color="#2e2dff" />
</shape>
</clip>
</item>
And this is the SeekBar tag in activity xml:
<SeekBar
android:padding="0dp"
android:id="#+id/normalSeekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgPenguin"
android:alpha="1"
android:progress="0"
android:progressDrawable="#drawable/progress_drawable"
android:secondaryProgress="0" />
I got this result but I want the bars to be opaque, please advise and thanks in advanced.
Just found the issue:
normalSB.setEnabled(false);
I shouldn't use setEnabled(false) to avoid user drag on thumb, instead, I have done this to reset progress when fromUser == true:
normalSB.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
int originalProgress;
#Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
float seekBarStarting = seekBar.getX();
float seekBarWidth = seekBar.getWidth();
float seekBarOffset = seekBar.getThumbOffset();
float ratio = (float) progress / seekBar.getMax();
float scaledProgress = ratio * seekBarWidth;
if (scaledProgress > imgPenguin.getWidth()) {
imgPenguin.setX(seekBarStarting - imgPenguin.getWidth() + scaledProgress);
}
if (fromUser == true) {
seekBar.setProgress(originalProgress);
}
}
#Override
public void onStartTrackingTouch(SeekBar seekBar) {
originalProgress = seekBar.getProgress();
}
#Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
I have following code, which make scroll to specific child. It works fine except when scroll to the last child. It works OK but it's not my expect behavior.The PROBLEM is when scroll to last child, I want the child to show on the top of viewport just like other ones. Some diagrams should help this a little better than words ever could.
Summary the issue:
1.when scroll to last child, is it possible to position it at (0,0) in the viewport?
2.I have 6 children, each one has 200 height. The contentHeight is 1200. when the verticalScrollPosition is 0, I invoke the viewport.getVerticalScrollPositionDelta(NavigationUnit.END), the returned value
is 900. So how the 900 is calculated?
following is the code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="init()"
>
<fx:Script>
<![CDATA[
import components.MockUI;
import mx.collections.ArrayList;
import spark.core.NavigationUnit;
private function init():void {
createElements();
}
private function createElements():void {
for (var i:int = 0; i<6; i++) {
var ui:MockUI = new MockUI();
ui.text = "I'm " + i + " !";
ui.width = 300;
ui.height = 200;
viewport.addElement(ui);
}
}
//scroll to diffrent child, take attetion to the scrollRect
private function scrollToChild(index:int):void {
var delta:Number = returnSumHeight(index);
viewport.verticalScrollPosition = delta;
var scrollRect:Rectangle = viewport.scrollRect;
trace("viewport contentHeight: ", viewport.contentHeight);
trace("vp: ", viewport.verticalScrollPosition);
trace("scrollRect: ", scrollRect);
}
private function handleScroll(unit:uint):void {
trace("unit: ", unit);
var delta:Number = viewport.getVerticalScrollPositionDelta(unit);
trace("delta:", delta);
}
private function minus():void {
viewport.verticalScrollPosition -= 10;
trace("vp: ", viewport.verticalScrollPosition);
}
//return the sum height of children before index item
private function returnSumHeight(index:int):Number {
var sumHeight:Number = 0;
for(var i:int=0; i<index; i++) {
sumHeight += viewport.getElementAt(i).height;
}
return sumHeight;
}
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout horizontalAlign="center" paddingTop="100"/>
</s:layout>
<s:HGroup>
<s:Label text="Select Child: "/>
<s:ComboBox id="comboBox"
dataProvider="{new ArrayList([0,1,2,3,4,5])}"
selectedIndex="0"
change="scrollToChild(comboBox.selectedIndex)"/>
</s:HGroup>
<s:Scroller>
<s:VGroup id="viewport" width="350" height="300" gap="0">
</s:VGroup>
</s:Scroller>
<s:Button label="MINUS" click="minus()"/>
<s:Button label="UP" click="handleScroll(NavigationUnit.UP)"/>
<s:Button label="DOWN" click="handleScroll(NavigationUnit.DOWN)"/>
<s:Button label="HOME" click="handleScroll(NavigationUnit.HOME)"/>
<s:Button label="END" click="handleScroll(NavigationUnit.END)"/>
</s:Application>
MOCKUI:
package components {
public class MockUI extends UIComponent {
private var label:Label;
private var _text:String;
private var textChanged:Boolean = false;
public function set text(value:String):void {
if(value == _text) {
return;
}
_text = value;
textChanged = true;
invalidateProperties();
}
public function get text():String {
return _text;
}
override protected function createChildren():void {
super.createChildren();
label = new Label();
addChild(label);
}
override protected function commitProperties():void {
super.commitProperties();
if(textChanged) {
textChanged = false;
label.text = _text;
}
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
label.width = unscaledWidth/2.0;
label.height = unscaledHeight/2.0;
label.x = unscaledWidth/2.0;
label.y = unscaledHeight/2.0;
graphics.clear();
graphics.lineStyle(2, 0xffff00);
graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
graphics.beginFill(0xff0000, 1);
graphics.drawRect(0,0,unscaledWidth, unscaledHeight);
graphics.endFill();
}
}
}
When scrolling to last child, is it possible to position it at (0,0) in the viewport?
No, it's not possible with the default code in the Flex SDK and due to the size of your viewport/elements. The only way to make that happen with the default code is to make your viewport the same size as one item (and all items have the same height).
The Scroller won't allow you to scroll past the end of the content (except as an effect in mobile apps). You could extend the Scroller class to allow this.
I have 6 children, each one has 200 height. The contentHeight is 1200. when the verticalScrollPosition is 0, I invoke the viewport.getVerticalScrollPositionDelta(NavigationUnit.END), the returned value is 900. So how the 900 is calculated?
The height of each child is 200, but the height of the container they are in is 300 pixels. Because the scroller won't allow you to scroll past the end of the content, it restricts the max value of scroll position to: contentHeight - viewportHeight (1200 - 300 = 900).
Think of the viewport as something that moves (in this case) vertically over the content. The content is 1200 pixels tall, but since the viewport is 300 pixels, we never need to set the viewport's Y position above 900 pixels to see the end of the content.
I need to remove the image from the stage whenever I drag and drop "into" the trash can. I have been looking at this forever and really cant seem to find a solution.
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.controls.Image;
//array of movies
public var myArray:Array = ["batman.jpg","cabin.jpg","christmasVacation.jpg"];
//init function
public function init():void{
var trashImage:Image = new Image();
//set trash img
trashImage.source = "asset/trash.jpg";
//adds img to stage
trashGrp.addElement(trashImage);
//loops 4 times
for(var i:Number = 0; i < myArray.length; i++){
var arrayEntry:String = myArray[i];
//makes new image
var newImage:Image = new Image();
//sets the image source for each image
newImage.source = "asset/" + arrayEntry;
//adds the image to the stage
grpMovies.addElement(newImage);
//set drag/drop
newImage.addEventListener(MouseEvent.MOUSE_DOWN, dragMe);
newImage.addEventListener(MouseEvent.MOUSE_UP, dropMe);
}
}
//dragMe function
public function dragMe(e:MouseEvent):void
{
// Get the Image that saw the mouse-down.
var img:Image = Image(e.currentTarget);
// Use the built-in method to start dragging.
img.startDrag();
}
//dropMe function
public function dropMe(e:MouseEvent):void
{
// Get the Image that saw the mouse-up.
var img:Image = Image(e.currentTarget);
// Use the built-in method to stop dragging.
img.stopDrag();
-**this is where my issue is. I cant get it to remove it when the image is hit**
if (trashGrp.hitTestObject(img)) {
grpMovies.removeElement(img);
}
}
]]>
</fx:Script>
<s:TileGroup id="grpMovies" columnWidth="225" rowHeight="225" requestedRowCount="1"
paddingTop="20"/>
<s:HGroup id= "trashGrp" x="950" y="20"/>
</s:Application>
Check out the following code, I think it does what you want. I modified the event handler to be attached to the main container, so that it gets triggered properly when you release the mouse button on the trash can.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="init()">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.controls.Image;
//array of movies
public var myArray:Array = ["batman.jpg","cabin.jpg","christmasVacation.jpg"];
private var _draggedImage:Image;
//init function
public function init():void{
var trashImage:Image = new Image();
//set trash img
trashImage.source = "assets/trash.png";
trashImage.mouseEnabled = false;
trashImage.mouseChildren = false;
//adds img to stage
trashGrp.addElement(trashImage);
//loops 4 times
for(var i:Number = 0; i < myArray.length; i++){
var arrayEntry:String = myArray[i];
//makes new image
var newImage:Image = new Image();
//sets the image source for each image
newImage.source = "assets/"+arrayEntry;
//adds the image to the stage
grpMovies.addElement(newImage);
//set drag/drop
newImage.addEventListener(MouseEvent.MOUSE_DOWN, dragMe);
}
}
//dragMe function
public function dragMe(e:MouseEvent):void
{
// Get the Image that saw the mouse-down.
var img:Image = Image(e.currentTarget);
// Use the built-in method to start dragging.
img.startDrag();
_draggedImage = img;
this.addEventListener(MouseEvent.MOUSE_UP, dropMe);
}
//dropMe function
public function dropMe(e:MouseEvent):void
{
_draggedImage.stopDrag();
this.removeEventListener(MouseEvent.MOUSE_UP, dropMe);
if (trashGrp.hitTestObject(_draggedImage)) {
grpMovies.removeElement(_draggedImage);
_draggedImage = null;
}
}
]]>
</fx:Script>
<s:TileGroup id="grpMovies" columnWidth="225" rowHeight="225" requestedRowCount="1"
paddingTop="20"/>
<s:HGroup id= "trashGrp" x="950" y="20"/>
</s:Application>
How do I specify what a TextInput looks like in the error state? There appears to be a real scarcity of documentation on the subject!
There isn't an error state, but there is an errorSkin which you can specify (does it have to be a subclass of ErrorSkin?).
I want to set the TextInput's background color and increase the thickness of the border when validation fails. How do I do this?
Here's what I ended up with:
public class ObviousErrorSkin extends ErrorSkin
{
private static var glowFilter:GlowFilter = new GlowFilter(0xFF0000, 0.85, 8, 8, 3, 1, true, true);
private static var rect:Rectangle = new Rectangle();
private static var filterPt:Point = new Point();
override protected function processBitmap():void
{
rect.x = rect.y = 0;
rect.width = bitmap.bitmapData.width;
rect.height = bitmap.bitmapData.height;
glowFilter.color = target.getStyle("errorColor");
bitmap.bitmapData.applyFilter(bitmap.bitmapData, rect, filterPt, glowFilter);
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
// Early exit if we don't have a target object
if (!target)
return;
super.updateDisplayList(unscaledWidth, unscaledHeight);
graphics.clear();
graphics.beginFill(target.getStyle("errorColor"), 0.25);
graphics.drawRect(bitmap.x, bitmap.y, bitmap.width, bitmap.height);
graphics.endFill();
}
}
you should use errorString property to activate error state
Flex, any way to programmatically highlight a field in red the way the validators do?
have a look on this answer, I think it will help you to understand
As far as I know, there's no easy way to achieve this. The problem is that in error state component doesn't change it's own skin, it's just adds instance of errorSkin as new child. Here's code from SkinnableComponent
mx_internal function updateErrorSkin():void
{
if (errorString != null && errorString != "" && getStyle("showErrorSkin"))
{
if (!errorObj)
{
var errorObjClass:Class = getStyle("errorSkin");
if (errorObjClass)
errorObj = new errorObjClass();
if (errorObj)
{
if ("target" in errorObj)
errorObj["target"] = this;
super.addChild(errorObj);
}
}
}
else
{
if (errorObj)
super.removeChild(errorObj);
errorObj = null;
}
}
If you are adding errorSkin and extend it from SparkSkin it will have zero sizes. Of course you can set its width and height properties to parent component, but then it will overlap this parent component.
Mostly the same thing will happen if you are using skin inherited from ErrorSkin. But you need to do something with it's bitmap property. And still it will be over your main component. Yes, you can interchange error skin and main skin then make main skin transparent and maybe achieve what you need, but I advice to create your own component kinda like this:
TextInputWithError.as
package
{
import spark.components.TextInput;
[SkinState("error")]
public class TextInputWithError extends TextInput
{
public function TextInputWithError()
{
super();
}
protected var useErrorSkin:Boolean;
override public function set errorString(value:String):void
{
super.errorString = value;
setStyle("errorSkin", null);
if (value != "")
useErrorSkin = true;
else
useErrorSkin = false;
invalidateProperties();
}
override protected function commitProperties():void
{
super.commitProperties();
if (useErrorSkin != "")
skin.currentState = "error";
else
skin.currentState = getCurrentSkinState();
}
}
}
TextInputWithErrorSkin.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
alpha.disabledStates="0.5" blendMode="normal">
<fx:Metadata>
<![CDATA[
/**
* #copy spark.skins.spark.ApplicationSkin#hostComponent
*/
[HostComponent("TextInputWithError")]
]]>
</fx:Metadata>
<s:states>
<s:State name="normal"/>
<s:State name="error"/>
<s:State name="disabled" stateGroups="disabledStates"/>
<s:State name="normalWithPrompt"/>
<s:State name="disabledWithPrompt" stateGroups="disabledStates"/>
</s:states>
<s:Rect id="background" left="1" right="1" top="1" bottom="1">
<s:fill>
<s:SolidColor id="bgFill" color="0xFFFFFF" color.error="0x00FF00" />
</s:fill>
</s:Rect>
<s:Rect left="0" right="0" top="0" bottom="0" id="border">
<s:stroke>
<s:SolidColorStroke id="borderStroke" weight="1" weight.error="2" color.error="0xFF0000" />
</s:stroke>
</s:Rect>
<s:Rect left="1" top="1" right="1" height="1" id="shadow">
<s:fill>
<s:SolidColor color="0x000000" alpha="0.12" />
</s:fill>
</s:Rect>
<s:RichEditableText id="textDisplay"
verticalAlign="middle"
widthInChars="10"
left="1" right="1" top="1" bottom="1" />
<s:Label id="promptDisplay" maxDisplayedLines="1"
verticalAlign="middle"
mouseEnabled="false" mouseChildren="false"
includeIn="normalWithPrompt,disabledWithPrompt"
includeInLayout="false"
/>
</s:SparkSkin>
And I will appreciate if someone will guide me to better solution of this problem, because I have it too =)
We are building a visual learning program and need to display the "question content" with highlights. We were considering using blinking text, primitives and images.
We don't want to use timer, given that it leads to a load of pain when there are other timer-driven animation on screen.
Any thoughts on how to achieve this?
Hello :]
One way to achieve the blinking effect is to create a glow filter and then animate it's alpha property.
Then set the effect to the label you want.
If you want the whole text blinking, then just animate the alpha property of the text. Here is some
example code:
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:GlowFilter id="myGlowFilter"
color="#00FFAA"
blurX="5"
blurY="5"
quality="8"
/>
<s:AnimateFilter id="myGlowEffect"
bitmapFilter="{myGlowFilter}"
repeatCount="0"
repeatBehavior="reverse"
duration="1000"
>
<s:motionPaths>
<s:SimpleMotionPath property="alpha"
valueFrom="0"
valueTo="1"
/>
</s:motionPaths>
</s:AnimateFilter>
<s:Animate id="myBlinkingEffect"
repeatCount="0"
repeatBehavior="reverse"
target="{backgroundColorOfRect}"
duration="1000"
>
<s:motionPaths>
<s:SimpleMotionPath property="alpha"
valueFrom="1"
valueTo="0"
/>
</s:motionPaths>
</s:Animate>
</fx:Declarations>
<s:layout>
<s:VerticalLayout />
</s:layout>
<s:Label text="How fast can a dragonfly fly?"
creationCompleteEffect="{myGlowEffect}"
fontSize="24"
buttonMode="true"
click="myFadeEffect.play()"
/>
<s:Rect width="200" height="200">
<s:fill>
<s:SolidColor id="backgroundColorOfRect" color="red" />
</s:fill>
</s:Rect>
I suppose you should create a set of components with blinking ability and use them across your application. For better results you can use frame based events. For example a code for a blinking label:
package
{
import flash.events.Event;
import spark.components.Label;
[Style(name="numOfFramesPerBlink", inherit="yes", type="uint")]
public class BlinkingLabel extends Label
{
private static const DEFAULT_NUM_OF_FRAMES_PER_BLINK:Number = 10;
private var _explicitVisibility:Boolean = true;
private var blinkingDirty:Boolean;
private var currentBlinkingPhaseFrames:uint;
private var numOfFramesPerBlinkValue:uint = DEFAULT_NUM_OF_FRAMES_PER_BLINK;
override public function get visible():Boolean
{
return _explicitVisibility;
}
override public function set visible(value:Boolean):void
{
super.visible = value;
_explicitVisibility = value;
}
private var _blinking:Boolean;
[Bindable]
public function get blinking():Boolean
{
return _blinking;
}
public function set blinking(value:Boolean):void
{
if (_blinking == value)
return;
_blinking = value;
blinkingDirty = true;
invalidateProperties();
}
override public function styleChanged(styleProp:String):void
{
super.styleChanged(styleProp);
var allStyles:Boolean = styleProp == null || styleProp == "styleName";
if (allStyles || styleProp == "numOfFramesPerBlink")
{
var newNumOfFramesPerBlink:uint = getStyle("numOfFramesPerBlink");
if (newNumOfFramesPerBlink > 0)
numOfFramesPerBlinkValue = newNumOfFramesPerBlink;
else
numOfFramesPerBlinkValue = DEFAULT_NUM_OF_FRAMES_PER_BLINK
}
}
override protected function commitProperties():void
{
super.commitProperties();
if (blinkingDirty)
{
if (_blinking)
{
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
currentBlinkingPhaseFrames = 0;
}
else
{
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
setVisibleState(_explicitVisibility);
}
blinkingDirty = false;
}
}
private function setVisibleState(value:Boolean):void
{
super.visible = value;
}
private function enterFrameHandler(event:Event):void
{
currentBlinkingPhaseFrames++;
if (currentBlinkingPhaseFrames > numOfFramesPerBlinkValue)
{
setVisibleState(!super.visible);
currentBlinkingPhaseFrames = 0;
}
}
}
}
The usage is pretty simple:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:local="*">
<s:layout>
<s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />
</s:layout>
<local:BlinkingLabel text="Test Label" id="blinkingLabel" numOfFramesPerBlink="{framesPerBlinkSlider.value}" />
<s:CheckBox label="Blink Label" selected="#{blinkingLabel.blinking}" />
<s:HSlider minimum="1" maximum="100" value="10" id="framesPerBlinkSlider" />
</s:Application>
Hope this helps!