Patch submisison to reslove a bug in ProgressBar

3 views
Skip to first unread message

Jerome

unread,
Feb 16, 2011, 11:11:52 AM2/16/11
to MinimalComps
Hello,

There is 2 minor bugs in ProgressBar. You can test it with this little
code :

var pb:ProgressBar = new ProgressBar(this, 20, 20);
pb.maximum = -10;
pb.value = .5;

var pb2:ProgressBar = new ProgressBar(this, 20, 40);
pb2.value = -10;

//

To resolve it you can patch this 2 methods :
file : ProgressBar.as

public function set maximum(m:Number):void
{
_max = Math.max(m, 0);
_value = Math.min(_value, _max);
update();
}


public function set value(v:Number):void
{
_value = Math.max(Math.min(v, _max), 0);
update();
}

Thanks :)
J.
Reply all
Reply to author
Forward
0 new messages