• home
  • forum
  • my
  • kt
  • download
  • Change cursor shape

    Author: 2009-07-09 09:39:27 From:

    This tutorial will show you how to create a custom cursor shape to replace the ugly standard cursor. In fact, it is just a very simple  tutorial with some code inside and an image of  the cursor!

    Before we get started, you need to find a nice cursor shape to play with. You can use the shape below (which is in png format)

    new_cursor

    Step 1: Create a new flash document and press Ctrl-J to open up the Properties box. Resize your document if necessary and increase the frame rate to 24 to make our new cursor moves smoothly

     Change_mouse_cursor_shape1

    Step 2: Go to File>Import>Import To Stage and load your cursor from the Import dialog then select your shape and press F8 to convert it into a symbol. Name it "New cursor" and select Movie clip type and choose its Registration at the center

    Change_mouse_cursor_shape2

    Step 3:  Click on your shape to select it. Press F9 to open up the Actionscript tab and type in

    onClipEvent(load)
    {
        startDrag(this,true);
    }

     

    Change_mouse_cursor_shape3

    This code tells the flash player that it has to use this shape as the cursor when this clip is loaded. This is the prototype of this function: startDrag(target, lockcenter)

    target: this is what will be used. In this case, this keyword indicates this movie clip will be used

    lockcenter: centers the movie clip or graphic to the mouse with its (the MC or graphic) center. This is done by entering either: true or false.

     

    Step 4:  Create a new layer and name it "action". Select the frame 1 of this layer and type in the Actionscript tab of this frame:

    Mouse.hide();

    this code will hide the standard mouse

    Now press Ctrl-Enter to test the result:

    discuss this topic to forum

    relation tutorial

    No information

    Category

      3D (36)
      Math Physics (18)
      3rd Party (10)
      Navigation (70)
      Actionscripting (228)
      Optimization (17)
      Animation (166)
      Projector (11)
      Audio (54)
      Special Effects (170)
      Backend (26)
      Text Effects (89)
      Drawing (34)
      Tips and Techniques (51)
      Dynamic Content (34)
      Tricks (8)
      Games (114)
      Utilities (24)
      Getting Started (99)
      Video (59)
      Interactivity (48)
      Web Design (37)

    New

    Hot