开发者

Problem in setting initial position using SharedObject

I have created a simple audio player to play continuously even if the page is refresh it will play continuously.

This is my code to sto开发者_StackOverflow社区re audio position in flash Temp memory

MySharedObject.data.audioPos = mySndChannel.position;
MySharedObject.flush();

MyProblem When the player starts the sndPosition is null, so it was not playing. If I set some value, when I am refreshing it will not continue from the last position. How can I set the initial position to play from the start?


MySharedObject.data.audioPos = mySNDChannel.position ? mySNDChannel.position : 0;

If mySNDChannel.position == null, this will set audioPos to 0. If it's not null, it will assign it to audioPos.

I haven't done anything like this, but this solution makes sense in my mind. If this isn't acceptable/correct, let me know and I'll look into the flash temp memory a bit deeper.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