Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 16th, 2008, 01:35 PM
mrbysh mrbysh is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 3 mrbysh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 2 m 25 sec
Reputation Power: 0
Flash CS3 - Button only works in one frame.

Howdy.

I'm pretty new to Flash in general and I'm trying to put together a basic presentation. I have a "back to menu" button (menu_btn) in several of the frames that my menu frame link to. The problem is that the back to menu button only works in one of those frames.

I use the following code for the button:
Code:
function goMenu (e:MouseEvent):void
{
	gotoAndStop("Menu");
}
menu_btn.addEventListener(MouseEvent.CLICK, goMenu);


Here's what my timeline looks like. The first frame is the menu and the rest are the individual frames the menu links to. The button is in the Buttons layer on frames 2-5. It only works in frame 2.

URL

I went off of this tutorial to do it.. so it seems like it should work.

Any ideas are appreciated. Thanks!

Reply With Quote
  #2  
Old July 17th, 2008, 02:18 AM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 57 m 29 sec
Reputation Power: 534
Facebook MySpace
Hi, if you have the button in multiple keyframes then make sure you have given it the same instance name in them all. If the movie doesn't actually change in those other keyframes then just have it in the first keyframe and have normal frames after it instead, even if that means moving it onto its own layer.
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #3  
Old July 17th, 2008, 11:11 AM
mrbysh mrbysh is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 3 mrbysh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 2 m 25 sec
Reputation Power: 0
Thanks for the response.

I'm still having trouble getting it to work. It appears that the button has the same instance name in the set of frames it's in (2-5).

When I tried creating a test flash with just 3 buttons that go to different frames, they all worked fine. But if I instead have a frame with 2 buttons that each go to different frames and share a "back" button, the back button still only works on the 1st one.

I think I might not be using AS3 in frames properly. I've had trouble finding any tutorials with an example like this. I understand the general concept and it seems like it should work, but it doesn't.

Reply With Quote
  #4  
Old July 17th, 2008, 01:56 PM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 57 m 29 sec
Reputation Power: 534
Facebook MySpace
So you have it layered like this?


Reply With Quote
  #5  
Old July 17th, 2008, 02:09 PM
mrbysh mrbysh is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 3 mrbysh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 2 m 25 sec
Reputation Power: 0
It won't let me post a screencap of my timeline on here yet, but not exactly. I will try to explain it as best I can.

Layer 1 is "actions"
Frame 1 (keyframe): AS3 code for the buttons on the menu that link to frames 2-5.
Frame 2 (keyframe)-5: AS3 code for the "back to menu" button which should take you back to frame 1 from frames 2-5.

Layer 2 is "buttons"
Frame 1 (keyframe): Buttons for the menu.
Frames 2 (keyframe)-5: Back to menu button.

Layer 3 is "content". Every frame is a unique keyframe.
Frame 1 is the menu content, the rest are each different frames of content.

so frames 2-5 have the button to go back to frame 1, but the only frame that it works in is frame 2.

if this is not the standard way to do something like this, feel free to let me know. I just kind of tried to whip up what seemed to make sense at the time.

Thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Flash CS3 - Button only works in one frame.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway