00:00
00:00
Newgrounds Background Image Theme

AllHailInsomnia just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Simulate Click in AS3

1,217 Views | 14 Replies
New Topic Respond to this Topic

Simulate Click in AS3 2010-05-12 23:38:04


Is there a way to simulate a left mouse click through code using AS3?

Response to Simulate Click in AS3 2010-05-13 01:32:06


Not possible.


#include <stdio.h>

char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";

main() {printf(p,10,34,p,34,10);}

BBS Signature

Response to Simulate Click in AS3 2010-05-13 02:13:12


At 5/12/10 11:38 PM, chronicADRENLIN wrote: Is there a way to simulate a left mouse click through code using AS3?

What do you mean by this? Do you mean a way to call events where you normally need to wait for a click, or to listen to an event, or to make it look like a mouse icon image is clicking when it isn't, or something completely different? More specific, please :D

At 5/13/10 01:32 AM, Nano256 wrote: Not possible.

In the world of software, EVERYTHING is possible :D We just need to figure out how.


My new blogspot website - coding and more :D

Hello, I'm an amateur coder looking to do some free, simple work to get some experience.

Response to Simulate Click in AS3 2010-05-13 02:44:03


At 5/13/10 02:13 AM, CrossFyre wrote: In the world of software, EVERYTHING is possible :D

no

Response to Simulate Click in AS3 2010-05-13 03:05:31


At 5/13/10 02:44 AM, milchreis wrote:
At 5/13/10 02:13 AM, CrossFyre wrote: In the world of software, EVERYTHING is possible :D
no

Every eventual OUTCOME is possible, but it may be achieved through using roundabout methods.

In this case, rather than simulating a click, perhaps skip straight to simulating events triggered by the click.


BBS Signature

Response to Simulate Click in AS3 2010-05-13 09:22:35


It is very possible, just dispatch a MouseEvent object yourself.


Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.

Response to Simulate Click in AS3 2010-05-13 12:30:12


At 5/13/10 03:05 AM, Hoeloe wrote:
At 5/13/10 02:44 AM, milchreis wrote:
At 5/13/10 02:13 AM, CrossFyre wrote: In the world of software, EVERYTHING is possible :D
no
Every eventual OUTCOME is possible, but it may be achieved through using roundabout methods.

Software is always limited to its hardware.

Response to Simulate Click in AS3 2010-05-13 17:20:25


At 5/13/10 12:30 PM, milchreis wrote:
At 5/13/10 03:05 AM, Hoeloe wrote:
At 5/13/10 02:44 AM, milchreis wrote:
At 5/13/10 02:13 AM, CrossFyre wrote: In the world of software, EVERYTHING is possible :D
no
Every eventual OUTCOME is possible, but it may be achieved through using roundabout methods.
Software is always limited to its hardware.

True, but we are talking in THEORY here.

Take for granted that your hardware can cope with whatever you throw at it, then everything becomes possible. To make it work in the real world, it's just a case of optimising.


BBS Signature

Response to Simulate Click in AS3 2010-05-13 17:36:42


You guys are getting way off topic here.

If you're talking about making a macro program in AS3 that can left click outside of a flash window, then no, you can't do that.

If you're talking about clicking inside your flash app, go read up on addEventListener and MouseEvent.Click.

Response to Simulate Click in AS3 2010-05-13 17:55:27


At 5/13/10 05:20 PM, Hoeloe wrote: True, but we are talking in THEORY here.

I'm not, neither should you.
Read up the the line I quoted: this absolute statement is plain false.

Response to Simulate Click in AS3 2010-05-13 18:01:39


At 5/13/10 05:20 PM, Hoeloe wrote:
At 5/13/10 12:30 PM, milchreis wrote:
At 5/13/10 03:05 AM, Hoeloe wrote:
At 5/13/10 02:44 AM, milchreis wrote:
At 5/13/10 02:13 AM, CrossFyre wrote: In the world of software, EVERYTHING is possible :D
no
Every eventual OUTCOME is possible, but it may be achieved through using roundabout methods.
Software is always limited to its hardware.
True, but we are talking in THEORY here.

Take for granted that your hardware can cope with whatever you throw at it, then everything becomes possible. To make it work in the real world, it's just a case of optimising.

Not everything is possible. There are many problems that computers cannot solve. Infinitely many I think (can't remember if this is the case or not).


BBS Signature

Response to Simulate Click in AS3 2010-05-13 18:49:24


In reality, the only limitation of any computer is its memory. Apart from that, you can do ANYTHING that a turing machine can do, assuming you have enough memory to do it. With hardware, you can have a program run faster by incorporating previously software based tasks into a faster hardware implementation. (but of course, clock speed does not matter when it comes to what a program can do)

Flash can do any computation that a turing machine can do within memory constraints, as AS3 is turing complete. However, flash code is being executed at a higher level (interpreted by flash player) and therefore you cannot do anything that flash player does not allow. The only exception of doing something that flash player normally won't do is by finding an exploit in flash player that allows high level flash byte code to utilize such an exploit to make flash player (lower level program) behave differently in some fashion which can be dangerous.


#include <stdio.h>

char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";

main() {printf(p,10,34,p,34,10);}

BBS Signature

Response to Simulate Click in AS3 2010-05-14 06:13:56


Hahaha oh wow, did this thread go to hell or what?

I don't even think the OP has come back with a definite answer as for what he wants to do yet ...

Either way, all the most likely answers have been given, so good luck OP.

... And yeah, everything is possible :P


My new blogspot website - coding and more :D

Hello, I'm an amateur coder looking to do some free, simple work to get some experience.

Response to Simulate Click in AS3 2010-05-14 08:09:24


At 5/13/10 06:49 PM, Nano256 wrote: computation

thus you limit "Everything" to "computational".

Response to Simulate Click in AS3 2010-05-14 11:05:46


At 5/13/10 09:22 AM, henke37 wrote: It is very possible, just dispatch a MouseEvent object yourself.

Just quoting the right answer in the sea of offtopic.


Indescriptive topic names have left me in despair!