Twokinds ARCHIVE Forums

This forum is for the preservation of old threads from before the forum pruning.
It is currently Tue Apr 15, 2025 4:44 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Flash CS3 help with buttons
PostPosted: Mon Jul 14, 2008 7:38 pm 
Offline
Merchant
User avatar

Joined: Wed Jul 19, 2006 8:38 pm
Posts: 155
Location: Florida.
Kinda computer related. Hopefully someone here knows Flash.

I'm making a website entirely in flash for a movie theater/cafe place thing.. yeah. Spare me the speech about how that's a bad idea. It's for someone else, and that's how they want it.

The problem lies within my buttons.

I made buttons that go to the homepage, a showtime page, live entertainment page, reservations page, and a contact page. When I click the buttons, they go where they are supposed to go, but if I click the button again, it goes to the next frame, when I don't want it to. For example:

I click the homepage button, it goes to the homepage. I click the homepage button again, and it goes to the showtimes page. While on the showtimes page, if I click the showtimes button, it takes me to live entertainment. The code that I have on it is this:
Code:
on (release) {
gotoAndPlay(2);
}


With the respective frame number in the parentheses. Each time I click the button, for this example, it should always go to frame 2(showtimes), correct? So why does it go to frame 3 while I'm on frame 2, clicking the button that's supposed to go to frame 2?

I'm new to Flash, so I have no idea what the problem is.

I've uploaded the .SWF file to my website. See for yourself. First click on "Showtimes". Once you're on the showtimes page, click on the "Showtimes" button again. Notice how it goes to Live Entertainment?
Link: http://www.neverhavetobealone.com/flash ... Screen.swf
(It should just show the website. If not, open the file if it asks)

Anyone know how to fix this?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 7:46 pm 
Offline
Templar Inner Circle
User avatar

Joined: Wed Jan 17, 2007 12:33 pm
Posts: 2879
Location: Nebraska, USA
All of your buttons do the same thing. When you click on them while you are on the page the button is supposed to go to, then they instead go to the next page.

I'm going to try to brainstorm what might do this and see if I can't help. I've been doing AS3 lately, so I've got to do a little mental gear shifting to go back to AS2.

-- Hrm --
I wish I could look at the FLA and see the code.

-- Question --
Are the buttons on their own layers, and unchanging for the rest of the SWF, or are they keyframed along with the rest of the SWF's content on each frame?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 8:03 pm 
Offline
Merchant
User avatar

Joined: Wed Jul 19, 2006 8:38 pm
Posts: 155
Location: Florida.
Yeah, I meant to say that but I'm not great with explaining. :P That's why I posted the link, so people could see it hands on.

I can email the .FLA file to you if you'd like. I can use all the help I can get..

The button images themselves on the same layer. The text on the buttons on are different layers, in their own frames as well. Showtimes text is on frame 2, entertainment on 3, reservations on 4, etc.

In all I have 8 layers. The top 5 is just the text for the buttons. The very bottom is the table. It includes the light gray box, and the graphic to the upper right. Above that is the layer with the side buttons, and above that, there's the "Welcome to..." text.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 8:12 pm 
Offline
Templar Inner Circle
User avatar

Joined: Wed Jan 17, 2007 12:33 pm
Posts: 2879
Location: Nebraska, USA
PK wrote:
Yeah, I meant to say that but I'm not great with explaining. :P That's why I posted the link, so people could see it hands on.

Oh, sorry, I see you mentioned that now, I just skimmed right over it. It's my mistake for missing it, not yours. ;)

Hrm, well, if you'd like to send me the FLA to look at, I've PM'ed you my email address. Otherwise, I'm not quite sure what'd cause this, but I can think of a cheap, cheater's work around. Just make the button only work if you aren't on the frame you want to go to.

Code:
on (release){
    // make sure that we are not on the showtimes page already
    if (this._currentframe != 2)
    {
        // if not, go to the showtimes page.
        gotoAndPlay(2);
    }
}


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 8:17 pm 
Offline
Merchant
User avatar

Joined: Wed Jul 19, 2006 8:38 pm
Posts: 155
Location: Florida.
That's also a good idea. I wanted to do that in the beginning, but I didn't know how.. I'd still like to figure the problem out for future knowledge, but I'll definitely use this "cheaters way". :P Thanks.

I emailed the file. You probably know that by now though. :P

Also, I wanted to animate the buttons so that they gently come from the side, instead of just popping up there, but I have no idea how to use a motion tween on a button. I thought of just doing an invisible button there, but then I don't know how to make a motion tween animate when you scroll over it. <__> If you understand what I'm trying to say, and know how to help, I'd appreciate it. <3


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 8:25 pm 
Offline
Templar Inner Circle
User avatar

Joined: Wed Jan 17, 2007 12:33 pm
Posts: 2879
Location: Nebraska, USA
I know what you mean, though I don't remember how to do what you want. I'll try to look it up (I played with doing something similar, it's really just having more than one frame in the button's "over" area, IIRC). I'm going to be busy for a few hours, so I won't be able to look into it until late tonight, I'm afraid.

Unfortunately, you, like most people, come at Flash from the artist's side, whereas I'm a programmer, so we use Flash in completely different ways. :P


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 8:34 pm 
Offline
Merchant
User avatar

Joined: Wed Jul 19, 2006 8:38 pm
Posts: 155
Location: Florida.
How can you put more than one frame in each button area? D:

Also, I'm way more artistic than rational/logical/whatever. I don't know the words to say, the things to type, or the code to use, but I can visually and physically show a lot. Sometimes I wish it were the other way around, though.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 8:49 pm 
Offline
Templar Inner Circle
User avatar

Joined: Wed Jan 17, 2007 12:33 pm
Posts: 2879
Location: Nebraska, USA
Ah. The trick of it is to put the button inside of a movie clip that does the animation. You end up with these strange, multilayered things.

See some useful pages with tutorials for it.

-- Here's a fix for you problem --
Use gotoAndStop() instead of gotoAndPlay(). It might not be catching the stop immediately when you're on the same page. Then you can actually leave out the stop() function on each frame, too. ;)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 8:53 pm 
Offline
Merchant
User avatar

Joined: Wed Jul 19, 2006 8:38 pm
Posts: 155
Location: Florida.
I love you. <3


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 8:56 pm 
Offline
Templar Inner Circle
User avatar

Joined: Wed Jan 17, 2007 12:33 pm
Posts: 2879
Location: Nebraska, USA
PK wrote:
I love you. <3

I live to serve. :D

-- Also --
I hope you caught my edit on my last post. I found the fix for your problem.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 9:04 pm 
Offline
Merchant
User avatar

Joined: Wed Jul 19, 2006 8:38 pm
Posts: 155
Location: Florida.
I didn't see it. Thanks. :]

My response to it:

:O I thought that might've been what it was, but I had the stop(); action on each, so I thought it'd always stop them. Guess not. I feel kinda dumb, now. x3 Thanks a lot for helping me. <33


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 9:08 pm 
Offline
Templar Inner Circle
User avatar

Joined: Wed Jan 17, 2007 12:33 pm
Posts: 2879
Location: Nebraska, USA
You're welcome. I'm glad your problem is resolved. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group