FORUMS: list search recent posts

Can you gotoAndPlay to the same frame?

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
jeserin
Can you gotoAndPlay to the same frame?
on Jul 17, 2006 at 3:16:06 pm

My website navigation buttons are not working correctly, I think because once I click on a button it is on the same frame that I am asking it to gotoAndPlay.
For instance, I am on frame 5 and the navigation button, if clicked on again goes to frame 6 even though it's scripted to go to frame 5. If I am on any frame other than 5, and only click once on the gotoAndPlay (5) button, it works. If I click twice, I suspect it quickly goes to 5 then can't gotoAndPlay the same frame it's on, and skips to frame 6.
I feel like I've set up my navigation like this in the past, and have never had this problem, so I'm stumped. I also have movie clips in most of the frames, FYI, if that might have anything at all to do with it.
Anything anyone might be able to offer would be a big help. Thanks!


Return to posts index

lajoiet
Re: Can you gotoAndPlay to the same frame?
on Jul 17, 2006 at 4:58:17 pm

You could try to put a condition on the button click that checks which frame the timeline is on, so on the frame5Button it would look something like this:

frame5Btn.onRelease = function() {
if (_root.currentFrame <> 5 ) {
_root.gotoAndPlay(5);
}
}

>Todd
_____________________________________

I'm filling a need. Without me there would be no bad examples.
_____________________________________


Return to posts index

jeserin
Re: Can you gotoAndPlay to the same frame?
on Jul 17, 2006 at 5:42:35 pm

Thanks, but it's giving me the following error message:
Statement must appear within on handler
frame5Btn.onRelease = function() {
Do I need to add something else into the script? I'm sure I'm missing something obvious.


Return to posts index


lajoiet
Re: Can you gotoAndPlay to the same frame?
on Jul 18, 2006 at 1:03:40 pm

You need to substitute the name of your button for "frame5Btn". I've gotten that message a few times and I always forget what causes it...

>Todd
_____________________________________

I'm filling a need. Without me there would be no bad examples.
_____________________________________


Return to posts index

jeserin
Re: Can you gotoAndPlay to the same frame?
on Jul 18, 2006 at 2:50:42 pm

Thanks, it's always the little things I forget...Have I missed something else? It's still giving me the same error message with this:

home.onRelease = function() {
if (_root.currentFrame <> 1 ) {
_root.gotoAndPlay(1);
}
}

For some reason what I select the frame with the navigation in it, which selects all navigation buttons, the script checks out. But obviously, I don't want them all pointing to the same frame with the same script. I don't get why this isn't working...


Return to posts index

lajoiet
Re: Can you gotoAndPlay to the same frame?
on Jul 19, 2006 at 12:45:05 am

Are you putting the code directly on the buttons or are you coding them with their instance names from a main Actionscript layer?

>Todd
_____________________________________

I'm filling a need. Without me there would be no bad examples.
_____________________________________


Return to posts index


jeserin
Re: Can you gotoAndPlay to the same frame?
on Jul 19, 2006 at 12:42:17 pm

On the instance. When that didn't work, I tried on the button, but you can't do that, right?



Return to posts index

lajoiet
Re: Can you gotoAndPlay to the same frame?
on Jul 19, 2006 at 3:05:17 pm

Can you post a link to your FLA file and I'll take a look at it. I don't generally attach the code right to the instances or the buttons, so I'm not 100% familiar with it, but I can take a look and let you know.

>Todd
_____________________________________

I'm filling a need. Without me there would be no bad examples.
_____________________________________


Return to posts index

jeserin
Re: Can you gotoAndPlay to the same frame?
on Jul 19, 2006 at 3:33:46 pm

Thank you.
Go to http://ftp.finishedit.com
user: finish
pwd: client
outbox-->Creative Cow-->flashsite060606.fla
You should be able to download it.


Return to posts index


lajoiet
Re: Can you gotoAndPlay to the same frame?
on Jul 19, 2006 at 5:07:15 pm

Try this:

on (release) {
if (_root.currentFrame <> 3) {
gotoAndStop(3);
}
}

for all of your buttons.

>Todd
_____________________________________

I'm filling a need. Without me there would be no bad examples.
_____________________________________


Return to posts index

jeserin
Re: Can you gotoAndPlay to the same frame?
on Jul 19, 2006 at 5:24:34 pm

YOU'RE THE BEST! Problem solved. I can't thank you enough.


Return to posts index

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