Because of the constant attack by the wiki spam bots, accounts that are created and not used will be deleted. If you are a legitimate user, and your IP was blocked, please contact any active administrator - look at Special:RecentChanges and see who is busy fighting spam.

Mouse control

From SWFTools
Jump to: navigation, search

Mouse control are functions and instructions that enable the iteraction of the flash animation with the mouse.

Buttons

Buttons are widgets whose main purpose is being clicked by the mouse.

In the construction of a button, it's possible to define different images that the button takes, depending on the position of the mouse.

For example, the piece of code, below, creates a button:

  .button mybutton
    .show image1 as=idle
    .show image2 as=hover
    .on_press:
       do_something();
    .end
  .end

This button shows image1 (previously defined) when the mouse is away from it, shows image2 when the mouse hovers over it, and executes action do_something when clicked.

Global mouse behaviour

Function OnModeDown is an action that is executed whenever the mouse is pressed.

Variables _xmouse and y_mouse take the mouse position (x and y coordinates).