0

I want to play a url using netstream at a particular time like 11.30 PM.

CurrentDateTime = new Date();

CurrentDF = new DateFormatter();

CurrentDF.formatString = "LL:NN:SS A"

DateTime= CurrentDF.format(CurrentDateTime);

if(DateTime=="11:30:00 PM"){

ns.play("rtmp url");

}

The above code will work if exactly the time is "11:30:00 PM" during run my flex application.. But If i run my application before that time, my code should wait for the time to become 11:30:00 PM to play my url..I know one solution for this is setting timer to check this continously...after i can stop this when it become 11:30:00 PM...But Is it any chance for problem to my application since timer trigger continuosly upto the time 11:30:00 PM? Kindly reply..

divya
  • 81
  • 4
  • 13
  • 1
    As far as I am aware, the only possibility is for there to be a timer. I wouldn't do a very fast one as it is not needed. Maybe once every 30-45 seconds would be enough. The overhead on a timer running every 30-45 seconds is so small that it will not affect your application negatively in any way. I know you want it to be exactly 11:30, but to do that you would need to do it once a second and that could potentially impact performance. Really, it's up to you as the developer to decide what is in the best interest of your application here. – Josh Nov 07 '12 at 16:05
  • Thanks ApocalypticOn3 for your valuable comment – divya Nov 08 '12 at 05:43

0 Answers0