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

Custom Cursor keeps duplicating upon clicking on a button

Community Beginner ,
Feb 28, 2018 Feb 28, 2018

I'm still a beginner in using actionscript 3.0 and would appreciate any sort of help / comments, Tried solutions from other forums none work for my case although we have had the same/similar problem. I'll link a download to my current files that includes the audio, images and the fla file 35_JunTing_asm01.zip - Google Drive

the custom cursor only duplicates when i click on the spacex logo image/button above the mute in the learnmore scene please advise on the changes i should make to get rid of duplicated cursor, only the background movie clip is looping i suppose since i've a stop(); command in all my scenes and the background is suppose to keep looping.

TOPICS
ActionScript
886
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

correct answers 1 Correct answer

Community Expert , Feb 28, 2018 Feb 28, 2018

Hi.

It's because everytime you go back to the 'main' scene, the code readds a new cursor.

What I suggest to you:

- Delete the cursor you already have on stage;

- Go to the Library;

- Set your cursor symbol to be exported for ActionScript with a class name of e.g.: 'Cursor';

- In the frame 2 of the 'main' scene, place this code before the line 37:

if (cursor_mc && stage.contains(cursor_mc))

    stage.removeChild(cursor_mc);

var cursor_mc:Cursor = new Cursor();

I hope it works now.

Regards,

JC

Translate
Community Expert ,
Feb 28, 2018 Feb 28, 2018

Hi.

It's because everytime you go back to the 'main' scene, the code readds a new cursor.

What I suggest to you:

- Delete the cursor you already have on stage;

- Go to the Library;

- Set your cursor symbol to be exported for ActionScript with a class name of e.g.: 'Cursor';

- In the frame 2 of the 'main' scene, place this code before the line 37:

if (cursor_mc && stage.contains(cursor_mc))

    stage.removeChild(cursor_mc);

var cursor_mc:Cursor = new Cursor();

I hope it works now.

Regards,

JC

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 Beginner ,
Feb 28, 2018 Feb 28, 2018

Thanks It worked.

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 ,
Feb 28, 2018 Feb 28, 2018
LATEST

You're welcome!

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 ,
Feb 28, 2018 Feb 28, 2018

don't use scenes; use frame labels.

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 Beginner ,
Feb 28, 2018 Feb 28, 2018

I'm still a beginner so i'm not familiar with using labels yet. Moreover, i need to have at least 4 pages and i wouldn't know where to place the labels and how to code it so that it doesn't mess up, Thank you for trying to help i've solved my problem doing the solution the first guy recommended. Thanks everyone

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