Flash MX - Draggable Windows - Ari Efendi

Advertisement

ads

Hot

Post Top Ad

Your Ad Spot

Saturday, January 1, 2011

Flash MX - Draggable Windows

Everyone who owns a computer has clicked on a window and dragged it around the desktop. Well the same interaction can be achieved in Flash and I'm going to teach you how to do it.

Step 1

The first step is to create the window that you want to be draggable. Go to Insert > New Symbol > Movie Clip, and name it dragwin. Here you can create whatever type of window you want. First create an area for the content. Then create another area that can be clicked and dragged to move the window around. Make this area a Button (Insert > New Symbol > Button) and name it dragbtn. You can see my working example below.
 

Step 2

Right click on dragbtn and click Actions. Normal Mode: From that window click the + and go to Actions >, Movie Clip Control > startDrag and make sure the on() event is press. Next, click the + button again, and go to Actions >, Movie Clip Control > stopDrag, which the on() event should be release.

You should end up with this:

on (press) {
   startDrag ("");
}
on (release) {
  stopDrag ();
}


Step 3

Go back to your main stage, Scene 1, and from your library Ctrl + L, drag your dragwin movie clip on to your stage.

Step 4

Test your movie. Control > Test Movie or Ctrl + Enter. You should be able to click on the dragbtn and move the whole movie clip anywhere you drag it. If it doesn't work, please double check your steps.


Demikianlah artikel singkat ini dibuat semoga bermanfaat, jika ada kesalahan pada ide dan penulisan saya mohon maaf.

#Flash MX - Draggable Windows #cara Membuat Flash MX - Draggable Windows #tutorial Flash MX - Draggable Windows #langkah langkah Membuat Flash MX - Draggable Windows

No comments:

Post a Comment

Post Top Ad

Your Ad Spot