source: audio-player/trunk/source/classes/Loading.as @ 348

Revision 50, 497 bytes checked in by doryphores, 15 years ago (diff)

Maintenance

Line 
1class Loading extends MovieClip
2{
3        public var bar_mc:MovieClip;
4        public var track_mc:MovieClip;
5       
6        /**
7         * Constructor
8         */
9        function Loading()
10        {
11                this.bar_mc._width = 0;
12        }
13       
14        public function update(loaded:Number):Void
15        {
16                this.bar_mc._width = Math.round(loaded * this.track_mc._width);
17        }
18
19        public function resize(newWidth:Number):Void
20        {
21                var change:Number = newWidth / this.track_mc._width;
22                this.track_mc._width = newWidth;
23                this.bar_mc._width *= change;
24        }
25}
Note: See TracBrowser for help on using the repository browser.