Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Music.start() question thanks.

Status
Not open for further replies.

melnet

Programmer
Jul 8, 2003
77
HK
Hi

Play music button:
if (_parent.PauseMusicTime == 0) {
_parent.Music.start();
} else {
_parent.Music.start(_parent.PauseMusicTime, 1);
}
_parent.startMusicTime = getTimer();
_parent.PauseMusicTime = 0; //when typing pause button, it will store the time
_parent.Paused = false; //when typing pause button, it will store true
_parent.Playing = true; //when typing play button, it will store true
trace("_parent.startMusicTime " + _parent.startMusicTime);
trace("_parent.PauseMusicTime " +_parent.PauseMusicTime);

pause music button:
_parent.Music.stop();
_parent.PauseMusicTime = (getTimer()-_parent.StartMusicTime)/1000;
_parent.Paused = true;
_parent.Playing = false;
trace("getTimer() "+ getTimer());
trace("_parent.pauseMusicTime "+_parent.PauseMusicTime

OUTPUT:
_parent.startMusicTime 695
_parent.PauseMusicTime 0
getTimer() 2072
_parent.pauseMusicTime 1.377
_parent.startMusicTime 4577
_parent.PauseMusicTime 0
getTimer() 7250
_parent.pauseMusicTime 2.673
_parent.startMusicTime 10118
_parent.PauseMusicTime 0
getTimer() 12496
_parent.pauseMusicTime 2.378

Question;
i type the pause button in first time, the time is 1.377
i type the pause button in second time, the time is 2.673
i type the pause button in third time, the time is 2.378
why the second and third time are just 2.673 and 2.378?
it should be 2.673+1.377 in second time?
why it will detect to play from 4.050 in second time?the third time is also.

Thanks for help...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top