Webmaster

Flash : Creating a dialog box
Contents ]
David Einhorn

Drag & Drop

The Flash Drag & Drop feature can be applied to a button, just like any other function. And we are naturally going to apply it to the Drag & Drop button:

  1. Double-click on the window symbol in the Library.

  2. You should now be able to see all your window elements.

  3. Select the Drag & Drop button.

  4. Select Modify > Instance.

  5. The Instance Properties window is displayed.

  6. Click on the + button of the Actions tab and select the Drag Movie Clip function.

  7. The script for the Drag & Drop function now appears.

  8. Click on the first script line (On (Press)) and select the Press option on the right-hand side of the window.

  9. The displacement action will only be set in motion when the mouse button is pressed.

  10. Select the last line of the script (End On) and click on the + button. Select the Drag Movie Clip function again.

  11. Select the Stop drag operation checkbox in the lower right-hand part of the window.

  12. Select the line (On (Release)) and tick the Release checkbox on the right-hand side of the window.

  13. The Drag & Drop action will end when the mouse button is released.



    Figure 3: The Drag & Drop script

You can test the result by selecting Control > Test Movie. The window will follow the mouse movements, but we can do a lot better!



  1   2   3   4