Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The debugger sorts lists of items in an associative array lexicographically for you (ordered numerically and alphabetically) to make it easier to find what you're looking for. The list in your example is sorted this way. It's a coincidence that you added items to the associative array in the same order.</p> <p>There is no way for you to discover the order in which you add items to an associative array without creating additional metadata. If you need such behavior try creating a custom class for this.</p> <p>Here's an example:</p> <pre><code>import flash.utils.Dictionary; import flash.utils.Proxy; import flash.utils.flash_proxy; dynamic class OrderedAssoArray extends Proxy{ private var _items:Dictionary = new Dictionary(); private var _idx:Array = new Array(); use namespace flash_proxy override flash_proxy function setProperty(name:*, value:*):void { _items[name] = value; _idx.push(name); } override flash_proxy function getProperty(name:*) : *{ return _items[name]; } override flash_proxy function nextNameIndex (index:int):int { return index &lt; _idx.length ? index + 1 : 0; } override flash_proxy function nextName(index:int):String { return _idx[index-1]; } override flash_proxy function nextValue(index:int):* { return _items[_idx[index -1]]; } } </code></pre> <p>With the above you can do something like this:</p> <pre><code> var assoArray:Object = new OrderedAssoArray(); assoArray["key_one"] = "value_one" assoArray["key_two"] = "value_two" assoArray["key_three"] = "value_three" assoArray["key_four"] = "value_four" for each(var item:String in assoArray){ trace(item) } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload