FORUMS: list search recent posts

Buttons/code not working consistently across frames/publishing issues

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Patrick Mustain
Buttons/code not working consistently across frames/publishing issues
on Mar 11, 2014 at 3:31:04 pm

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

screenshot2014-03-11at11.25.59am.png


Return to posts index

demetri tashie
Re: Buttons/code not working consistently across frames/publishing issues
on Mar 13, 2014 at 12:32:27 am

hi patrick,

as far as your buttons and navigation go, it sounds like you are trying to do a very basic frame based navigation site. i would strongly suggest you review Tony Ross's video tutorial here on Building A Basic Site in AS3:
http://library.creativecow.net/articles/ross_tony/AS3_colors_site.php

that should get you going as far as your buttons and navigating goes. it is hard to comment on your other issues - items that jumped or went out of alignment - as there is no info that could lead us to that.
however, it is usually the case that as one thing that is copied it is not pasted 'in place'. even a few pixels can cause they eye to see the item as having 'jumped'

hope that helps


Return to posts index

Patrick Mustain
Re: Buttons/code not working consistently across frames/publishing issues
on Mar 13, 2014 at 4:26:36 pm

Hi Demetri,

Thanks for taking the time to respond.

I have the navigation all worked out, and one of the alignment issues turned out to be that the text box was just small enough that on the test and export it shifted one of the words down to the next line. I extended the dimensions of the text box, and tit exported fine.

I tried messing with the text box on the bottom left, but the lines are still shifted up. Still not sure why. If I get it figured out I'll post here in case someone else runs into this problem in the future.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]