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

Multiple buttons - not working

Community Beginner ,
Feb 10, 2021 Feb 10, 2021

Copy link to clipboard

Copied

I have a project with many frames of artwork and nested animations. The code is very simple but it is freezing up on the later frames. Advanced layers is turned off, I do not have any alphas, artwork is bitmapped and I'm using instance names. I have replaced this a few times but with no luck - it just freezes. I had this on frame 5 as well a few days ago.  Is animate getting scrambled or is my code incorrect?

 

Please see below... 

this.stop();
 
this.stage.canvas.style.cursor = "none";
this.mouseEnabled = true;
this.addEventListener("tick", fl_CustomMouseCursor.bind(this));
 
function fl_CustomMouseCursor() {
    this.greendot8.x = stage.mouseX / stage.scaleX;
    this.greendot8.y = stage.mouseY / stage.scaleY;
    
}
 
this.jelly1.addEventListener("click", fl_ClickToHide_47.bind(this));
 
function fl_ClickToHide_47()
{
this.jelly1.visible = false;
this.splash1.visible = true;
this.splash1.play();
}
 
this.jelly2.addEventListener("click", fl_ClickToHide_48.bind(this));
 
function fl_ClickToHide_48()
{
this.jelly2.visible = false;
this.splash2.visible = true;
this.splash2.play();
}
 
this.jelly5.addEventListener("click", fl_ClickToHide_49.bind(this));
 
function fl_ClickToHide_49()
{
this.jelly5.visible = false;
this.splash5.visible = true;
this.splash5.play();
}
 
this.jelly3.addEventListener("click", fl_ClickToHide_50.bind(this));
 
function fl_ClickToHide_50()
{
this.jelly3.visible = false;
this.splash3.visible = true;
this.splash3.play();
}
 
this.jelly4.addEventListener("click", fl_ClickToHide_51.bind(this));
 
function fl_ClickToHide_52()
{
this.jelly4.visible = false;
this.splash4.visible = true;
this.splash4.play();
}
 
this.arrBlueL8.addEventListener("click", fl_ClickToGoToAndStopAtFrame_69.bind(this));
 
function fl_ClickToGoToAndStopAtFrame_69()
{
this.gotoAndStop(7);
}
 
this.arrRightNew.addEventListener("click", fl_ClickToGoToAndStopAtFrame_70.bind(this));
 
function fl_ClickToGoToAndStopAtFrame_70()
{
this.gotoAndStop(8);
}
 
I also want to do a drag and drop but cannot figure out make it work without a code snippet.
Comments welcome. 😊

Views

236

Translate

Translate

Report

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 11, 2021 Feb 11, 2021

Copy link to clipboard

Copied

Hi.

 

Are there any error messages on the browser console?

 

Also, is the frame in which you wrote the code being revisited? Because it's possible that your event listeners are being added more than once.

 

Please let us know.

 

Regards,

JC

Votes

Translate

Translate

Report

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 11, 2021 Feb 11, 2021

Copy link to clipboard

Copied

Hi JoãoCésar,

 

Thank you for responding to my inquiry! For this animation segment, I have 12 frames, with an average of 4 buttons in each frame ( True / False, click to hide, drag and drop if I can figure out how to do it). This morning, I renumbered every peice of event listener code so it has it's own "number" (gotoandstop / clicktohide) and it still does not work - same thing buttons are inactive and frame 8 freezes. Still no luck... Comments are welcome. 😊

Console notes below - not sure if the numbers correspond to frames in question.

 

I have removed transparancies and simplified each frame considerably. Does Animate have a known glitch when using many frames?  Should I invest in learning a different program (Unity)? I welcome feedback about learning the basics of C# if needed. I have on average 20 frames for each segment, with simple tweened / nested animation and I need to get these done for a presentation soon.  

 

Many Thanks,

cmdh

 

Canvas output notes below:

"WARNINGS:

Frame numbers in EaselJS start at 0 instead of 1. For example, this affects gotoAndStop and gotoAndPlay calls. (208)

Color effects are published as a filter and subject to the same limitations. (40)

Filters are very expensive and are not updated once applied. Cache as bitmap is automatically enabled when a filter is applied. This can prevent animations from updating. (15)

Applying "cache as bitmap" to an animated instance will prevent the animation from updating. (15)

Modifying the transform point in a tween can produce unexpected results. (4)

Content with both Bitmaps and Buttons may generate local security errors in some browsers if run from the local file system."

 

Votes

Translate

Translate

Report

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 11, 2021 Feb 11, 2021

Copy link to clipboard

Copied

warnings are normal but NOTE: your gotoAndStop(7) is actually going to the 8th frame (and gotoAndStop(8) is going to the 9th frame) so make sure those are numbered correctly

 

open your developer's console and check for errors while testing.

 

animate has a limit of 16,000 frames in any one timeline.  (and a limit of 16,000 timelines).

 

for a web app, you can use unity (publishing for webgl) but i don't see any advantages over animate.  for a mobile app, unity makes more sense and i changed from animate to unity for mobile apps when adobe stopped development of air: c# is similar to as3 which is similar to javascript.

Votes

Translate

Translate

Report

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 11, 2021 Feb 11, 2021

Copy link to clipboard

Copied

Hi Kglad,

 

Thank you for your input! I understand that html canvas starts at 0 so frame 9 is actually frame 8 and so on. I do have several layers of mini animations inside an mc on the main timeline so perhaps that is what is making animate scramble. I have been meticulous about naming everything and keeping the mc's uniform, code basic and ascending in numbers but even still, it is not working. 😌

 

I would like to present this on both desktop and mobile so perhaps Unity would be best. The main issue is of course that I am not a programmer - ugh. Since Decmeber 2020, learning Animate AS3, then HTML canvas and now C# definitely makes my head spin - ha ha..! All comments welcome and if you know of any support material on Unity; I'm interested in finding out more about the easy steps to getting a basic project working either in Animate or Unity.

Many Thanks,

cmdh

Votes

Translate

Translate

Report

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 11, 2021 Feb 11, 2021

Copy link to clipboard

Copied

LATEST

what's in the developer console?

 

are you creating something to be viewed in a web browser (desktop and mobile) or installed on desktops and mobiles?

Votes

Translate

Translate

Report

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