Error 1120: Access of Undefined Property help please

15,956

Your button name is HighVale, but is the instance name HighVale?

In Flash, click on the button to select it. Then in properties window look for box that says instance name. you need to change this name to the correct one that you use in the code.

You will have to do this for all names you use in the code.

Share:
15,956
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    Apparently this is a pretty common problem, but none of the places I've looked seem to have an answer for me, or at least one that isn't written in layers and layers of coding jargon that I, being a script newbie (and a pretty stupid one at that) don't understand in the slightest.

    I'm trying to work with a 'tutorial' from to make an interactive map that pops up info boxes when you hover over certain portions of the map. I even downloaded the demo file to make sure I was doing it right. The demo file works fine, and when I import (aka copy-paste) the images into my file and test-run it, they work fine, but the minute I change the file names in the code, I get an error that looks like

    Scene 1, Layer 'Actions', Frame 1, Line 9 1120: Access of undefined property Text. Scene 1, Layer 'Actions', Frame 1, Line 13
    1120: Access of undefined property Text. Scene 1, Layer 'Actions', Frame 1, Line 3 1120: Access of undefined property HighVale. Scene 1, Layer 'Actions', Frame 1, Line 3 1120: Access of undefined property HighVale. Scene 1, Layer 'Actions', Frame 1, Line 6 1120: Access of undefined property Text.

    'HighVale' is the button for the section of the map I'm working with, and 'Text' is (obviously) the image with the info text. I've checked and re-checked that the names are right, but no matter how many times I change them or try to rename them to the ones in the demo file ('mClip' and 'img' respectively) I keep getting 'Access of undefined property'. I don't know what to do.

    The code I have at the moment of writing this looks like so-

    import flash.events.MouseEvent;

    HighVale.addEventListener(MouseEvent.MOUSE_OVER, mOver); HighVale.addEventListener(MouseEvent.MOUSE_OUT, mOut);

    Text.visible=false;

    function mOver(e:MouseEvent):void { Text.visible=true; }

    function mOut(e:MouseEvent):void { Text.visible=false; }

    As I said before, I'm an actionscript newbie and I don't understand most of the jargon used around this stuff, so if you could put your answer in the most simple language possible and just tell me what to change, that would be great. I can provide more info if needed, but you'd have to specify what.

  • Admin
    Admin almost 10 years
    It's a movieclip, not a button, and I can't find anywhere that says 'instance name'. Changing it to a button doesn't help either. EDIT: I FOUND IT! It was in the other properties bar. I changed it, and it's working now! Thank you so much!!
  • Travis
    Travis almost 10 years
    you called it a button. Glad it's working. Mark this question as answered if your problem is now solved.