The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 4 of 4

Thread: Cannot recognize instance name

  1. #1

    Cannot recognize instance name

    This may sound like a stupid question, but Flash is giving out an (Error 1120: Access of Undefined Property "InstanceName") while everything is perfectly in order.

    As shown in the image below:

    1. Instance name is "back1"
    2. The action is on the same frame as the instance.

    Actions:

    stop();

    back1.addEventListener(MouseEvent.CLICK, goback);

    function goback(e:MouseEvent):void
    {
    play();
    }

    Error:

    Scene 1, Layer 'Actions', Frame 11, Line 3 1120: Access of Undefined Property back1

    From what I believe this should work perfectly as the following is happening:
    1. Instance name spellings are correct in both the properties and script.
    2. The instance is on the same frame as the actions.
    3. The instance is not nested inside another and is directly placed on stage.
    4. The timeline stops at the given frame to await further events with the "stop();" command, thus the script has free access to the instance.

    So, why am I still getting the error message? Please help me out. Thanks in advance.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	AS3.jpg 
Views:	18 
Size:	56.0 KB 
ID:	54947  

  2. #2
    684
    posts
    Registered abUser
    just a quick thing to try is this:

    make sure every instance of that on the timeline has the same name (i.e. where you are tweening it)

    you are naming it on frame 11 but also ensure it has that name on frame 1 and 2 and every keyframe.

    Because it is shared across frames I seem to remember flash being particular about naming of instances whilst animating them. I even wrote a jsfl script once to do this for me if there were millions of them, give it a whirl might not fix the issue but will only take a couple of seconds to try (if you haven't done this already)
    blog (experiments and code)-> http://blog.bwhiting.co.uk/ <-
    as3 helper/shortcut lib (v1.2) -> http://code.google.com/p/bwhiting/downloads/list <-
    agal helper -> Clicky here <- UPDATED

  3. #3
    Thank you for the quick reply, but I seemed to have solved the problem. I just changed the instance from Movie Clip to Button. But from my knowledge, this should have ABSOLUTELY nothing to do with that as you can perform the same MouseEvents on MovieClip and Buttons. I am kinda confused as to what just happened though.

    But thanks again for your time.

  4. #4
    684
    posts
    Registered abUser
    no worries, glad you sorted it!
    blog (experiments and code)-> http://blog.bwhiting.co.uk/ <-
    as3 helper/shortcut lib (v1.2) -> http://code.google.com/p/bwhiting/downloads/list <-
    agal helper -> Clicky here <- UPDATED

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012