error 2007, load swf with Flash UI component error

TypeError: Error #2007: 參數 child 不能是 Null。
at flash.display::DisplayObjectContainer/addChildAt()
at fl.controls::BaseButton/drawBackground()
at fl.controls::BaseButton/draw()
at fl.core::UIComponent/drawNow()
at fl.controls::ScrollBar/draw()
at fl.controls::UIScrollBar/draw()
at fl.core::UIComponent/drawNow()
at fl.controls::TextArea/updateScrollBars()
at fl.controls::TextArea/drawLayout()
at fl.controls::TextArea/draw()
at fl.core::UIComponent/callLaterDispatcher()

TypeError: Error #2007: 參數 child 不能是 Null。

當你用了 load swf,而咁o岩裡面個 swf 有用到 UI component d 野
(e.g. scrollbar, checkbox 等)
你用 main 個個 swf load 佢,本身都應該相安無事
但你搞下個 fl library,例如玩下 focusManager,又或者 (我估) add 其他 UI component
咁佢就會鬧你 load swf 個個搵唔到適當既 UI component
其實無咩野,出下 error,想解決就係 main library 都加埋 個個 UIcomponent la~

duplicate MC……自己 load 自己


package {
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.utils.ByteArray;

* …
* @author Focus1921
* 複製無綁定類別movie clip場景實體(stage instance)實作demo(fla文件類別)
public class DocTest extends MovieClip {
//stage instance
public var test_box_mc:MovieClip; //場景上僅有的movie clip, 實體名稱test_box_mc

private var ba:ByteArray; //儲存自己這個swf的byte array
private var ldr:Loader; //建一個loader來load ba
private var tmpX:Number;
private var tmpY:Number;

* 建構式
public function DocTest() {
if (stage) {
}else {
addEventListener(Event.ADDED_TO_STAGE, init);

private function init(e:Event = null):void {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;

if (parent is Stage) {
trace("parent is Stage");
//建構url loader(binary)去load自己的byte array
var _urlLoader:URLLoader = new URLLoader();
_urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
_urlLoader.load(new URLRequest(root.loaderInfo.url));
_urlLoader.addEventListener(Event.COMPLETE, onURLLdrComplete);

//建構loader, 註冊complete完成偵聽
ldr = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, onLdrComplete);

stage.addEventListener(MouseEvent.CLICK, onStageClick);

//—Event Handler—————————————————————————–

private function onURLLdrComplete(e:Event):void {
e.currentTarget.removeEventListener(Event.COMPLETE, onURLLdrComplete);
//把load到的byte array存起來
ba =;

private function onLdrComplete(e:Event):void {
//用實體名稱去抓到要複製的movie clip,每次load完都會傳不同的引用
var _mc:MovieClip = <div style="display: inline; height: auto; position: absolute; visibility: hidden; width: auto; ">MovieClip</div>MovieClip(ldr.content).getChildByName("test_box_mc") as MovieClip;
_mc.x = tmpX;
_mc.y = tmpY;
_mc.alpha = Math.random();

private function onStageClick(e:MouseEvent):void {
tmpX = e.stageX;
tmpY = e.stageY;
//loader去load(loadBytes)存起來的byte array(ba)



Hack Flash Projector to change some value (e.g. title name)

Player without minimize, maximize and close buttons when not full screen:

Using third party projector tools such as mProjector, Zinc, SWF Studio or Screenweaver. Flash alone cannot do that.

Another way to hide the minimize, maximize and close buttons (and also, if you want, to modify/remove others menus, dialog windows etc.), but only applicable at a projector file, is to use a resource editor program, also called ‘hacking’ program. With such programs (for example: ‘XN Resource Editor’, ‘Resource Hacker’), you can usually ‘hack’ Win32 PE files (modules); that is why you will be able to edit only the projector file.

Using swc rather than Embed tag


What is Flex Assets?

When using [Embed] to store some bitmap, it will extends BitmapAssets, etc……….

so somethime may not want to use Embed tag, then u can import the Asset class inside and extends by yrself!