From 990d0b840f955b1c947cd4acaf0556df46a74657 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 22 Feb 2006 14:02:42 +0000 Subject: [PATCH] Added another note about a 'gotcha' in actionscript. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3879 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/README.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/as/com/threerings/README.txt b/src/as/com/threerings/README.txt index d1a214b9b..2b9c71b21 100644 --- a/src/as/com/threerings/README.txt +++ b/src/as/com/threerings/README.txt @@ -103,3 +103,11 @@ Actionscript SO: if you want a method to be accessable to a subclass in a different package, it must be public! + +- Beware of integer math: + + var i :int = 3; + var o :Object = someArray[i / 2]; + // o is now undefined, because we accessed array element "1.5". + // I think arrays are just hashes, so probably you could store + // values at element 1.5 if you desired...