|
-
Creating a Room Editing Application
Hey guys, I'm a relative newb to Flash and I'm having difficulty with how I would go about creating a room editing application.
My idea is to be able to have a number of different objects on the side of the stage, kind of in a toolbar, then to be able to click (and thus select) one of them and place it another area in the room with another click (basically placing it, deselecting it and fixing it in place where I clicked).
I'd then like to be able to re-click it and reposition it by dragging, if I so wish.
I know it's possible, I just have no idea how to go about it, so any help would be appreciated
-
Welcome to Flash. It is a special kind of wonderful torment, like eating hot chillies.
In CS4, Draw something. Select the drawing, right click it and select "convert to movieclip."
Double click your newly minted movieclip. Select the drawing and move it so the little cross (registration point it's called, I think) is in the middle of the drawing.
Click "scene 1" on the movie navigation bar with the blue arrow. This will exit you out of your movieclip.
Click once to select you movieclip. Open the "properties window" using the Window menu at the top.
In the properties window next to the gear shaped icon, type "chair".
Click on frame 1 on your timeline. Open the "actions" window. Inside the actions window for frame 1 paste the following:
chair.addEventListener(MouseEvent.MOUSE_DOWN, dragIt);
chair.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function dragIt(event:MouseEvent):void {
event.target.startDrag(true);
}
function dropIt(event:MouseEvent):void {
event.target.stopDrag();
}
chair.buttonMode = true;
If it doesn't work, create a new AS3 file and try again, step by step exactly. once you have it working, create new objects with new names, and try modifying the code to work for the new objects in your room. Start hunting for tutorials and learn the basic jargon you need to find code examples to lern from. Video tutorials can help you learn all the tool options.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|