Builder

This is my block builder widgit. You can drag the objects from the palette at left to the play area at right and arrange them in a little scene. Select objects in the play area and press the manipulation buttons along the bottom to change their appearance.

There are two main classes doing the work here- one is for the source buttons in the left palette, the other is for the movable object that can be dragged and manipulated. The source button creates the new movie clip of the draggable object while making a few resets and housekeeping activities. As the new movie clip object is created, it's code starts up and attaches itself to the cursor and checks for appropriate placement when dropped. (you can drop the object outside the play area. It returns to it's original location.)

It's rather easy to add more objects to the widgit; I started with a set of 4 and increased to 12 after I got the code up and running. To create a new object, frames must be added on to certain clips and named in numeric order. Then, when the movie is played, the buttons base their display information off of the instance name they are identified with.

The selection box behaves on its own, checking for any object that is selected. (All objects send themselves as the selected object when they are clicked.) The buttons along the bottom have their code tacked directly to themselves, as my late night laziness factor kicks in and I can't convince myself to put their code into separate files when only the one buttons uses the code anyway. (The little objects on the left palette, on the other hand, are copies of the same object with different instance names and playing different images in different frames. I originally placed them on teh stage dynamically, but then got lazy and dropped them onto the stage so I could see how the layout felt.)



Copyright © 2010 | B. Steiner
britsteiner@gmail.com | updated: 2/6/2010

Portfolio Main Code Widgets Artwork Academic Writing Multimedia