• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Assistance required with error 1119, 1120

New Here ,
Mar 02, 2010 Mar 02, 2010

Copy link to clipboard

Copied

Can anyone assist me with some Action Script errors

I created a simple menu with subs using frame labels.


The code on the main timeline of the loader page is:

var myLoader:Loader = new Loader();

myLoader.load(new URLRequest("main.swf"));

addChild(myLoader);

The code on the menu navigation movie clip is:

stop();

function buttonClick(event:MouseEvent):void

{

gotoAndStop(event.target.name);

information.enabled = true

portfolio.enabled = true

event.target.enabled = false;

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

}

information.addEventListener(MouseEvent.CLICK, buttonClick);

portfolio.addEventListener(MouseEvent.CLICK, buttonClick);

function subClick(event:MouseEvent):void

{

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

}

ww_btn.addEventListener(MouseEvent.CLICK, subclick);

uni_btn.addEventListener(MouseEvent.CLICK, subclick);

The buttons all have instance names but I keep getting the following errors

1119: Access of possibly undefined property myLoader through a reference with static type flash.display:DisplayObjectContainer.

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

1120: Access of undefined property subclick.

on the lines - ww_btn.addEventListener(MouseEvent.CLICK, subclick);

uni_btn.addEventListener(MouseEvent.CLICK, subclick);

I want to use Flash to build websites and am having difficulty with the navigation and loading external files.

Many thanks in advance to anyone that can help,

Lanky

http://download.yousendit.com/VGljYUp3Mm1Fd2Z2Wmc9PQ

TOPICS
ActionScript

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 02, 2010 Mar 02, 2010

Copy link to clipboard

Copied

LATEST

Try replacing:  this.parent.myLoader

with: MovieClip(parent).myLoader

Also, I am not sure, but you made need to create a new loader instance as well.  A Loader can only have one child, and I don't know if you can use the same one twice... but you could try.  The help docs may explain this.

As far as subclick goes, you need to choose your spelling... the function is named subClick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines