...

View Full Version : Error 1119 When Trying to Load Movie Clips



coffeebeans
05-12-2008, 02:31 PM
Kind of a newbie, so bear with me, please. I'm setting up a minisite and have a navigation menu (functioning as a movie clip) that's meant to launch other movie clips. Code on the parent file:


var myLoader:Loader = new Loader();
myLoader.load(new URLRequest("main.swf"));
addChild(myLoader);Code on the child movie clip:


stop();

function buttonClick(event:MouseEvent):void
{
gotoAndStop(event.target.name);

tyes.enabled = true;
winterpassing.enabled = true;
otherwork.enabled = true;
author.enabled = true;

event.target.enabled = true;
this.parent.myLoader.load(new URLRequest(event.target.name + ".swf"));
}

tyes.addEventListener(MouseEvent.CLICK, buttonClick);
winterpassing.addEventListener(MouseEvent.CLICK, buttonClick);
otherwork.addEventListener(MouseEvent.CLICK, buttonClick);
author.addEventListener(MouseEvent.CLICK, buttonClick);I've yanked this practically straight out of a book and have no idea why I keep getting this error message:


1119: Access of possibly undefined property myLoader through a reference with static type flash.display:DisplayObjectContainer.
this.parent.myLoader.load(new URLRequest(event.target.name + ".swf"));Any ideas? Let me know if you need clarification...not sure I explained this too well.

_Aerospace_Eng_
05-12-2008, 03:13 PM
This thread deals with a UILoader but I think you are having a similar issue.
http://www.codingforums.com/showthread.php?t=138242

coffeebeans
05-12-2008, 03:46 PM
Thank you! That did the trick. Changed one line from


this.parent.myLoader.load(new URLRequest(event.target.name + ".swf"));

to


(root as MovieClip).myLoader.load(new URLRequest(event.target.name + ".swf"));

Unfortunately, a new problem came up. Whenever I click on a button in the navigation, none of my other SWFs are showing up and I end up with this error message:


TypeError: Error #1009: Cannot access a property or method of a null object reference. at rapp_fla::mcMenu_1/buttonClick()

All of my SWFs are in the same directory as the parent SWF, are named correctly, and all work perfectly on their own, but just won't load within the main SWF.

_Aerospace_Eng_
05-12-2008, 03:48 PM
trace this and see what you get

trace(event.target.name + ".swf");

coffeebeans
05-12-2008, 03:56 PM
Ack, sorry, haven't been working in Flash for too long (as if that weren't obvious already). Where am I supposed to add or replace the trace line? I've tried a few different spots and haven't been able to figure it out.

_Aerospace_Eng_
05-12-2008, 07:01 PM
function buttonClick(event:MouseEvent):void
{
gotoAndStop(event.target.name);

tyes.enabled = true;
winterpassing.enabled = true;
otherwork.enabled = true;
author.enabled = true;

event.target.enabled = true;
trace(event.target.name + ".swf");
(root as MovieClip).myLoader.load(new URLRequest(event.target.name + ".swf"));
}

ccbeneke
02-25-2009, 11:05 PM
Did you ever get this fixed? I am having the same problem. I think we used the same book. Any help?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum