Change this:
var my_timedFunction:uint = setTimeout(manipulateMap,500,aVars);

to this:
var my_timedFunction:uint = setTimeout(manipulateMap, 500, lat, lng, zoom);

You don't pass the arguments as an array, you pass them as individual
arguments.


On 12/27/06, jensen.axel <[EMAIL PROTECTED]> wrote:

  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




--

Derek Vadneau

Reply via email to