padone

09-12-2005, 09:09 AM

please help

--------------------------------------------------------------------------------

i really need an experts help on this one... i know its possible and even have came up with a formula but i realy need an experts help to get it into actionscript and working. I have a mp3 player which loads external mp3's. it also has a slider bar so that you can select a certain time in the mp3.

now this all is fine but i would like to be able to get the time from your local machine and then do a mathmatic equation to determine what percentage of the mp3 should be playing for example...

if it was 14:22:33pm then it needs to do something like this

now = new Date();

trace(now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds());

if (now.getHours() = 02 && now.getHours() =04 && now.getHours() =06 && now.getHours() =08 && now.getHours() =10 && now.getHours() =12 && now.getHours() =14 && now.getHours() =16 && now.getHours() =18 && now.getHours() =20 && now.getHours() =22 && now.getHours() =24)

{

trkperc = 0;

}

else if (now.getHours() = 01 && now.getHours() = 03 && now.getHours() = 05 && now.getHours() = 07 && now.getHours() = 09 && now.getHours() = 11 && now.getHours() = 13 && now.getHours() = 15 && now.getHours() = 17 && now.getHours() = 19 && now.getHours() = 21 && now.getHours() = 23)

{

trkperc = 50;

}

this._parent.track_play.onEnterFrame = function() {

perc = (trkperc)+(now.getMinutes/1.2)+(now.getSecondsx0.014);

thus playing the percent of the mp3 that it equals to in this case it would be

19%

--------------------------------------------------------------------------------

i really need an experts help on this one... i know its possible and even have came up with a formula but i realy need an experts help to get it into actionscript and working. I have a mp3 player which loads external mp3's. it also has a slider bar so that you can select a certain time in the mp3.

now this all is fine but i would like to be able to get the time from your local machine and then do a mathmatic equation to determine what percentage of the mp3 should be playing for example...

if it was 14:22:33pm then it needs to do something like this

now = new Date();

trace(now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds());

if (now.getHours() = 02 && now.getHours() =04 && now.getHours() =06 && now.getHours() =08 && now.getHours() =10 && now.getHours() =12 && now.getHours() =14 && now.getHours() =16 && now.getHours() =18 && now.getHours() =20 && now.getHours() =22 && now.getHours() =24)

{

trkperc = 0;

}

else if (now.getHours() = 01 && now.getHours() = 03 && now.getHours() = 05 && now.getHours() = 07 && now.getHours() = 09 && now.getHours() = 11 && now.getHours() = 13 && now.getHours() = 15 && now.getHours() = 17 && now.getHours() = 19 && now.getHours() = 21 && now.getHours() = 23)

{

trkperc = 50;

}

this._parent.track_play.onEnterFrame = function() {

perc = (trkperc)+(now.getMinutes/1.2)+(now.getSecondsx0.014);

thus playing the percent of the mp3 that it equals to in this case it would be

19%