-
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 ?
-
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?
-
Senior Member
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?
-
I called the an object on the stage reddot and its instance name as symbol1 ?
so what do i do ?
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|