Please help me understand how correctly to show duration time. I started this player http://www.natavi.co.uk/player/player.html It shows progress of playing position correctly on pc, but online it plays crazy. I saw many examples in net where it shows playing progress correctly even if file is not fully loaded. How? Code:
....... xml.load("audio/songs.xml"); this.onEnterFrame = handleSlides; function playSong(this_cps):Void { cps=this_cps; clearInterval(my_intervalLoad); s.stop(); s = new Sound(); s.onSoundComplete = function() { playSong(++cps); }; if ((cps > sa.length - 1) || (cps <0)) { cps = 0; } s.loadSound(sa[cps].earl, true); s.setVolume(curVolume); s.onLoad = function(success:Boolean) { if (success) { clearInterval(my_intervalLoad); } }; progress_mc._xscale=0; progress_loading_mc._xscale=0; pos=0; isPlaying = true; trackInfo.text = sa[cps].artist + " - " + sa[cps].track; playPause.gotoAndStop("pause"); } function checkProgressLoading(the_sound:Sound):Void { var pct:Number = Math.round(the_sound.getBytesLoaded()/the_sound.getBytesTotal()* 100); progress_loading_mc._xscale = pct; } function handleSlides(){ if (isPlaying) { pos=s.position } progress_mc._xscale = Math.round(100*pos/s.duration); UpdateTextCur(); // it shows s.position UpdateTexLeft(); // it show what left } _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders