Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Custom Cursor error in Animate

New Here ,
Jan 30, 2020 Jan 30, 2020

Hello, I'm trying to make a custom cursor for my project in actionscript and I'm having a bit of problem with the codes. The custom cursor works fine until I turn on the camera. The project is to make an interactive comic and the camera moves around the panels, and for this one specific panel I wanted to change the cursor for the interaction. The cursor changes just fine but as soon as I publish it with the camera on I get a 1120: Access of undefined property error. The error doesn't pop up if I publish it without the camera. Is there a way I can fix this?

TOPICS
ActionScript , Code , Error , How to
684
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 30, 2020 Jan 30, 2020

you have a reference change.  on the custom cursor's timeline put:

 

trace(this)

 

to see its reference and how it changes when you enable the camera.

 

https://community.adobe.com/t5/animate/debugging-actionscript-3-0-errors/td-p/4788610?page=1

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 30, 2020 Jan 30, 2020

hello, thank you for taking your time answering my question, but I'm not sure if I follow, I just started learning how to use animate and we barely learned anything so I barely have knowledge about coding. I've tried reading the linked source but it was very difficult to understand. If you can, may I request some elaboration on this?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 30, 2020 Jan 30, 2020

on the custom cursor's timeline put:

 

trace(this);

 

1. what do you see in the output panel?

2. what code are you using that's triggering the 1120 error?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 30, 2020 Jan 30, 2020

1. It still shows the same error codes 1120: Access of undefined property

 

2. I am using a code snipplet of "Custom Mouse Cursor" from adobe itself

 

stage.addChild(name);

name.mouseEnabled = false;

name.addEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor_2);

 

function fl_CustomMouseCursor_2(event:EVENT)

{

name.x = stage.mouseX;

name.y = stage.mouseY;

}

Mouse.hide();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 30, 2020 Jan 30, 2020
LATEST

comment out your code and retest so you can report that trace output.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines