Then setup a text area with in that movieclip and your batch of time line controls as well.
It really wouldn't be much more code than what you already have.
Also, the Loader class is a bit of a pain and should have been rewritten years ago. After 3 tries to load a swf or jpg it will say COMPLETE even if the movie has not loaded yet.
I ended up writing my own loader class as a result. Most of the code is based on the original Loader class but forces the loader to actually load the swf or image before firing an event.COMPLETE.
-Jake
__________________________________________________________
Jacob A. Berendes | Web Design / Development Specialist | Artropolis, Inc.
8401 Wayzata Boulevard, Suite 310 | Golden Valley, MN 55426
952-545-8488 x 103 | fax 952-545-8516 | http://www.artropolis.com
Jacob A. Berendes | Web Design / Development Specialist | Artropolis, Inc.
8401 Wayzata Boulevard, Suite 310 | Golden Valley, MN 55426
952-545-8488 x 103 | fax 952-545-8516 | http://www.artropolis.com
Robert Fraher wrote:
Darn!
I actually took extra care formatting this for email. Attached is an RTF doc with the cleaned-up code.
On Aug 26, 2008, at 9:14 AM, Robert Fraher wrote:
Hi, Robert -
I've had good luck working with the structure outlined below:
var _contentHolder:MovieClip = new MovieClip();var _externalSWF: Object = new Object();function loadAsset(assetURL, onAssetLoad) :void {//var assetLoader: Loader=new Loader;var request:URLRequest= new URLRequest(assetURL );//assetLoader. load(request) ;assetLoader. contentLoaderInf o.addEventListen er(Event. COMPLETE, onAssetLoad) ;}
function initializeContentHolder(event: Event):void {//var loaderInfo:LoaderIn fo = event.target as LoaderInfo;_contentHolder. addChild( event.target. content);_externalSWF = loaderInfo.content;}loadAsset("external SWF.swf", initializeContentHo lder);
Using this approach, I target _contentHolder for any display activity (scale, rotation, etc.), and _externalSWF for any data (variables, MCs, etc.).
I hope this helps.
Bert
On Aug 25, 2008, at 11:56 PM, comeexplorecanada wrote:
Hi,
I am trying to add a TextField to a load external swf. Does anyone
know how to do this in AS3? Here is what I have tried (of course it
doesn't work):
private function addPage():void {
var request:URLRequest = new URLRequest("page1.swf" );
var loader:Loader = new Loader();
loader.load(request);
addChild(loader);
var txt_0:TextField = new TextField();
txt_0.text = "Sample Text";
loader.addChild(txt_0);
}
Also in the future I would like to control the timeline of an loaded
external swf. Anyone know what it takes to be able to do this?
Robert S.
Robert FraherCandidate for M.F.A. in Interactive DesignUniversity of Minnesota
Robert FraherCandidate for M.F.A. in Interactive DesignUniversity of Minnesota