Quantcast
Channel: Adobe Community : All Content - Adobe Animate CC - General
Viewing all articles
Browse latest Browse all 13519

Buttons/code not working consistently across frames/publishing issues

$
0
0

Hi all,


Total newbie here. I'm trying to produce something that really should be super-simple but I must be missing some fundamentals.


I'm using Flash Professional CC, an html5 canvas, Mac OS 10.8.5


I've created 6 slides, that I want users to be able to navigate. The home slide seems top work. I've created 5 buttons that go to the appropriate slide and stop, using this code:



this.gotoschool.addEventListener("click", fl_ClickToGoToAndStopAtFrame_11.bind(this));


function fl_ClickToGoToAndStopAtFrame_11()

{

this.gotoAndStop(2);

}



I've created a back button, giving it its own unique instance (back1) to the second slide (frame 1--for some reason the code reads frame 1 as 0, frame 2 as frame 1, etc.) that returns users to the first slide using this code snippet:



this.back1.addEventListener("click", fl_ClickToGoToAndStopAtFrame_0.bind(this));


function fl_ClickToGoToAndStopAtFrame_0()

{

this.gotoAndStop(0);

}



Then, I create another button on frame 3, (back2) and added the same code snippet:



this.back2.addEventListener("click", fl_ClickToGoToAndStopAtFrame_0.bind(this));


function fl_ClickToGoToAndStopAtFrame_0()

{

this.gotoAndStop(0);

}



However, when I preview or publish, it doesn't even register as a button, let alone go back to the first slide. I don't get the "pointy finger" cursor, it just looks like a blank slide with no interactivity. Any idea what I'm missing here? I tried creating one button and giving it different instances on each frame and using the same code snippet, but that doesn't seem to work either.




Here's a screenshot of my timeline and stage:



Please help!


Oh, and while I have you here, I also noticed that some elements shifted upon publishing and I have no idea why or how to avoid this. It's especially frustrating because I spent a lot of time aligning the text and images and when they come out uneven it looks really unprofessional.


Below is a screen shot, you'll see in the bottom left corner that the three text lines have shifted and aren't' lined up with the corresponding colored dots. Compare that to the stage screenshot above. Also, you'll see in the lower right that I had a yellow arrow next to the "back" text (which I have recently replaced with a "<" symbol) that also shifted out of alignment upon publishing.


Any help is appreciated.


Thanks! --Patrick

 

Screen Shot 2014-03-11 at 11.25.59 AM.png


Viewing all articles
Browse latest Browse all 13519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>