Skip to content

Instantly share code, notes, and snippets.

@develar
Created October 27, 2011 16:49
Show Gist options
  • Save develar/1320107 to your computer and use it in GitHub Desktop.
Save develar/1320107 to your computer and use it in GitHub Desktop.
package com.intellij.flex.uiDesigner.test {
import flash.display.DisplayObject;
import flash.display.Sprite;
[DefaultProperty("mxmlContent")]
public class FlashContainer extends Sprite {
private var _mxmlContent:Vector.<DisplayObject>;
public function set mxmlContent(value:Vector.<DisplayObject>):void {
if (value == _mxmlContent) {
return;
}
if (_mxmlContent != null) {
for each (var child:DisplayObject in _mxmlContent) {
removeChild(child);
}
}
_mxmlContent = value;
if (_mxmlContent != null) {
createChildren();
}
}
protected function createChildren():void {
for each (var child:DisplayObject in _mxmlContent) {
addChild(child);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment