-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInfoPanel.as
More file actions
27 lines (22 loc) · 766 Bytes
/
InfoPanel.as
File metadata and controls
27 lines (22 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package {
import InfoField;
import flash.events.ActivityEvent;
import flash.display.Sprite;
public class InfoPanel extends Sprite {
public var fields:Object;
/**
* Given an object, creates dynamic label/value textfields for object properties
*/
public function InfoPanel( fieldArray ) {
var i, field, prev;
fields = [];
for ( i = 0; i < fieldArray.length; i++ ) {
field = fieldArray[i];
prev = fieldArray[i-1] || 0;
fields[field] = new InfoField( field );
fields[field].y = ( i === 0 ) ? 0 : fields[prev].y + fields[prev].height;
addChild(fields[field]);
}
}
}
}