Re: Flash
Posted: Sun Aug 02, 2009 2:27 am
i have flash mx 2004. No, I cant open it. "Unexpected File Format" Can you place where what piece of code goes where, so when I place it, I know where it goes...I would appreciate it
Yeah I been searching, thats how I found tutorialized, before I was told about it. I cant wait too see your tutorials.Agent wrote:Yup nice stuff, yeah Spirit their are LOADS of tutorials out there - you can google most and find everything you need (also try http://www.flashkit.com)
- Except of course how to build Flash/php mmo's hehe- Most likely something me and halls are going to work on in the not too distant future.
Code: Select all
/*Navigaiton Engine*/
/*Setup*/
var maxspeed:Number = 4;
var startAngle:Number = 0;
var steeringFriction:Number = .50;
var groundFriction:Number = .98;
var speed:Number = 0;
var steering:Number = 0;
var moveX:Number = 0;
var moveY:Number = 0;
var radiance:Number = ((startAngle-90)/180)*Math.PI;
//
/* Create Map */
var map_mc:MovieClip = this.attachMovie("map_mc","map_mc",this.getNextHighestDepth());
map_mc._x = 0
map_mc._y = 0
//
/* Create Player */
var player_ship_mc:MovieClip = this.attachMovie("player_ship_mc","player_ship_mc",this.getNextHighestDepth());
player_ship_mc._x = Stage.width/2;
player_ship_mc._y = Stage.height/2;
//
/* Main Game Loop */
player_ship_mc.onEnterFrame = function() {
run();
};
function run():Void {
if (speed<0) {
speed = 0;
}
// left
if (Key.isDown(Key.LEFT)) {
steering -= 0.2;
}
// right
if (Key.isDown(Key.RIGHT)) {
steering += 0.2;
}
// maxsteering
if (steering > 1.5){
steering = 1.5;
}
if (steering < -1.5){
steering = -1.5;
}
// accelerate
if (Key.isDown(Key.UP) && speed<maxspeed) {
speed += 0.5;
}
// brake
if (Key.isDown(Key.DOWN)) {
speed *= 0.75;
}
// friction
speed *= groundFriction;
// ideal changes
var idealXMovement = speed*Math.cos(radiance);
var idealYMovement = speed*Math.sin(radiance);
// real change
moveX += ((idealXMovement-moveX)*steeringFriction);
moveY += ((idealYMovement-moveY)*steeringFriction);
// update
//trace("moveX "+moveX);
//trace("moveY "+moveY);
map_mc._x += moveX;
map_mc._y += moveY;
// rotate
radiance += (steering*speed)*.025;
player_ship_mc._rotation = radiance*180/Math.PI;
steering -= (steering*0.1);
}Agent wrote:Easy way to do it -SpiritWebb wrote:Is there a way when importing into flash, to make the background transparent? I have it as a .png file. I imported a ship to use as a sprite, and can't figure out how to get rid of the background, leaving just the ship.
Select the image on the stage: Go to Modify > Bitmap > Trace Bitmap - fiddle with the parameters to get the level of detail you want left in it ... then simply select the unwanted parts of the image such as white BG with your mouse and hit delete to get rid of themeasy.
Make sure you have not "broken" (with the break apart method) it apart - you need the original image straight from your library on stage - selected and then it should normally work.SpiritWebb wrote:Agent wrote:Easy way to do it -SpiritWebb wrote:Is there a way when importing into flash, to make the background transparent? I have it as a .png file. I imported a ship to use as a sprite, and can't figure out how to get rid of the background, leaving just the ship.
Select the image on the stage: Go to Modify > Bitmap > Trace Bitmap - fiddle with the parameters to get the level of detail you want left in it ... then simply select the unwanted parts of the image such as white BG with your mouse and hit delete to get rid of themeasy.
Agent: I went and tried it your way, and when I click modify > bitmap I cannot select trace bitmap. Its there, just not selectable.