View Full Version : why a button stops working
saisaici
May 21st, 2007, 04:56 PM
so i have some arrow buttons (actually movie clips being treated as buttons via actionscript).
All the states work fine, onRollOver, onRollout, onRelease.
But for some reason you can't continually click the arrow to proceed to the next image unless you move the mouse at least 1 pixel before each click. I would like it to be able to be clicked repetitively without the user having to move the mouse little bit.
is there some bit of code that needs to go on the "onRelease" to reset the button or something?
Thank you::::::::-
graylensman
May 21st, 2007, 05:16 PM
Can you post your code? Sounds like you've got something odd in there, not related to the button click.
saisaici
May 21st, 2007, 07:54 PM
Can you post your code? Sounds like you've got something odd in there, not related to the button click.
here's the code for one of the arrows:
rightArrow.onRollOver = function() {
this._alpha = 50;
}
rightArrow.onRollOut = function() {
this._alpha = 100;
}
rightArrow.onRelease = function() {
if (currentThumb.isTweening()) {
} else {
thumbTitle.tween("_alpha",0,0,"linear");
currentPos = mainThumbs._x;
nextPos = currentPos - moveAmt;
mainThumbs.tween("_x",nextPos,.5,"easeOutBack");
}
}
saisaici
May 22nd, 2007, 01:43 AM
OK well this might help. I figured out that it only does this when the html page is loaded. But if you path right to the swf file it works fine.
Is there a known bug with the RunActiveContent javascript that Flash poops out for the html when you publish the movie? Or maybe something else in the HTML that's causing problems with this?
saisaici
May 23rd, 2007, 01:20 AM
Actually I lied. It still does it when viewing the swf only. If anyone has a clue as to what's going on I'd really appreciate it. Here is a test URL for the site:
http://www.teleportdesign.com/
wait until the intro thingy loads and then click on "exclusives" you'll notice some arrows for navigation. Well, just try to click one more than once without moving your mouse, and you'll see what I mean.
graylensman
May 23rd, 2007, 10:19 AM
Okay, well, one thing I notice, if you put your mouse to the left of the right arrow, you get a finger cursor. Click, and it behaves like you've clicked the left arrow. So there's lots of screwy stuff going on. :) You're best bet is to upload your fla so we can take a look.
manny2k
May 23rd, 2007, 01:13 PM
I’m probably way off here but I’d hazard a guess that it’s the
if (currentThumb.isTweening()) {
} else {
as a learner in the world of ActionScript I was of the understanding that it should be
if(its raining){
take a coat
} else{
Go to work naked
}
But I stand corrected and very much enlightened if wrong.
i wonder if rightArrow.enabled = false; and rightArrow.enabled = true; would solve it?
manny2k
Madness
May 23rd, 2007, 01:32 PM
so i have some arrow buttons (actually movie clips being treated as buttons via actionscript).
how do u do that ?
saisaici
May 23rd, 2007, 05:39 PM
Okay, well, one thing I notice, if you put your mouse to the left of the right arrow, you get a finger cursor. Click, and it behaves like you've clicked the left arrow. So there's lots of screwy stuff going on. :) You're best bet is to upload your fla so we can take a look.
Yes that's intentional. I wanted you to be able to click the smaller thumbnails to bring them to the center as well as the arrows. So I've just extended hit area for each arrow to go overtop of the smaller image next to it.
make sense?
saisaici
May 24th, 2007, 06:37 PM
Problem Solved
There were no errors in the code for my buttons at all. I had a form that had this bit of code in it:
Selection.setFocus("NAME");
and well, it was causing the focus to move from the button after it was clicked and thus canceling it our or something. No idea why the conflict but in case some one else is having problems with buttons only clicking once before the mouse is moved, this might help you out.
Thanks all.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.