Create another container to place the displayObject in:

http://stackoverflow.com/questions/2023632/adobe-flash-builder-flex4-addchild-is-not-available-in-this-class?answertab=active#tab-top

http://forums.adobe.com/thread/528185

http://blog.csdn.net/yinweilaibuji/article/details/7696588

Create another container to place the displayObject in:

// container ( IVisualElement ) for DisplayObjects
var container:UIComponent = new UIComponent();
addElement( container );

// displayObject goes to container
var displayO:Sprite = new Sprite();
container.addChild( displayO );

private var _loader:SWFLoader = new SWFLoader();
private var _uicomponent:UIComponent = new UIComponent();
private function swfLoaded(event:Event):void 
{
Alert.show("inside swf Loaded");
var content:DisplayObject =_loader.content;
_uicomponent.addChild(content);
} 
public function loadSWF () : void 
{   

_loader.addEventListener(Event.INIT, swfLoaded);
_loader.load("http://intelliveysoft.com:5080/myelearn/Admin.swf"); 
addElement(_uicomponent);
}

well in flash builder 4 full version, there isn't any this.rawChildren.

The best approach to resolve the issue would be to convert each required class to a flex component and to use it on your flex application:

  1. download and install flex component kit http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex_skins

  2. create a movie clip

  3. convert to flex component

  4. add the relevant functions to this class

a skeleton for a class that is attached to a movieclip that is about to be converted to a flex component:

package {
import mx.flash.UIMovieClip;
import flash.text.TextField;
import flash.events.Event;
import flash.events.MouseEvent;
public dynamic class challenge_screen extends UIMovieClip {

    public function challenge_screen() {
        super();
    }
}
} 
<?xml version="1.0" encoding="utf-8"?><s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"               xmlns:s="library://ns.adobe.com/flex/spark"               xmlns:mx="library://ns.adobe.com/flex/halo"               initialize="init();">    <fx:Script>        <![CDATA[            private const spr1:Sprite = new Sprite();            private const spr2:Sprite = new Sprite();            private function init():void {                spr1.graphics.beginFill(0xFF0000, 0.5);                spr1.graphics.drawRect(10, 10, 100, 80);                spr1.graphics.endFill();                con.addChild(spr1);                spr2.graphics.beginFill(0x0000FF, 0.3);                spr2.graphics.drawRect(20, 20, 80, 100);                spr2.graphics.endFill();                con.addChild(spr2);            }        ]]>    </fx:Script>    <s:SpriteVisualElement id="con" /></s:Application>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值