MovieClip progress bar width is too small relative to parent container

Posted by egyedg on Stack Overflow See other posts from Stack Overflow or by egyedg
Published on 2010-02-17T08:32:43Z Indexed on 2011/11/20 1:51 UTC
Read the original article Hit count: 141

Filed under:
|

I am new to ActionScripot and Flash and I am stuck with the following problem:

On the stage I have a movieclip (Container, originally 200px width) and inside it with a progressbar movieclip (originally 700px width), scaled with Free Transform Tool to fit the parent container. The width of the container changes run-time while resizing the scene.

In ActionScript I have a function which should set the progress bar width according to a calculated percentage value:

private function updateProgress(event:TimerEvent):void
{
   var barWidth:int = _container.width;
   var progress:Number = _stream.time / _stream.duration * barWidth;
   _progressBar.width = progress;           
}

My problem is that the progressBar even at full time (100%) is only at 1/4 of the parent container. I assume that it comes from the symbols original size.

Can I correct this programatically, or I must redesign it with the "designer"?

I hope I made clear my problem, as I said, I'm new in Flash.

Thanks in advance.

© Stack Overflow or respective owner

Related posts about flash

Related posts about actionscript-3