On Thu, Dec 18, 2008 at 11:32 PM, Manish Jethani
<[email protected]> wrote:
> On Thu, Dec 18, 2008 at 10:56 PM, lorenzo.boaro <[email protected]> wrote:
>
>> when i try to rint the object fields are not in the correct order...
>> tuesday 45
>> production test
>> monday 23
>
> The order cannot be guaranteed in a for loop. You can instead store
> the fields as an array of name-value pairs and iterate over them as an
> array.
>
>  for each (var f:Object in obj.fields) /* obj.fields is Array */
>    trace(f.name + ": " + f.value);

You can also create a custom Proxy subclass that guarantees the order.
You'd override the setProperty and nextName methods for that. See the
flash.utils.Proxy class

Manish

Reply via email to