Be a Supporter!

Simulate Click in AS3

  • 907 Views
  • 15 Replies
New Topic Respond to this Topic
chronicADRENLIN
chronicADRENLIN
  • Member since: Dec. 5, 2009
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Simulate Click in AS3 2010-05-12 23:38:04 Reply

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

Redshift
Redshift
  • Member since: Feb. 12, 2005
  • Offline.
Forum Stats
Member
Level 15
Programmer
Response to Simulate Click in AS3 2010-05-13 01:32:06 Reply

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
CrossFyre
CrossFyre
  • Member since: Feb. 21, 2010
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Simulate Click in AS3 2010-05-13 02:13:12 Reply

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.

milchreis
milchreis
  • Member since: Jan. 11, 2008
  • Offline.
Forum Stats
Member
Level 26
Programmer
Response to Simulate Click in AS3 2010-05-13 02:44:03 Reply

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

no

Hoeloe
Hoeloe
  • Member since: Apr. 29, 2004
  • Offline.
Forum Stats
Member
Level 37
Game Developer
Response to Simulate Click in AS3 2010-05-13 03:05:31 Reply

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.


Song of the Firefly is on Steam Greenlight and Kickstarter. Give them a look and support the project!
------------------------------

BBS Signature
henke37
henke37
  • Member since: Sep. 10, 2004
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Simulate Click in AS3 2010-05-13 09:22:35 Reply

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


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

milchreis
milchreis
  • Member since: Jan. 11, 2008
  • Offline.
Forum Stats
Member
Level 26
Programmer
Response to Simulate Click in AS3 2010-05-13 12:30:12 Reply

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.

Hoeloe
Hoeloe
  • Member since: Apr. 29, 2004
  • Offline.
Forum Stats
Member
Level 37
Game Developer
Response to Simulate Click in AS3 2010-05-13 17:20:25 Reply

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.


Song of the Firefly is on Steam Greenlight and Kickstarter. Give them a look and support the project!
------------------------------

BBS Signature
Version2
Version2
  • Member since: Sep. 24, 2003
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Simulate Click in AS3 2010-05-13 17:36:42 Reply

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.

milchreis
milchreis
  • Member since: Jan. 11, 2008
  • Offline.
Forum Stats
Member
Level 26
Programmer
Response to Simulate Click in AS3 2010-05-13 17:55:27 Reply

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.

Neo-13
Neo-13
  • Member since: Jun. 9, 2007
  • Offline.
Forum Stats
Member
Level 23
Programmer
Response to Simulate Click in AS3 2010-05-13 18:01:39 Reply

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
Redshift
Redshift
  • Member since: Feb. 12, 2005
  • Offline.
Forum Stats
Member
Level 15
Programmer
Response to Simulate Click in AS3 2010-05-13 18:49:24 Reply

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
CaptainPoncho
CaptainPoncho
  • Member since: Nov. 29, 2003
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Simulate Click in AS3 2010-05-13 21:29:04 Reply

Okay, this thread is taking a pretty douchey and unnecessary direction. Just because you've read the wiki article on Turing Machines or Undecidability doesn't mean you need to try to impress everyone with your knowledge.

On topic, original poster, you can create and dispatch your own MouseEvent. Check out the documentation for MouseEvent. Post back if you have issues.


BBS Signature
CrossFyre
CrossFyre
  • Member since: Feb. 21, 2010
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Simulate Click in AS3 2010-05-14 06:13:56 Reply

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.

milchreis
milchreis
  • Member since: Jan. 11, 2008
  • Offline.
Forum Stats
Member
Level 26
Programmer
Response to Simulate Click in AS3 2010-05-14 08:09:24 Reply

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

thus you limit "Everything" to "computational".

meneldil
meneldil
  • Member since: May. 27, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Simulate Click in AS3 2010-05-14 11:05:46 Reply

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!