PDA

View Full Version : Loading An Ext. Swf Into An MC


thumbnailNERD
05-30-2008, 12:01 AM
I think I posted this question in wrong forum. I know its quite simple, but I'm having trouble figuring it out. So any help would be oh so gracious.

I just want my "aboutDesign.swf" file (which has a dynamic text field loading external text) to load into my "container_mc" movieclip on my "design.swf" page. It's been a day and a half, and I've yet to solve this. I know, very stupid! Learning AS 3.0 is humbling, esp. if you hate math!!

Here's my code:
(main timeline/ "design.swf" page)

var myLoader:Loader = new Loader();
addChild(myLoader);

function aboutDesign (event:MouseEvent): void
{
container_mc.myLoader.load(new URLRequest("aboutDesign.swf"));
}


menu_mc.aboutDesign_btn.addEventListener(MouseEven t.CLICK, aboutDesign);

("aboutDesign.swf" page)

var content_req:URLRequest = new URLRequest ("placeholder.txt");
var content_ldr:URLLoader = new URLLoader (content_req);
addChild(design_txt);


content_ldr.addEventListener(Event.COMPLETE, onComplete);


function onComplete(event:Event):void
{
design_txt.text = event.target.data;
}

Any suggestions?:confused:

thumbnailNERD
05-30-2008, 12:12 AM
Okay I figured it out. It was quite simple. It just took me over 24 hours to figure this out!!

I needed to correct this one line:
Instead of:addChild(myLoader);

It should've been:container_mc.addChild(myLoader);

From:confused: to :)