Welcome Guest [Log In] [Register]
Welcome to Brackenwood. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Double click
Topic Started: Apr 25 2006, 02:49 AM (173 Views)
clayt
Member Avatar
I'm not crazy... ask my toaster!
Hey.. can someone help me out on this double click and tell me why its not working or give me another solution for double click in flash.

This is on the frame:
Code:
 
click = false;


This is on the button.
Code:
 
macro.onPress = function() {
if (!click) {
 timer = getTimer()/1000;
 _root.click = true;
}
else {
timer2 = getTimer()/1000;
if ((timer2-timer)<.25) {
 gotoAndStop(15);
} else {
 timer = getTimer()/1000;
 _root.click = true;
}
}
};


When i check for errors in the code this is what i got:
Quote:
 
Statement must appear within on handler
    macro.onPress = function() {


Thanks.
Offline Profile Quote Post Goto Top
 
Vector
Member Avatar
Resident Actionscript Guru ♂
Admin
Basically, if you're going to put code ON a button, it must be one of the
Code:
 
on(Event) { ... }

types. The code that you have written is perfectally valid, however you must place it on the frame actions rather than the button actions. :)
Offline Profile Quote Post Goto Top
 
clayt
Member Avatar
I'm not crazy... ask my toaster!
thanks it works now :D

also... whats the code to mute the sound.... so u got a button and u press it, it mutes the sound and the button changes picture and then press it again and it un-mutes?

Thanks alot!

And if u have a media player in flash and u press play so the music plays... how can i go about making like a time line with a slider... im sure u know what i mean?
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Actionscript · Next Topic »
Add Reply