Skip to main content
September 26, 2017
Answered

Can someone help me with error code:1180&1120

  • September 26, 2017
  • 2 replies
  • 1481 views

Hi guys, I am new to Flash trying to learn website making by self. below are the error codes I am getting 

Scene 1, Layer 'actions', Frame 1, Line 7 1180: Call to a possibly undefined method gotoAndstop.

Scene 1, Layer 'actions', Frame 1, Line 11 1180: Call to a possibly undefined method gotoAndstop.

Scene 1, Layer 'actions', Frame 1, Line 15 1180: Call to a possibly undefined method gotoAndstop.

Scene 1, Layer 'actions', Frame 1, Line 19 1180: Call to a possibly undefined method gotoAndstop.

Scene 1, Layer 'actions', Frame 1, Line 5 1120: Access of undefined property ourservices_button.

Scene 1, Layer 'actions', Frame 1, Line 9 1120: Access of undefined property products_button.

Scene 1, Layer 'actions', Frame 1, Line 13 1120: Access of undefined property aboutus_button.

Scene 1, Layer 'actions', Frame 1, Line 17 1120: Access of undefined property contactus_buttontn.

The script I am using

stop();

ourservices_button.addEventListener(MouseEvent.CLICK,goourservices);

function goourservices(Event:MouseEvent):void{

gotoAndstop(1);

}

products_button.addEventListener(MouseEvent.CLICK,goproducts);

function goproducts(Event:MouseEvent):void{

gotoAndstop(2);

}

aboutus_button.addEventListener(MouseEvent.CLICK,goaboutus);

function goaboutus(Event:MouseEvent):void{

gotoAndstop(3);

}

contactus_buttontn.addEventListener(MouseEvent.CLICK,gocontactus);

function gocontactus(Event:MouseEvent):void{

gotoAndstop(4);

}

Can someone help me with it, please? Thanks in Anticipation.

    This topic has been closed for replies.
    Correct answer JoãoCésar17023019

    oops! my bad that's not the right link sorry, this is the one myweb.fla - Google Drive


    Here we go! I fixed it for you. https://goo.gl/KiCXkN

    Please notice that I reorganized your layers and objects so it's cleaner and more effective now.

    Elements that appear on more than one frame should be kept in only one keyframe and/or layer.

    Also notice that if you don't want some states inside of a Button component, it's better to select them and make them invisible on the Properties panel (the visible property not the alpha).

    I hope it helps.

    2 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    September 27, 2017

    gotoAndstop is missing a capital S. Should be gotoAndStop.

    And make sure your buttons are named correctly.

    September 27, 2017

    Thank you for your help JoaoCesar,  but now I am getting an error for undefined property and I named all of them, don't know why it's not working, can you please help me with it? Thank you.

    Scene 1, Layer 'actions', Frame 1, Line 6 1120: Access of undefined property ourservices_button.

    Scene 1, Layer 'actions', Frame 1, Line 10 1120: Access of undefined property products_button.

    Scene 1, Layer 'actions', Frame 1, Line 14 1120: Access of undefined property aboutus_button.

    Scene 1, Layer 'actions', Frame 1, Line 18 1120: Access of undefined property contactus_buttontn.

    JoãoCésar17023019
    Community Expert
    Community Expert
    September 27, 2017

    Just make sure you are using instance names not the library names. To change a instance name, selece a button on the stage, press Ctrl + F3 (Cmd + F3) and change the first field on the Properties panel.

    Anyway, here is a FLA with your example working: https://goo.gl/uB3TBV .

    I hope it helps.

    Please don't hesitate to ask if you have any further questions.

    Inspiring
    September 27, 2017

    Are you using HTML5 Canvas? in that case you need to add "this." before each button.

    For example: "this.ourservices_button".

    Same with the gotoAndStop lines,  though that doesn't work as they're inside functions. So you would need some variable to store this in.

    For example: "var main = this;"

    Then you can replace this with main.

    Edit:

    It should be gotoAndStop instead of gotoAndstop.

    Legend
    September 27, 2017

    RandomlyFish  wrote

    Are you using HTML5 Canvas?

    He's not. MouseEvent.CLICK, Event:MouseEvent, and :void are all AS3 code.