开发者

Multiple preloaders in the same container

开发者 https://www.devze.com 2023-03-19 03:59 出处:网络
I\'m having a strange preloader problem. I have 2 preloaders inside a canvas. One is to display the progress of a track downloading and the other is to display the position of playback of the track. I

I'm having a strange preloader problem. I have 2 preloaders inside a canvas. One is to display the progress of a track downloading and the other is to display the position of playback of the track. It seems only one of them will work at a time.

For example if I set the second preloaders visibility to false then the first preloaders setProgress function works fine. If I however set the second preloaders visibility to true then the setprogress of the first preloader does not seem to work.

Are you only allowed one preloader per canvas?

<mx:ProgressBar id="downloadprogress"
                    mode="manual"
 开发者_开发知识库                   minimum="0"
                    maximum="100"
                    styleName="trackloadprogress" label=""/>
    <mx:ProgressBar id="playbackprogress"
                    mode="manual"
                    minimum="0"
                    maximum="100"
                    label=""
                    styleName="trackplaybackprogress"/>


Ok this was really dumb. Of course I couldnt see preloader 1 if preloader 2 was on top of it. To solve I added a mask to preloader 2 and made it's width the same as the maximum width * progress.

0

精彩评论

暂无评论...
验证码 换一张
取 消