FORUMS: list search recent posts

AS3 and buttons question...

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Betty Boop2
AS3 and buttons question...
on Feb 23, 2008 at 10:56:58 pm


What I a have is a set of butons accross the top that are controled by AS3.

If you play the ".swf" you will see that it stops after "Overview" and it waits for you click another button. But if you click on "Bio & Samples"it will run trough the 20 farmes of animation and continue on through the next and the next and the next finally it will repeat into the overview button where it will stop.

Here's the file...
http://www.jtdesign.org/Angie-Lyons-Group-1.swf

This is the code that is in the actions layer...

stop();

function onOverviewClick(evt:MouseEvent):void {
gotoAndStop("overview");
}
overview_button.addEventListener(MouseEvent.CLICK, onOverviewClick);

function onGigsClick(evt:MouseEvent):void {
gotoAndPlay("gigs");
}
gig_button.addEventListener(MouseEvent.CLICK,onGigsClick);


function onBiosClick(evt:MouseEvent):void {
gotoAndPlay("bios");
}
bios_button.addEventListener(MouseEvent.CLICK,onBiosClick);


function onRantsClick(evt:MouseEvent):void {
gotoAndPlay("rants");
}
rants_button.addEventListener(MouseEvent.CLICK,onRantsClick);

function onLinksClick(evt:MouseEvent):void {
gotoAndPlay("links");
}
links_button.addEventListener(MouseEvent.CLICK,onLinksClick);


function onContactClick(evt:MouseEvent):void {
gotoAndPlay("contact");
}
contact_button.addEventListener(MouseEvent.CLICK,onContactClick);


Can someone point out my mistake. Thanks.
-the boop


Return to posts index

Ross Gerbasi
Re: AS3 and buttons question...
on Feb 27, 2008 at 3:53:11 pm

It looks like your missing some stops in your coding you will want to add the code

stop();

on the frames you would like to end your animations on.

So if gigs is frame 20 and bios is on frame 40 you will wanna add a stop on frame 39.


Though I am not sure how you have your timeline setup. If your animations are inside movie clips then you simply need to change your "gotoAndPlay" commands to "gotoAndStop" but from the site it doesn't look like its setup that way


hope this helps.
-ross





Return to posts index

Betty Boop2
Re: AS3 and buttons question...
on Feb 27, 2008 at 6:29:06 pm

Hi Ross,
First of all thanks, I did not think anybody was going to answer.
Adding the stops as you suggested worked fine...the first time through the buttons.
When you click on "Contact" the last button, as soon as the page animation finishes
an error box is given and shown in the "output" box. I don't have any idea what it means. Plus at that point none of the buttons will work anymore.
This screen shot shows error and main action script on frame 64 (for the buttons).



Ross---here is the latest ".swf"
http://www.jtdesign.org/Angie-Lyons-Group.swf
If you like or require, I can send here or directly the ".fla" in question.
-the boop


Return to posts index


Ross Gerbasi
Re: AS3 and buttons question...
on Feb 28, 2008 at 3:39:06 pm

hmm something is messed at the end of your contact animation, so around frame 180. Can you gimme some more info on whats going on around that frame, code wise?

-ross



Return to posts index

Betty Boop2
Re: AS3 and buttons question...
on Feb 28, 2008 at 5:34:51 pm

Ross--Can't see anything anything out of place.

Aside from the "stops" you had me put in this is the only code anywhere. Is this is on the actions layer at frame 64...

stop();

function onOverviewClick(evt:MouseEvent):void {
gotoAndStop("overview");
}
overview_button.addEventListener(MouseEvent.CLICK, onOverviewClick);

function onGigsClick(evt:MouseEvent):void {
gotoAndPlay("gigs");
}
gig_button.addEventListener(MouseEvent.CLICK,onGigsClick);


function onBiosClick(evt:MouseEvent):void {
gotoAndPlay("bios");
}
bios_button.addEventListener(MouseEvent.CLICK,onBiosClick);


function onRantsClick(evt:MouseEvent):void {
gotoAndPlay("rants");
}
rants_button.addEventListener(MouseEvent.CLICK,onRantsClick);

function onLinksClick(evt:MouseEvent):void {
gotoAndPlay("links");
}
links_button.addEventListener(MouseEvent.CLICK,onLinksClick);


function onContactClick(evt:MouseEvent):void {
gotoAndPlay("contact");
}
contact_button.addEventListener(MouseEvent.CLICK,onContactClick);

Would you consider looking at the ".fla" file? I could link it here. Or send to another URL if you like.
-boop

Jay Thompson

Thompson Visual Design & Storytelling

7 Marjean Ct.

Kirkwood, MO 63122







Return to posts index

Ross Gerbasi
Re: AS3 and buttons question...
on Feb 29, 2008 at 6:01:55 pm

sure post it up, and send me a link to the FLA I can check into it


-ross



Return to posts index


Betty Boop2
Re: AS3 and buttons question...
on Feb 29, 2008 at 6:59:16 pm

Your very kind Ross. Here is the link to the ".fla"
http://www.jtdesign.org/Angie-Lyons-Group.fla

-boop


Return to posts index

Betty Boop2
Re: AS3 and buttons question...
on Mar 5, 2008 at 3:15:44 pm


Ohhhh Ross,

Did you for get me?

You were going to look at this ".fla" and perhaps point out my error.
http://www.jtdesign.org/Angie-Lyons-Group.fla

-boop



Return to posts index

Ross Gerbasi
Re: AS3 and buttons question...
on Mar 11, 2008 at 3:45:58 pm

I didn't forget about ya :) It looks like you had a bunch of extra keyframes at the end of your timeline.

These frames had buttons that were named different, which was causing the problem here is what you do to fix it.

Twirl open your navigation folder, on your timeline. Move the playback head down to frame 180. Select all the keyframes that are on layers in that folder, so, "jay", "contact", "links" "rants", "bios", "gig", "overview" and "ARROW". You can do this by click on "jay" frame 180 and dragging down to ARROR frame 180. Then right click and hit clear keyframe.

That should clear u up :)
-ross



Return to posts index


Betty Boop2
Re: AS3 and buttons question...
on Mar 15, 2008 at 3:43:20 pm

Been out of town and could not get back to you. Thanks for the tip, you were right!

That teaches me a lot.

-jay

Jay Thompson

Thompson Visual Design & Storytelling

7 Marjean Ct.

Kirkwood, MO 63122







Return to posts index

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