Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Emulate Double-Click


Can one emulate a double-click in Flash MX?

I'm creating a user-defined polygon, and want
it to close when the mouse is double-clicked.

My second option is to close the polygon when
two points are within a tolerance (using hitTest).
Though, I'd rather use a double-click.

Thanks,

Tripp Lowe
The University of Georgia
School of Forest Resources




FlashKit > Flash Help > Flash MX
Posted on: 04-08-2003, 11:24 AM


View Complete Forum Thread with Replies

Sponsored Links:

Emulate Mouse Click?
I'd like to emulate a mouse click. For instance call a function with an x,y position and have flash react as if the mouse had actually been pressed in that location. The mouseListener stuff won't work for me since I want button etc... to react to this click. Anybody know if this is possible?

--Josh

View Replies !    View Related
Single Click Button Requires Double Click
I noticed that some buttons in all of my .swf's were taking
two clicks to get them to work. After you double click them
once they work fine. I made a very simple movie to demonstrate
my problem. Please tell me if this problem is occuring for you also.

Thanks,
Anavrin

My .SWF file My .FLA file

View Replies !    View Related
How Can I Enable Single Click And Double Click
I want to single click a button then it will play movie and double click a button will play another movie.

Can anyone give some suggest?

View Replies !    View Related
How To Differentiate A Single Click From A Double Click
Hi guys

I'm having a mission trying to differentiate between single and double clicks.

A double click is made up of two single clicks so if i do a trace of when the mouse is double clicked, the result will be:

single click
double click


How can I make the trace just
double click

and not

single click
double click
??

Here's the code that goes on my button:
Code:


Code:
on (press) {
if (!_root.click) {
timer = getTimer()/1000;
_root.click = true;
} else {
timer2 = getTimer()/1000;
}
if ((timer2-timer)<.25) {
trace("double click");
} else {
trace("single click");
timer = getTimer()/1000;
_root.click = true;
}
}

Thanks for any ideas

View Replies !    View Related
[F8] Single Click Acting Like A Double Click
I am trying to troubleshoot a problem that has come up with some flash-based courses. These have been developed over the last few years, so they've been developed in MX2004 and Flash8, but the basic code (AS2) is the same across the board.

Each course has a series of swf files (pages) that get loaded dynamically, when the user clicks a "next" button. They have been working fine until recently. Now a small number of users are experiencing something odd...

When these users click the next button (a movieClip called mcNext), the next page loads, and then immediately, the page after that loads. It's as if the user clicked twice, or double-clicked.

So far, it looks like it might be a browser version/plug-in version specific error, as it's only happening with I.E. 7 and Flash player 9.0.124.0

here's (a simplified version of) the code:


Code:
mcNext.onRelease = function() {
thisPage++;
pageChange();
};

function pageChange():Void {
pageNum.text = thisPage+" of "+totalPages;
thisMCL.loadClip("page"+thisPage+".swf", mcContentHolder);
}
Anybody experiencing anything similar?

thx!

View Replies !    View Related
How To Differentiate A Single Click From A Double Click
Hi guys

I'm having a mission trying to differentiate between single and double clicks.

A double click is made up of two single clicks so if i do a trace of when the mouse is double clicked, the result will be:

single click
double click


How can I make the trace just
double click

and not

single click
double click
??

Here's the code that goes on my button:

