I’ve got a function that passes in an object with about 30 properties.
The properties are entitled room0spot0, room0spot1, room0spot2, room1spot0, etc
I’d like to use a for loop to read these 30 properties into an array that would equivalently do:
room[0][0] = o.room0spot0
How can I accomplish this?
I tried doing this:
public function onReceiveRoomData(o:Object):void {
for(var i=0;i<10;i++) {
room*[0] = this["o.room"+i+"spot0"];
room*[1] = this["o.room"+i+"spot1"];
room*[2] = this["o.room"+i+"spot2"];
}
}
but it doesn’t seem to find the property of the object passed.
Is there something I’m missing?