Created
December 1, 2010 20:55
-
-
Save joelklabo/724203 to your computer and use it in GitHub Desktop.
actionscript example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var genExtFunc:Function = function (func:Function):Function { | |
return function (...args):* { /// <----- this is the "...args" i am curious about | |
try { | |
for (var arg:* in args){ | |
// Terrible hack working around half baked | |
// ExternalInterface support provided by | |
// Safari on Windows | |
// takes json strings and turns them into objects | |
if (args[arg] is String){ | |
var o : Object = JSON.decode(args[arg]); | |
args[arg] = o; | |
} | |
} | |
return func.apply(null, args); | |
} | |
catch (e:Error) { | |
if (e.errorID == 1009){ | |
e.message = "There was a problem with your parameters, " + JSON.encode(args); | |
} | |
return e; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment