Skip to main content
Inspiring
May 23, 2024
Answered

ActionScript, Scene, and Camera Errors

  • May 23, 2024
  • 2 replies
  • 3246 views

Hello,

 

Recently, I had a problem with my Adobe Animate project that had to do with the scenes, my ActionScript code, and my camera. Ever since I added my buttons for the "Intro" scene, things started to get weird. I got ActionScript output errors stating my Dream and Room scenes don't exist, a lot of ActionScript #1120 errors on my Room and Dream buttons, and even my camera not working in the Room scene. I don't know why, but when I try to change some segments of my code, the errors persist. Is it because Adobe Animate updated, there are errors in the Camera functions, or even the code itself is outdated? I have no clue what's going on, and I hope to find a solution to it. Furthermore, I'm new to ActionScript so I don't know a lot about it. The code snippets were extracted from our textbook. I am also using version 24.0.3 of Adobe Animate 2024.

Here is my file:

https://drive.google.com/file/d/111jUH0po1h_u4BN4b1iYCd14qw6VS_on/view?usp=sharing


With regards.

This topic has been closed for replies.
Correct answer GeneralFlipHax

Hi again.

 

Thanks for the file.

 

Here is a fixed version:
https://drive.google.com/file/d/1dXK9PhKzNhj6LN7qTXO41h4j4-clRdvY/view?usp=sharing

 

So it seems there's something in front of your buttons the are preventing them to be clicked. I'm not sure what. Maybe it's an issue of the advanced layers. To fix the problem I sent the two buttons to the top of the display list using the addChild method.

 

Another thing that I noticed in your file is that the Hit frame of the buttons are not set. You should do it so that the hit area is well defined and the mouse cursor won't keep blinking.

Lastly, using the Camera tool and thus advanced layers makes things much harder and more prone to bugs. I would simulate a camera scaling a parent container or using a custom AS3 VCAM that you can find Googling it.

 

Regards,

JC


Hello JC,

 

I recently did some tweaks and it looks better than ever in terms of functionality! Thank you!

 

With regards,

2 replies

JoãoCésar17023019
Inspiring
May 23, 2024

Hi.

 

You have two types of issues:
1 - Functions with the same name in the first two scenes. Give the duplicates different names;
2 - As you're using advances layers, you need to use the layer name as a prefix. For example: Buttons.dreamButton instead of only dreamButton.

Also please make sure to test your movie by using Ctrl + Enter (Cmd + Return) to test the whole movie and not Alt + Ctrl + Enter (Option + Cmd + Return) to test the current scene only.

 

I hope these tips help.

 

Regards,

JC

JoãoCésar17023019
Inspiring
May 23, 2024

Actually the functions that are duplicated.

 

Anyway, here is a working version.
https://drive.google.com/file/d/1uVOk6UkyyplLupSPsoOaMTASu0Hr7U5y/view?usp=sharing

JoãoCésar17023019
Inspiring
May 23, 2024

Hello JC,

 

Thanks, for some reason, it's working now! Although I'm curious, what did you do in the second scene that made the Camera work, and avoid the #1120 ActionScript error?

 

with regards.


Great.

 

It's because in that scene one of your buttons is called introButtonRoom but in your code it was called introButton only. Forgot to mention that.

kglad
Braniac
May 23, 2024

fix the first error and then retest. once the first error is fixed, work on the second error etc.

Inspiring
May 23, 2024

Hi kglad,

 

I fixed the #1120 ActionScript error since I didn't state an Instance name on my button symbol but after I fixed that, a new error appeared on my first scene:

Is there a way I can fix this? I tried renaming the instances and rearranging my scenes but nothing happened. Any thoughts or solutions?

With regards.

kglad
Braniac
May 23, 2024

in your publish settings, tick "enable debugging" and re-test.  the error line number will be listed.

 

copy and paste here the few lines around the line with the error, along with the top of the error panel.