PDA

View Full Version : Keep getting Error 1119 when trying to load movie clips



coffeebeans
May 12th, 2008, 01:57 AM
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();
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.

congyaan
May 12th, 2008, 02:10 AM
Excuse for my English,I think maybe the error caused by an null pointer,yes you have defined the variable "myLoader" but it's point to anything,try to made you code like this

var myLoader:Loader = new Loader();
myLoader.load(new URLRequest("xxx.jpg"));
addChild(myLoader);

hope this will help you

coffeebeans
May 12th, 2008, 02:29 AM
Thanks for the suggestion! Still no luck, however.