Actually Lost, ASNative() is not Math.Random.
ASNative() is available in Flash 5, but may not exist in future versions.
In general, ASNative (i, j) returns a function reference. It’s like all the Flash functions are stored in a spreadsheet, and you can access them by rows and columns with ASNative. A convenient way to work with ASNative functions is to assign the result to a variable, and then execute the variable as a function.
Example:
t = ASnative(100, 4); // trace function
t(“hi”); // output: hi
Some other math commands using ASNative:
ASnative(200, 0 ) // [[Math] abs
ASnative(200, 1) // [[Math] min
ASnative(200, 2) // [[Math] max
ASnative(200, 3) // [[Math] sin
ASnative(200, 4) // [[Math] cos
ASnative(200, 5) // [[Math] atan2
ASnative(200, 6) // [[Math] tan
ASnative(200, 7) // [[Math] exp
ASnative(200, 8) // [[Math] log
ASnative(200, 9) // [[Math] sqrt
ASnative(200, 10 ) // [[Math] round
ASnative(200, 11) // [[Math] random
ASnative(200, 12) // [[Math] floor
ASnative(200, 13) // [[Math] ceil
ASnative(200, 14) // [[Math] atan
ASnative(200, 15) // [[Math] asin
ASnative(200, 16) // [[Math] acos
ASnative(200, 17) // [[Math] pow
The reason why ASNative is used because it’s much faster than the direct commands. Also, Flash AS for end users isn’t as powerful as we’d like it to be.
Dravos actually used ASnative(800, 2) // [[Key] isDown, but as the quote says, ASNative may not exist in future versions.
h88 