The docs advise using Timer instead.

 

If you are trying to use this to wait for the result of an external data
call, you are making a mistake.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of jensen.axel
Sent: Wednesday, December 27, 2006 5:40 PM
To: [email protected]
Subject: [flexcoders] setTimeout in flex 2.0

 

I'm confused on how to use setTimeout

i have a function that i need to wait 500 milliseconds to call... 

var aVars:Array = [lat, lng, zoom];
trace(aVars); //39,-105,6
var my_timedFunction:uint = setTimeout(manipulateMap,500,aVars);

public function manipulateMap(lat:Number,lng:Number,zoom:Number):void{
u = new URLRequest("javascript:map.setCenter(new GLatLng(" + lat + ','
+ lng + '),' + zoom +")");
navigateToURL(u,"_self");
}

this makes everything come to a screeching hault, and it tells me i
have an invalid number of arguments, it wants 3 arguments but says
only one is passed.... 

anyone have an example of passing arguments with setTimeout?

ps... everything works fine if i'm not using setTimeout

IE...........
manipulateMap(lat,lng,zoom);

that works... so i know that my failure is definitely in the way i'm
trying to call setTimeout.... 

the whole reason for doing this is because i'm calling things so fast,
that google maps isn't responding, so this is a workaround....

i've trying to do it with javascript, but the concatenation gets too
crazy, and it takes 45 minutes to add arguments because of the
troubleshooting with javascript, so i'm trying to use the setTimeout
in flex rather that the javascript one.... 

Any help would be great

 

Reply via email to