Height, Width, Background Color, placing objects in the room and such. Can anyone help me?
Create a sprite. var room:Sprite = new Sprite();
Get the graphics object. var g:Graphics = room.graphics;
Draw:
g.beginFill(0xFF0000, 1);
g.drawRect(0,0,800,600);
g.endFill();
Rinse and repeat. Children are added to "room" via room.addChild(chair);
, but they're created the same way.
There are lots of tutorials out there for how to start up a simple project.
http://www.senocular.com/flash/tutorials/as3withmxmlc/ http://www.senocular.com/flash/tutorials.php
If you use the free opensource IDE FlashDevelop, then you can just set the properties in the properties panel.
If you have a pure actionscript project you can use the SWF meta tag to define stage properties:
[SWF(width='800', height='600', backgroundColor='#000000', frameRate='30')]
Without more info, I can't really answer much more than that.
// An 800x600 black room with a red ball, you say?..
//
// This is written & tested in Flash CS4.
// Hopefully you just need some sample code to explore,
// also I recommend geting familiar with the AS3 language reference:
// http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/
// Background: a black rectangle.
var background:Sprite = new Sprite();
with( background.graphics ) {
beginFill( 0x000000, 1.0 );
drawRect( 0, 0, 800, 600 );
endFill();
}
addChild( background ); // add it to the stage
// Red ball.
var ball:Sprite = new Sprite();
with( ball.graphics ) {
beginFill( 0xff0000, 1.0 );
drawCircle( 0, 0, 100 );
endFill();
}
addChild( ball );
// Start the ball in the center of the room
ball.x = 400;
ball.y = 300;
// When we click the ball, move it to a new location.
ball.addEventListener( MouseEvent.CLICK, moveBall );
function moveBall( e:MouseEvent ) :void {
ball.x = Math.random() * 800;
ball.y = Math.random() * 600;
}
// Hope this helps... Flash & Actionscript 3 is a very rich environment,
// there's a lot to learn & discover. I learn new tricks with each project.
The first two articles of the Flash Adventure Game Tutorial, Creating a level and Loading a level, show you how to create a 2D map with free TaT level editor and then display it in a Flash game. Later articles cover adding items to the level and then loading them into a game.