If you have any suggestions or comments, and would prefer using email, please contact me at:
gngabriel29[REMOVETHISANDREPLACEWITHYOU-KNOW-WHAT]ymail.com

October 24, 2008

Flash Buttons Create a Draggable Button

Filed under: Flash/Flash Buttons


Howdy folks, for those of you, who have often wondered how to create a button that can be dragged around the screen with the Flash program. Well, today, we’ll see exactly how to create such a draggable button.

1. create a rectangle shape, and convert this rectangle shape to a symbol of button type, and give it a name of btnDraggable, and click OK

Enter name for current selected instance

2. enter a name for this button instance, eg. box

3. select Window > Actions, to open Actions panel

click and drag on action to script area

4. click and drag the ‘on’ action, which is under Global Functions > Movie Clip Control, to the script area on the right, and double-click on the press parameter

script area should now look like below:

on(press){

}

5. click after opening bracket, and press Enter

click and drag startDrag action to script area

6. click and drag the ’startDrag’ action, which is under Global Functions > Movie Clip Control, to the script area on the right.

click Insert Target Path button

7. with cursor in the parameter of startDrag action, click ‘Insert a target path’ button

select button instance called box for Target Path

8. select the button instance called box (you gave the button instance name of box earlier), and click ok

script area should now look like below:

on(press){

startDrag(this);

}

9. click after the ending bracket

10. click and drag the ‘on’ action, which is under Global Functions > Movie Clip Control, to the script area on the right, and double-click on the release parameter

script area should now look like below:

on(press){

startDrag(this);

}

on(release){

}

11. click after opening bracket, and press Enter

12. click and drag the ’stopDrag’ action, which is under Global Functions > Movie Clip Control, to the script area on the right.

script area should now look like below:

on(press){

startDrag(this);

}

on(release){

stopDrag();

}

13. close actions panel

14. press Ctrl + Enter to Test Movie (you should now have a button which you can click and drag around)

Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>. I unfortunately do not have a spoiler-code, so be sure mark spoilers well.



Anti-spam measure: please retype the above text into the box provided.