I have created a custom progressBar by extending from flex’s progressBar. I want to insert an gif image in the custom progressBar by using flex’s Image but nothing happen.
Do i need to implement any flex interface? Please advice.
Thank you
package com
{
import mx.controls.Image;
import mx.controls.Label;
import mx.controls.ProgressBar;
import mx.core.mx_internal;
use namespace mx_internal;
public class CustomProgressBar extends ProgressBar
{
[Embed("resource/images/running_animated_gif.gif")]
[Bindable]
public var runningGif:Class;
public function CustomProgressBar()
{
super();
}
override protected function createChildren():void
{
super.createChildren();
var gifImage:Image = new Image();
gifImage.source = runningGif
addChild(gifImage);
}
}
}
There are skin properties for ProgressBar. You can apply your custom skin component to it.
Below example may help you to add skin to your custom progressbar class.
class Name: – CustomProgressBar.as
In your skinclass you can add image which will get displayed on your progress bar.
CustomProgressBarTrackSkin.mxml
In the same way you can create different class for different skins ex. barSkin etc…
this may help you…