Code:
on (press) {
if (!_root.click) {
timer = getTimer()/1000;
_root.click = true;
} else {
timer2 = getTimer()/1000;
}
if ((timer2-timer)<.25) {
trace("double click");
} else {
trace("single click");
timer = getTimer()/1000;
_root.click = true;

}
Thanks for any ideas

View Replies !    View Related
Double-click (I Know It's Possible, But How?)
For an example of what I am attempting, Please check:
http://ecko.com/complex

Nice, right.
So far I have made a custom cursor.

Now, how do I script a double click event that goes to the interface movie clip???

I know you know...please help

Sasha Bad

View Replies !    View Related
Double Click
In my upcoming website:
http://www.nachorevolution.com/xex.html
On the yellow page the NR is dragable i figured that out. But now I want to make it so when one double clicks it will getURL. I can't figure out how to do this? any suggestions?

View Replies !    View Related
Double Click
I am making a move where I have three main mc's(red, green, purple). In each mc is a button. each button opens another mc that relates to the main mc... they will be named: red2, green2, purple2. What I would like is to click on the button in the red mc and open tell the red2 to goto another frame, and when I click on the same button again the mc will go to the first frame again. Along with that I want the other mc's green2 and purple2 togo to their first frame if not already there. and likewise for all the main mc's

---- any one?

View Replies !    View Related
Double Click?
Hello!
Does anyone know a way to get a doubleclik with a Movie Clip?

Any help on this would be grat!
Thanks a lot.

View Replies !    View Related
Double Click Help
I have three buttons, each button has a corresponding mc. I would like each button to tell its corresponding mc if it is at the 1st frame go to 3rd and any other frame go to the 20th frame.

any ideas???

View Replies !    View Related
Double Click?
id there a double click function in flash mx?

if not how would i do this using flash 5 techniques?

tnx

View Replies !    View Related
They Double Click Right By Me
I'm making a software simulation using screen shots and invisible buttons.

I'm using this button script graciously supplied by a board member:

"create an input textbox, give this the variable name answer1 add the frame actions

Selection.setFocus("answer1");
stop();

and on the same frame also place a button.

add the following acrions to the button

on (release) {
studentAnswer = answer1.toLowerCase();
correctAnswer = "what the answer should be";
if (studentAnswer == correctAnswer) {
gotoAndStop(someFrame);
}
}"

The student is expected to fill in an input text blank correctly before he is allowed to move on in the tutorial. Much to my horror, what they've discovered is, if they double click (instead of single clicking like they're instructed to do), they skip right past the text blank and are taken to the next page of instructions. Is there any way of preventing this in the swf file?

Thanks, Mike

View Replies !    View Related
Double Click
Why do I have to double-click on links within my movie? My external links are all single click.

Thanks!
Jeff

View Replies !    View Related
Double Click Help
I'm trying to set up a double click. I have a nav system that is a box the width of the stage and rests at the very bottom of the stage. When you click anywhere on the stage it slides up to that point. When you make a slection it goes back to it's original y position. I want to make it so that the user has to double click to bring the menu up though cause the single click interferes with my other buttons. I know I need to come up with a timer variable of some kind but I'm not quite sure how to do this. Any suggestions? I've included my .fla file. Please help me. Thanks.

View Replies !    View Related
Help With Double Click
First let me explain the set up of my movie. Create a square the size of the stage and turn it into a MC. Place it at the bottom of the stage so that only about 20-30 pixels of it are showing. Add this code to the MC...

onClipEvent (load) {
var valid = true;
newY = _y;
origY = _y;
Yspeed = 3;
a = 1.6;
d = 1.9;
}

onClipEvent (enterFrame) {
Yspeed = ((_y-newY)/a+Yspeed)/d;
_y -= Yspeed;
}

onClipEvent (mouseDown) {
if ((valid == true) and (_root._ymouse < 300)) {
newY = Math.ceil(_root._ymouse);
valid=false;
}else{
if ((valid == true) and (_root._ymouse > 300)) {
//if the mouse is below the minimum for the nav to show, it puts it at this point so it can be seen
newY = 300;
valid=false;
}
}
}

Now, I want to make the onClipEvent(mouseDown) occur on a double click. I'm not sure how to go about setting this up. Any help would be greatly appreciated. I've included my .fla file, it was created on a Mac though so sorry PC people. Please help me. Thanks for your time everyone.

View Replies !    View Related
Double Click
Hi,
I was just reading a tutorial of flash recognizing the double click feature:
http://www.spoono.com/flash/tutorial...l=double_click

I was wondering if there's another approach that could possibly be more practical. Please advise, thanks.

View Replies !    View Related
Why Double Click?
okay so i finished my first program.. i had a start button n everything.. but to start the movie.. for some reason u have to click the button twice.. n i didn't kno why.. so i need some help.. its just one scene.. n i made one layer just for a stop in the beginning.. n then i made a button layer. .where i placed the button on the stage n had this in the script..
code: on (release) {
MyButton.onPress = function() {
gotoAndPlay(2);
};
}
What should i change?

View Replies !    View Related
Double Click
how can i make a button when i make double click on it , the button can open notpad

View Replies !    View Related
Double Click?
Why when i double click on a button why does it take me to the last scene of my movie how do i stop this happening??

J

View Replies !    View Related
Double Click
Can you make it where if you click on something the double click funtion will not work. For example, when you double click on my button if you click once no problem it goes to correct frame. If you double click it will go to correct fram on first click then the frame next to it on the second click. www.drywallparts.com

View Replies !    View Related
Double Click ....
Hii can annyone help me ....
I have a mc button soo i want when i double click on it i want it to run to the next scene or an url i want..?

can annyone help me on this plsss......
hope sooo therefore there is anny profesional here

View Replies !    View Related
Double Click?
Can you make a button need to be "double-clicked"
to execute an action?

View Replies !    View Related
Double Click
there is a new stupid thing on flash

before you can use the flash navigation or website you have to
activate it by cliking on de flash page or pressing the space bar
is there a code that can remove that anoying activation press thing

i gues that the code has to be in the html source
can someone help me out plz

thx

View Replies !    View Related
Double Click MC?
I am trying to create a function where if a user double clicks on a particular mc the mc will reset itself to its original zoom and position...however, I cannot get this feature to work correctly...when I do get the feature to work, I cannot drag and pan the mc...if the feature is disabled, I can drag and pan the mc...here is the code I came up with to double click reset the mc...but it does not work...can someone help?

code:
_root.click = false;
_global.CAD.onPress = function() {
if (!click) {
timer = getTimer()/1000;
_root.click = true;
}
else {
timer2 = getTimer()/1000;
if ((timer2-timer)<.25) {
_global.zoom._xscale = _global.zoom._yscale = mc_scale;
_global.container._x = mc_X;
_global.container._y = mc_Y;
} else {
timer = getTimer()/1000;
_root.click = true;
}
}
}

_global.CAD.onRelease = function() {
delete _global.CAD.onPress;
delete _global.CAD.onRelease;
delete _global.CAD.onReleaseOutside;
}

View Replies !    View Related
Double Click
Hi, i was checking out the tutorial at:

http://www.actionscript.org/resource...ons/Page1.html

But i can't seem to download the attatchment file :"DoubleClick.zip".

Could anyone try to explain how i can assign things in the time line? (btns mc's and such) Plus if there is any more actions need to be set?
Makeing the code work in general.

I would really appreaciate it


(wants to make a point and click game XD)

View Replies !    View Related
Double Click
Rather New to flash... having issues with my action script requring two clicks on the on (release) function..... any suggestions.. (thanks in advance)

View Replies !    View Related
Double Click
is it possible to assign a double click in AS2?

View Replies !    View Related
No Double Click At All
Hi guys. I never really dealt with double click in flash, but I've been always thinking it's just the same as any mouse event handling. Here is the simple test code I've made:

ActionScript Code:
package
{
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;

    public class PureAS3Test extends Sprite
    {
        public function PureAS3Test()
        {
            if( stage )
                init();
            else
                addEventListener(Event.ADDED_TO_STAGE,init);
        }
       
        private function init(event:Event=null):void
        {
            removeEventListener(Event.ADDED_TO_STAGE,init);
           
            var sprite:Sprite = new Sprite();
            sprite.x = 0;
            sprite.y = 0;
            sprite.graphics.beginFill(0xff0000);
            sprite.graphics.drawCircle(0,0,100);
            sprite.graphics.endFill();
           
            addChild(sprite);
           
            sprite.addEventListener(MouseEvent.DOUBLE_CLICK,onDoubleClick);
        }
       
        private function onDoubleClick(event:MouseEvent):void
        {
            trace("double click");
        }
    }
}

I'm really sick of clicking that red circle, but I got no event firing at all. I've changed windows double-click settings, have made another testing mouse listeners (all of them are firing) and all the things... None of them made effect.

What am I doing wrong???

View Replies !    View Related
IE Double Click
Anyone know how to get past the IE Double Click. I've created a flash animation where the entire background image is a URL link. In every browser (on the Mac and PC), except Internet Explorer on the PC, the user clicks once on the image and is taken to the appropriate page. BUT in IE, on the PC, the user has to click twice. WHY GOD WHY? Please help!

View Replies !    View Related
Why Double Click?
Hi,

I've set up the on release, get url link on a flash button to add to my HTML page.
However, I need to double-click for it to work (for it to link to the other page). Is this accurate? How can I get it to function on a single-click?

thanks!

View Replies !    View Related
Double Click
Hi

I want to add a double clik detect to a movie clip which works fine and dandy if the movie clip jsut has gaprhics in it. However, i really could do with having th emovie clip also house other movie clips. But when i od this the double click doesnt seem to work. heres the cide bewlow:

var bubble:MovieClip;
bubble = new bubble_container();
this.addChild(bubble);
bubble.doubleClickEnabled = true;
bubble.addEventListener("doubleClick", doubleClick);

bubble.addEventListener("click", singleClik)

function doubleClick(event:Event){
trace("im double clikked");

}

function singleClik(event:Event){
trace("im single clikked");
}

is there a way of basically listenting for anything in bubble being double clicked?

thanks v much in advance

a

View Replies !    View Related
Why Does My Mc Need A Double Click
I have frame labels and buttons set up to cause an action .. It will work but it takes two clicks on the button ...
It is a simple flipping page forward and back in a book ///
the actionscript is a simple on mouse event click.. frames are named each with a stop action in layer below ... but when I want it to repeat a gotoAndPlay("back") i must click twice .
it must be simple but I am confused ??





























Edited: 02/28/2008 at 09:44:41 AM by mrMajk

View Replies !    View Related
How Do You Do A DOUBLE CLICK?
I have a MC in my project that acts as a popup window only it is really just a movie clip. One that loads hi-res pictures AND... here's the important part....
has a startDrag() action attached to it so that the user can move the picture aside if they so desire.

However to close this window, I'd like to have the user DOUBLE CLICK with the mouse. They should be able to double click anywhere on the movie clip or even anywhere else... it doesnt matter really. The thing is, how do I listen for a double click in ActionScript??

There no method for the built in classes that I could find.

View Replies !    View Related
On Double Click Help
I have a button that has an on(press) and an on(release) handler, which makes an movieClip start and stop drag.
I want to add a double click handler also. To where you double click on the same button and something will happen, something like when you double
click the top bar of a window (PC) and it maximizes the window.

Can any one show me some AS that can have this?

THX!

View Replies !    View Related
Double Click
Along with my Multi Key class I was needing for a recent project, I have also been required to write a few applications that needed some minor double click detection. I took this opportunity to write a very simple class for detecting double clicks. It's really easy to use and has served it's purpose for me, if anyone wants to elaborate on, or use this class.. please feel free. I have included an example of the class and the code in the fla, and also a zip file with a ready example. Take Care.

DoubleClick.as:

ActionScript Code:
import lists.*;class DoubleClick{    // the target we are checking if is double clicked    private var target:MovieClip = null;    // the amount of time before the second click doesn't count as a double click    private var DELAY:Number = 300;    // a flag specifying whether or not the first click has been made    private var firstClicked:Boolean = false;    // the id of the interval that gets set to destroy the second click    private var intID:Number;    // the list that stores all objects listening for events    private var listeners : ListenerList;    /* Constructor */    public function DoubleClick(target:MovieClip)    {        this.target = target;        // listen for events from the mouse        Mouse.addListener(this);        listeners = new ListenerList();    }    // is called everytime the users presses the mouse    private function onMouseDown():Void    {        if (target == null || target.hitTest(_xmouse, _ymouse))        {            if (!this.firstClicked)            {                this.firstClicked = true;                intID = setInterval(killInterval, this.DELAY);            }            else if (this.firstClicked)            {                invokeOnDoubleClicked();                this.firstClicked = false;                killInterval();            }        }    }    // destroys the interval, making sure the double click gets destroyed    private function killInterval():Void    {        this.firstClicked = false;        clearInterval(intID);    }        // adding and removing listeners    public function addListener( o : Object ) : Boolean    {        return listeners.addListener(o);    }    public function removeListener( o : Object ) : Boolean    {        return listeners.removeListener(o);    }    // inokes the onDoubleClicked() event in all listeners    private function invokeOnDoubleClicked() : Void    {        for (var i:Number = 0; i<listeners.count; i++)        {            listeners.getListener(i).onDoubleClicked();        }    }}


FLA code:

ActionScript Code:
// create a new instance of DoubleClick,  you can either pass in the movieclip you want to double click// or pass in nothing if you just want to listen for double clicks anywherevar dc = new DoubleClick(test_mc);// create a new instance of a listener object_obj = new Object();// our double click object is going to call onDoubleClicked() on all listeners, so we will need to define that function_obj.onDoubleClicked = onDC;// we then add _obj as a listener of our DoubleClick objectdc.addListener(_obj);// this is the definition of our onDoubleClicked() functionfunction onDC() : Void{    output.text = "You double clicked the movieclip";}

-Michael

View Replies !    View Related
Double-click
Anybody got a script for double-click. I'm guessing it's just a timer from the first click because there is no double-click event.

View Replies !    View Related
Double Click
Has anyone actually used the MouseEvent DOUBLE_CLICK handler successfully? I cant seem to use it. The example in the help file which includes the DOUBLE_CLICK handler doesnt work either.

Its not critical for me as I can create my own double click handler but it would be good if the documented methods actually worked!

View Replies !    View Related
Double Click
Hey Guys,
I have read through the help file in Flash but I can't make heads or tails of what they are saying on the matter.

Is it possible to call a function on double click?

Thanks in advance,
flash_boy

View Replies !    View Related
Double Click MC?
I am trying to create a function where if a user double clicks on a particular mc the mc will reset itself to its original zoom and position...however, I cannot get this feature to work correctly...when I do get the feature to work, I cannot drag and pan the mc...if the feature is disabled, I can drag and pan the mc...here is the code I came up with to double click reset the mc...but it does not work...can someone help?


ActionScript Code:
_root.click = false;_global.CAD.onPress = function() {    if (!click) {        timer = getTimer()/1000;        _root.click = true;    }     else {        timer2 = getTimer()/1000;        if ((timer2-timer)<.25) {            _global.zoom._xscale = _global.zoom._yscale = mc_scale;            _global.container._x = mc_X;            _global.container._y = mc_Y;        } else {            timer = getTimer()/1000;            _root.click = true;        }    }}_global.CAD.onRelease = function() {    delete _global.CAD.onPress;    delete _global.CAD.onRelease;    delete _global.CAD.onReleaseOutside;}

View Replies !    View Related
Double Click Or Not Double Click
Well I've got a bug in my code, where a button has to be double clicked to work.

Just wondering what is the standard distinction for the difference between single and double click.

my code


ActionScript Code:
ns.seek(0);
subtitles._visible = true;
sign._visible = true;
signer = 1;
signCode = 1;
_root.button(_root.butVT);

the idea is that it runs a function only when the above button is pressed, but it doesn't seem to work the first time you press the button any ideas?

View Replies !    View Related
How Do You Do A DOUBLE CLICK?
I have a MC in my project that acts as a popup window only it is really just a movie clip. One that loads hi-res pictures AND... here's the important part....
has a startDrag() action attached to it so that the user can move the picture aside if they so desire.

However to close this window, I'd like to have the user DOUBLE CLICK with the mouse. They should be able to double click anywhere on the movie clip or even anywhere else... it doesnt matter really. The thing is, how do I listen for a double click in ActionScript??

There no method for the built in classes that I could find.

View Replies !    View Related
Double Click MC?
I am trying to create a function where if a user double clicks on a particular mc the mc will reset itself to its original zoom and position...however, I cannot get this feature to work correctly...when I do get the feature to work, I cannot drag and pan the mc...if the feature is disabled, I can drag and pan the mc...here is the code I came up with to double click reset the mc...but it does not work...can someone help?

[AS]
_root.click = false;
_global.CAD.onPress = function() {
if (!click) {
timer = getTimer()/1000;
_root.click = true;
}
else {
timer2 = getTimer()/1000;
if ((timer2-timer)<.25) {
_global.zoom._xscale = _global.zoom._yscale = mc_scale;
_global.container._x = mc_X;
_global.container._y = mc_Y;
} else {
timer = getTimer()/1000;
_root.click = true;
}
}
}

_global.CAD.onRelease = function() {
delete _global.CAD.onPress;
delete _global.CAD.onRelease;
delete _global.CAD.onReleaseOutside;
}
[/AS]

View Replies !    View Related
Double-click?
What is the best way/easiest way to do a double click in Flash? Mimicing a mouse double-click trigger/effect...

Thanks!

View Replies !    View Related
Double Click In AS2
makeing another version of an app i made in AS1 which implemented double clicking.

i was hoping to have a similar interface in the app i'm rewriting in AS2 without using modifying the moveiclip prototype which i'm assuming won't work anymore.

thnx

jaz

View Replies !    View Related
The Double Click
ActionScript Code:
on (press) {
    time = getTimer()-down_time;
    if (time<300) {
        trace("ok");
    }
    down_time = getTimer();
}


this is a double click effect
but i see the time alwasys equal 0
who can tell me the method of effect

View Replies !    View Related
On Double Click
Is there a way to write an "on(doubleclick)" command on a button? Any help will be appreciated.

View Replies !    View Related
Why Do I Have To Double Click?
I've been trying come up with a solution to make my mp3 player not autostart. I got help in this thread: viewtopic.php?f=5&t=15609&p=79397#p79397

After editing the code the player works and does not autostart anymore but you have to double click on the play button to start it. Why is this?

View Replies !    View Related
Double Click Actionscript
In my upcoming website:
http://www.nachorevolution.com/xex.html
On the yellow page the NR is dragable i figured that out. But now I want to make it so when one double clicks it will getURL. I can't figure out how to do this? any suggestions?

View Replies !    View Related
Double Click Button
Hi....all
Help me!!!!! Would you please tell me how to write scripts?
I've designed the button--so this button I'd like to do double click, then go to URL.....

Thanks a lot for your smart brain.

View Replies !    View Related
Double Click Action
I am currently working on a project for a mouse tutorial and want to have a button where when the user double clicks on it it comes up with a response. However as there is only a onClick command is there anyway to manufacture a doubleclick command. Any help would be appreciated.

Matt

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved