views:

83

answers:

2

I am trying to use the ProgressBar Flex component inside a custom Actionscript 3.0 component derived from the UIComponent class. I have set the minimum and maximum values etc.

_progressBar = new ProgressBar();               
_progressBar.label = "Loading";
_progressBar.minimum = 0;
_progressBar.maximum = 100;
_progressBar.direction = ProgressBarDirection.RIGHT;
_progressBar.mode = ProgressBarMode.MANUAL;

The component shows the "Loading" text but not the loading bar.

Anything like _progressBar.setProgress(20, 100) does not have any effect on the code. Any ideas why this is not working?

A: 

There is no problem with the current code you have provided (it works fine in an individual instance). Perhaps the problem lies in your custom AS3.0 component, but without further information it's not possible to assist you.

MasterOfObvious
A: 

The problem is that I was adding the component to a UIComponent. Flex components need to be added to something derived from a container like a Canvas. I could not get buttons to display in my custom component derived from UIComponent. Changing it to Canvas fixed the issue. Hope this helps someone.

Abhinav