all groups > flash actionscript > october 2006 >
You're in the

flash actionscript

group:

Simulating mouse movements and clicks


Simulating mouse movements and clicks Mud_Abbas
10/31/2006 7:58:52 PM
flash actionscript:
Hi,
I am working a Flash application, which has multiple layers in it. we
communicate between layers by means of messeging by means of
ExternalInterface.addCallback and fscommand.

I am writting a seperate module, that would be actually simulating user
actions on the flash application. I want to know what kind of messeges should I
send to the application so that the application capture it as a mouse click on
the buttons?
Re: Simulating mouse movements and clicks TimSymons
10/31/2006 8:12:08 PM
If you define your buttons to execute a function when clicked then you could
just call that function as a simulation of a mouse click. For example, it you
set up a button (or movieclip) like this:

myButton_btn.onRelease = myButtonFunction;

function myButtonFunction():Void {
// cod eyou want executed when button is pushed goes here
}

Then just calling the function directly as:

myButtonFunction();

Will look like a "simulation" of the button being clicked. Remember though
that if you call the function directly you will not have access to the calling
button as if you clicked on it. Meaning, that the key word "this" will not
refer back to a button unless you actually clicked the button.

Tim
Re: Simulating mouse movements and clicks Mud_Abbas
10/31/2006 8:24:38 PM
Well, it still require me to program directly in the actual module, which is
like impurifying it.

I am writing a totally seperate module, that loads whenever the actual module
loads, and the only way of communication is fscommand. There is a C++
appllication that send the messeges to proper places.

Well, lets say we dont have any of the module anyways.. I just wanna know what
messege should a container application pass to flash application that would
trigger as a mouse release on a particular button?
Re: Simulating mouse movements and clicks TimSymons
11/1/2006 4:16:33 PM
There is no method that you can use from Flash to do that unless you use the
method I descibed. I am not sure if you could write something in C/C++ to do it
or not. But unless your buttons in your modules are setup to execute a function
(in their own Flash file) you can't do what you are asking.

Tim
AddThis Social Bookmark Button