setInterval bug identified and fixed 2004-02-23 - By Edward Chan
Back Hello folks,
Just want to let you know that the setInterval bug has been identified and fixed and will be available in the next patch release. The bug only affects a multi-vhost setup.
We are currently writing up a tech note on this and should have that posted in the near future. The work around, until you get the patch, is to do the setInterval from the client.
For example,
Instead of doing this from the server-side script:
function displayDate() { trace(new Date()); }
setInterval(displayDate, 60*1000); // display date & time every minute
You can call the server-side method but on a client side timer. Unfortunately, this means you will need to have a persistent client connection to the app.
For example, in your client-side code:
nc = new NetConnection(); nc.connect("rtmp://host/app");
function callTimer() { nc.call("displayDate", new onDisplayTime()); }
setInterval(callTimer(), 60*1000);
Server-side code:
function displayDate() { trace(new Date()); }
application.onConnect = function(client) { client.displayDate = function() { displayDate(); } }
I haven't actually run this code, so there might be some bugs, but I think you probably get the general idea. Basically, call the method on the server-side that you want to be called on a timer, but do it via a client call where the timer is on the client-side.
Ed
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Supported by Fig Leaf Software -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Lower Prices for Certified Training! Check out new lower prices for Certified Macromedia Training from Fig Leaf Software. Expand your skill set with courses in ColdFusion, Flash, Rich Internet Applications and .NET in the new year. Fig Leaf Software provides the highest caliber instruction at our training centers in Washington D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location.
Get the details at http://training.figleaf.com/ -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: flashcomm-unsubscribe@(protected) For additional commands, e-mail: flashcomm-help@(protected)
|
|