
Welcome Guest
|
#1
|
|||
|
|||
|
Button problem
Hi i have made a button using movies in the up down and over events. It works ok except for one little problem. When i click the button the DOWN movie is played.. but as soon as i release the mouse button it stops and goes back to the UP event. I dont want this i want the DOWN movie to keep playing even after the user lets go of the mouse button. Buuuut.. how do i do it?
Thanks.
__________________
Sam. |
|
#2
|
||||
|
||||
|
Welcome to FlashMove LMarbles. Try checking this out. Instead of using a button symbol, I used a movie clip symbol and gave it button events. This way I have more control of the different states of the button movie clip.
__________________
Our greatest glory is not in never falling but in rising everytime we fall. - Confucius Blog | Shared Items |
|
#3
|
|||
|
|||
|
LMarbles -- check out this post, it's exactly the problem you have. Just replace your clip names with mine...you need the function that is written out at the end of the post in order for your movie to tell if your button has been clicked or not.http://www.flashmove.com/forum/showt...threadid=15637 (fixed)
hope that helps! liz |
|
#4
|
|||
|
|||
|
hey thanks for replying got your zip scottae will try it out
thanks. And EmilyEliz the link you gave doesn't seem to work for me, get page not found
__________________
Sam. |
|
#5
|
|||
|
|||
|
this is the code from that post -- prisma actually hooked me up with this. i've just added some comments for you.
Actionscript:
var activeBtn;
// name your button instances "mcBtn0", "mcBtn1" etc etc respectively so that this function will apply to all.
for(var i:Number=0; i < 4; i++){
this["mcBtn"+i].onRollOver = myOnRollOver; //<- no brackets here. Brackets mean a function is called, but here we only assign function reference to variable.
this["mcBtn"+i].onRollOut = myOnRollOut;
this["mcBtn"+i].onPress = myOnPress;
}
function myOnRollOver():Void {
if (activeBtn != this) {
this.gotoAndStop("over");
}
}
function myOnRollOut():Void {
if (activeBtn != this) {
this.gotoAndStop("up");
}
}
function myOnPress():Void {
if (activeBtn != this) {
activeBtn.gotoAndStop("up");
activeBtn = this;
this.gotoAndStop("down");
this.btnAction(); //<- previously I used i here, but we're ouside of the loop already, d'oh.
}
}
//now the functions are declared inside the buttons again...
//wherever these buttons are supposed to take you you need to put that frame number or label in the parenthesis...or if it's a URL simply apply the getURL("http://youraddresshere.com"); function in place of the "_root.gotoAndStop("..."); function you see underneath...
mcBtn0.btnAction = function():Void {
_root.gotoAndStop("intro");
}
mcBtn1.btnAction = function():Void {
_root.gotoAndStop("standards");
}
mcBtn2.btnAction = function():Void {
_root.gotoAndStop("advice");
}
mcBtn3.btnAction = function():Void {
_root.gotoAndStop("checklist");
}
mcBtn0.onPress();hope that helps! liz |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Button problem | faculty1882 | Flash 8 |
0 | 11-21-2007 12:52 PM |
| [F8] Roll Out Roll Over button problem | maclover | Flash 8 |
1 | 10-24-2007 06:52 PM |
| MovieClip overlap button problem | db82 | Flash MX |
2 | 01-27-2005 03:41 PM |
| Button Navigation Problem | rbgerman | Newbies |
0 | 08-02-2004 08:15 PM |
| big button problem, can anyone help? | Robyn_h | Newbies |
2 | 04-01-2003 06:44 AM |

Programming Languages


thanks. And EmilyEliz the link you gave doesn't seem to work for me, get page not found

