swf 内部库如下
Chat影片剪辑内有三个组建,TextArea,TextInput,Button,实例名非别是:textAtea,textInput,sendButton
Main.as
package
{
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.display.MovieClip;
import flash.events.Event;
import flash.net.URLRequest;
public class Main extends MovieClip
{
public function Main()
{
var swfLoader:Loader = new Loader();
var urlRequest:URLRequest = new URLRequest("asset.swf");
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete);
swfLoader.load(urlRequest);
}
private function onComplete(e:Event):void{
var l:LoaderInfo = e.target as LoaderInfo;
var Chat:Class = l.applicationDomain.getDefinition("Chat") as Class;
var chat:MovieClip = new Ch