A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: 1120: Access of undefined property reddot

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    3

    1120: Access of undefined property reddot

    Can someone help, basically i am trying to make a circle in this flash document move, so i think this is the code(im new to all this)
    and im getting this error:

    " Scene 2, Layer 'ball', Frame 100, Line 14 1120: Access of undefined property reddot. "

    The code is below:




    stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_KeyboardDownHandler_3);

    function key_event_handler(event:KeyboardEvent):void {

    if (KeyboardEvent(Keyboard.LEFT)){
    reddot.x-=5;
    }
    if (KeyboardEvent(Keyboard.RIGHT)){
    reddot.x+=5;
    }
    if (KeyboardEvent(Keyboard.UP)){
    reddot.y-=5;
    }
    if (KeyboardEvent(Keyboard.DOWN)){
    reddot.y+=5;
    }

    stop();

    }


    The error seems to be in " reddot.y+=5; " this.
    Where reddot is the name which i called my object that i want to move.

    So can somebody please help ?

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Well, then there is no reddot property. What is the relationship between reddot and the instance where this code lives?

    Do you have an instance with the instancename reddot?

  3. #3
    Senior Member x-death's Avatar
    Join Date
    Aug 2009
    Posts
    175
    yeah is there a redot on the frame its giving you an error. is so is it just on the stage there or is it ina movieclip somewere?

  4. #4
    Junior Member
    Join Date
    Feb 2011
    Posts
    3
    I called the an object on the stage reddot and its instance name as symbol1 ?
    so what do i do ?

  5. #5
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    You almost certainly gave the symbol in the library the name symbol1 and the instance on the root the instancename "reddot".

    So, the question remains, what is the relationship between reddot and the instance where your code lives? Is that code on the main timeline? Is reddot a direct child of the root?

    If the code is not on the object which has reddot as a child, then you will need to get a reference to reddot somehow. How to do that will depend on where reddot is, and where your code is. But since your code does not seem to have a reference to reddot already, you might be better off moving that code somewhere else.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center