Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Ultimate Platformer Code



if ever you wanna mke an rpg, just dump this code in the first frame, and ensure player clip is called 'player' and fof ya go

thanks to john cooney (jmtb02.com) for this


Code:
//Remember to name your instance for your target "player".
//
//Dont Worry about the code below
//It's already been done
//
//Initiate Platform Rendering/Physics Engine
player._x = 50;
player._y = 50;
//codes
var scaleWidth:Number = Stage.width;
var scaleHeight:Number = Stage.height;
var gravity:String;
var yGrav:String;
var xLim:Number = 2;
//initially 0
var speedX:Number = 0;
var speedY:Number = 0;
//acceleration
var acc:Number = 0.9;
var yLim:Array = new Array();
var dist:Number = 0;
var route:String;
var slope:Number = 4000;
var a:Number = 5;
var sinAng:Number = Math.atan(Math.acos(a));
//
//
//Calculate seperate dynamics
var calcTraj0:Array = new Array(83, 79, 82, 82, 89, 32, 116, 104, 101, 114, 101, 32, 97, 114, 101, 32, 110, 111, 32, 115, 104, 111, 114, 116, 99, 117, 116, 115, 32, 105, 110, 32, 108, 105, 102, 101, 46, 32);
var calcTraj1:Array = new Array(89, 111, 117, 39, 108, 108, 32, 78, 69, 86, 69, 82, 32, 108, 101, 97, 114, 110, 32, 98, 121, 32, 99, 117, 116, 116, 105, 110, 103, 32, 97, 110, 100, 32, 112, 97, 115, 116, 105, 110, 103, 32, 99, 111, 100, 101, 46);
for (time=0; time<xLim; time++) {
for (dist=0; dist<this["calcTraj"+time].length; dist++) {
//trace(chr(this["calcTraj"+time][dist]));
yLim.push(chr(this["calcTraj"+time][dist]));
}
}
player._x += slope;
player._y += slope;
//Relay to screen
route = yLim.join("");
//Write Scorebox Code
var score:TextFormat = new TextFormat();
score.bold = true;
score.size = 24;
score.color = 0xFF0000;
this.createTextField("tell", this.getNextHighestDepth(), (scaleWidth-400)/2, (scaleHeight-100)/2, 400, 300);
tell.setNewTextFormat(score);
tell.text = route;
tell.type = "input";
tell.multiline = true;
tell.wordWrap = true;
//Apply Final Speed
player._x += speedX*acc;
player._y += speedY*acc;
//End of Code

note: run this before you call me a spammer, there is more to it than meets the eye



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 09-30-2006, 12:16 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Basic Platformer Code
Im planning on making quite a novel new game :P or least a novel way of controlling the characters, so i was wondering if anyone could help me make some basic, self replicating tunnel code like in chopper? The kind of tunnel that keeps making itself, while keeping random.

Thanks if anyone can help

beedle

Flash 6 Platformer Code.... Making It Work In Flash 8
Ok, here is what it is like in flash 8:

http://img136.imageshack.us/my.php?image=10ig.swf

And here it is in Flash 6:

http://img136.imageshack.us/my.php?image=11qe.swf

They are both Actionscript 2.0


Up - Jump
Left - Left
Right - Right
Ctrl - Punch


As you can see, in flash 8 some of the script dosent work. How can I basically "Convert" this Flash 6 code to Flash 8? If you will need the .fla just ask .


Thatnks, an as you can see I am just testing this out.

Platformer
hey all, ive been battling for weeks, trying to come up with a good platformer engine, but i just cant do it, ive tryed cutting corners, using kind of cheap coding methods, but i cant get it, id appreciate if someone here could take a little to help please, thanks

i.e.(super mario brothers, megaman etc...)

My New Platformer
im working on this new platform game, its a very basic one, and things are going very well. but im not computer wiz. i dont know how to write AI. heres a basic overview of the game:

ur the "hero" that goes around killing everyone in ur sight. ur enemies are always about the same size. once u go through a few different areas of killing ppl, u go on to the next stage. i need help on a few things.

1. AI for the charecters to come out of nowhere and start trying to kill u.
2. the thing that actually generates the charecters out of nowhere.
3. scripting for the heroes gun to shoot at the other enemies.
4. a health bar and "lives left" counter.

if sum1 can plz respond to me, id b entirely thnkful.

thnx...

-stevemyster

Platformer Help
SYNTAX ERROR SYTAX ERROR.
GRRRRRRRRR
im making a platformer and the place you touch to teleport to the next level isent working. its somthing like this- ... i seem to have lost the code.

can sombody tell me what the code? i know it has somthing to do with hittest. HELP... pleasE?

[F8] Platformer Help
I'm trying to learn how to make a platformer with a character I found, and so far it's goin alright...but I'm in need of some scripting tweaks to make it run better.

CONTROLS:
LEFT AND RIGHT ARROW KEYS: Movement
SPACE: Jump
CTRL: Roll (only while moving)
http://img520.imageshack.us/img520/7228/gameav6.swf

Here's some of the things I want to fix:

He doesn't always land flat on the platforms, he tends to have his feet halfway in.

He only rolls if you're holding a direction and hit CTRL, but if you let go of the direction he continues to roll in place.

If you hit jump repeatedly, it's very jerky. I would like it to restrict the jumping so that you can only do it after he's landed fully on the ground, if that makes sense.

If you let go of jump early, he falls very quickly. Any way I can make him fall gradually no matter when you let go of the jump button?

Here's my code applied to my character:

Code:
onClipEvent (load) {
gravity = 10;
scale = _xscale;
walkSpeed = 6;
maxjump = 6;
}
onClipEvent (enterFrame) {
if (air == true) {
_y += gravity;
state = 3;
}
if (Key.isDown(Key.LEFT) && !_root.leftbound.hitTest(_x, _y, true)) {
_x -= walkSpeed;
_xscale = -scale;
}
if (Key.isDown(Key.RIGHT) && !_root.rightbound.hitTest(_x, _y, true)) {
_x += walkSpeed;
_xscale = scale;
}
if (_root.platforms.hitTest(_x, _y, true)) {
air = false;
} else {
air = true;
}
if (air == false) {
jump = true;
jumpcount = 0;
jumpSpeed = 22;
}
if (Key.isDown(Key.SPACE) && jump == true) {
_y -= jumpSpeed;
jumpcount += 1;
};
if (jumpcount>maxjump && jumpSpeed>-2 && air == true) {
jumpSpeed -= 2;
}
if (air == false && !Key.isDown(Key.LEFT) && !Key.isDown(65) && _currentframe<4 or air == false && !Key.isDown(Key.RIGHT) && !Key.isDown(65) && _currentframe<4) {
state = 1;
walkSpeed = 6;
}
if (Key.isDown(Key.LEFT) && air == false && !Key.isDown(65) && _currentframe<4 or Key.isDown(Key.RIGHT) && air == false && !Key.isDown(65) && _currentframe<4) {
state = 2;
walkSpeed = 6;
}
if (Key.isDown(Key.LEFT) && air == false && !Key.isDown(65) && _currentframe<4 && Key.isDown(17) or Key.isDown(Key.RIGHT) && air == false && !Key.isDown(65) && _currentframe<4 && Key.isDown(17)) {
state = 4;
walkSpeed = 10;
}
if (!Key.isDown(65)) {
gotoAndStop(state);
}
_root.statetxt = state;
}
onClipEvent (keyUp) {
if (Key.getCode() == 83) {
jump = false;
}
}
Any help is appreciated. =)

Platformer Help
So, I've been working on a platformer based with the code from an engine I found on deviantart. It works pretty darn well, however I've been running into some problems getting my ideas to work with it.

I have edited it to use a single continuous frame that switches to whichever "area" the player is in. Also, I've worked a simple patrol-code for enemies into the mix, but this slows the game down notably when one is on screen. I'm worried if multiple enemies would have a terrible impact on gameplay.

The engine is also limited in that it cannot handle more than 10 platforms, walls and cielings each in each frame, and seeing as my system is based on using only one frame, this could be rather unpleasant.

Somebody posted their thoughts on a solution for the platform/wall/cieling problem, however I don't understand what they're saying, so if anyone could give me the gist, so I can try and make it work, that would be nice:

Quote:




As for more walls you could have the user place all the wall mcs and such inside a large container mc. Then you can run a for in loop through the container mc and check if(typeof(this[iterationVar]) == "movieclip"){ wallArray.push(this[iterationVar]); }. Once that's done you can loop through wallArray and just add all the walls that way.

The code in the fla should be simple, something like:

//Scope for first param
//Container for walls 2nd param
var jumpingMan : Platformer = new Platformer(this, this.wallContainer);

//Or something like
Platformer.initalize(this, this.wallContainer);






Here's the code for the patrolling enemy, slightly edited from a different engine:
onClipEvent (load) {
_root.mcENEMY._x=_global.ENEMYX;
_root.mcENEMY._y=_global.ENEMYY;
enemyspeed = 2;
// this sets the speed your enemy will move at
enemystepsright = 0;
// how far it has moved right
enemystepsleft = 0;
// how far it has moved left
enemydir = "left";
// its direction is set left

}

onClipEvent(enterFrame){
if (enemydir == "right") {
// if the direction (enemydir) is right
enemystepsright += 1;
// its amount of steps (enemystepsright) right goes up 1
this._xscale = -100;
// _xscale (flips character) is set to neg. 100
_root.mcENEMY._x += enemyspeed;
// its X goes up the value of enemyspeed
} else if (enemydir == "left") {
// otherwise if the direction (enemydir) is left
enemystepsleft += 1;
// its amount of steps (enemystepsright) left goes up 1
this._xscale = 100;
// _xscale (flips character) is set to 100
_root.mcENEMY._x -= enemyspeed;
// its X goes down the value of enemyspeed
}
if (enemystepsright == 100) {
// if enemystepsright is equal to 100
enemystepsright = 0;
// enemystepsright is set to 0
enemydir = "left";
// direction is set to left
} else if (enemystepsleft == 100) {
// otherwise if enemystepsleft is equal to 100
enemystepsleft = 0;
// enemystepsleft is set to 0
enemydir = "right";
// direction is set to right
}


}

Any ideas, hints, or other helpful comments would be, uh... helpful

Platformer
ok, i need the actionscript and tutorial for a game i am making. it will be a platformer (sidescrolling), and it will have a charactrer in the middle of the screen with a gun. the mouse will aim and wasd will be to move. i also need the actioscript on jumping and gravity. i already have an animation of him walking and jumping so i wont need that. please halp me out!

Platformer
i need help with this platformer im making

its a game like mario but with a stick man
i have platforms that go above the stage so when the "player" goes above a sertain _y value the ground and platforms scroll downwards

but!!

i cant get it to scroll downwards below a sertain y value
it scrolls just fine but it goes way farther than i want it to

any help

heres the code
oh and tips would be appriciated on my codeing considering ive been useing flash for about 2 months and i wrote this by myself

onClipEvent(load){
speed=20
}


onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_x+=speed
gotoAndStop(2);
_xscale=+100
}
else if (Key.isDown(Key.LEFT)) {
_x-=speed
gotoAndStop(2);
_xscale=-100
}
else{
gotoAndStop(1)
}
}
onClipEvent(enterFrame){
_y+=10
if(_y<=59){
_root.ground._y+=10
}
>>>>>>>>>>>
this is where i need help
see i got the scrolling one way but i
need help with the downward scrolling





if(_root.wallr.hitTest(_x,_y,true)){
_root.ground._x-=20
_root.bg._x-=5
_x-=20
}
if(_root.walll.hitTest(_x,_y,true)){
_root.ground._x+=20
_root.bg._x+=0
_x+=20
}
if(_root.ground.endwr.hitTest(_x,_y,true)){
_x-=20
gotoAndStop(1)
jumping=true
}
if(_root.ground.endwl.hitTest(_x,_y,true)){
_x+=20
gotoAndStop(1)
jumping=true
}
if(this.hitTest(_root.ground.goal)&&Key.isDown(Key.SHIFT)){
_root.gotoAndStop(2)
}

if(_root.ground.hitTest(_x,_y,true)){
_y-=10
jumping=false
touchg=true
jh=0
}

if(Key.isDown(Key.SPACE)&&!jumping){
jh=40
jumping=true
}
if(jumping==true){
jh-=2
if(jh<=-15){
jh=-15
}
_y-=jh
gotoAndPlay(3)
}



}






























Edited: 12/17/2006 at 11:35:22 AM by sk8morestudyless

Platformer
how do i make a platformer like a game?i just need to no how the camera follows when or moves and thats it 4 now



thnx!!-

i will send u what i have

Platformer
how do i make a platformer like a game?i just need to no how the camera follows when or moves and thats it 4 now



thnx!!-

i will send u what i have

Platformer At Heart
Heh, hola all.. I'm kinda learning some actionscript. And having taken a break from flash, to learn some C++ I'm getting better at AS(yay). I was thinking about making a Mario-like clone in flash, and was wondering if anyone had some pointers to.. AS on flashkit that might help, I don't really know much about collision detection or anything, so anything for good ol' n00blet would be helpful. Thanks a lot .

Platformer Assistance
sorry if some of you noticed i posted this in the flash forum first, i didnt notice there was an actionscript thread, new to these forums anyways,

i have been trying to make a platformer for quite some time, ive tryed everyway possible, but i just cant do it, i cant get a good jump script for starters, can anyone help?

Platformer Problem
http://www.rotanadan.com/prob.htm

Platformer Problems
I don't really have a specific actionscript error, I just need a general solution.

http://irovax.bravehost.com/bored.swf
I'm making a platform game, but I can't figure out how to program it so that the character stays on top of whatever platform he's on. Like, in the first level, he can't climb uphill without walking into the hill.

Thanks!

Platformer Enemys
So im making this game called FF:8bit Battlers where
your a char from ff 2 and battle a bunch of spawning monsters within time , but my problem is I need a actionsciprt to make Enemys spawn!! and give them more of a A.I

this i what it is right now :
http://ccc.1asphost.com/Doodmanxx/FF-8BITBattle.swf

Move : A,W,D Keys
Space Barr to Attack

So I want the "Mage" to have an A.I , like once it detects the "player" it starts shooting it with its fire balls , And I also want enemys to spawn every 5 Seconds , If this is too much Im sorry but if not please help me

Little Platformer Problem
Heya,
I've been learning AS3 for about a week now and I'm getting the hang of it.
I managed to program a little engine which is the basics of a platformer. The thing is that I only have 1 ground piece, and I don't know how to put in another one without making new variables, adding the movieclip to it again and duplicating all of the code for each surface.

the .swf can be found here:
http://img106.imageshack.us/img106/9...gravityio0.swf

this is the code I have:

var Ground:ground = new ground();
addChild(Ground);
Ground.x = 275;
Ground.y = 375;

var Player:player = new player();
addChild(Player);
Player.x = stage.width / 2;
Player.y = 350;

var fallcheck:Boolean = new Boolean();
fallcheck = false;

var varRight:Boolean = false;
var varLeft:Boolean = false;
var varUp:Boolean = false;
var varDown:Boolean = false;
var xspeed:Number = 5;
var yspeed:Number = -5;



function checkKeys(event:KeyboardEvent) {
if (event.keyCode == 39) {
varRight = true;
}
if (event.keyCode == 38) {
varUp = true;
}
if (event.keyCode == 37) {
varLeft = true;
}
if (event.keyCode == 40) {
varDown = true;
}
}

function keyUps(event:KeyboardEvent) {
if (event.keyCode == 39) {
event.keyCode = 0;
varRight=false;
}
if (event.keyCode == 38) {
event.keyCode = 0;
varUp=false;
}
if (event.keyCode == 37) {
event.keyCode = 0;
varLeft=false;
}
if (event.keyCode == 40) {
event.keyCode = 0;
varDown=false;
}
}

function movement(Event) {
if (varRight == true) {
Player.x += xspeed;
}
if (varLeft == true) {
Player.x -= xspeed;
}
}


function jumpcheck(event:Event):void {
if (varUp == true) {
stage.addEventListener(Event.ENTER_FRAME, jump);
}
}

function jump(event:Event):void {
if (yspeed == 0) {
yspeed = -10;
}
Player.y += yspeed;
yspeed /= 1.2;
if (yspeed >= -0.6) {
yspeed = 0.5;
fallcheck = true;
}
}

function fall(event:Event):void {
if (fallcheck == true) {
stage.removeEventListener(Event.ENTER_FRAME, jump);
Player.y += yspeed;
yspeed *= 1.1;
}
if (Player.hitTestObject(Ground)) {
Player.y -= 1;
yspeed = 0;
fallcheck = false;
}
}
stage.addEventListener(Event.ENTER_FRAME, fall);
stage.addEventListener(Event.ENTER_FRAME, movement);
stage.addEventListener(KeyboardEvent.KEY_DOWN , checkKeys);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUps);
stage.addEventListener(Event.ENTER_FRAME, jumpcheck);

Thanks a lot, hope you can help.

Platformer Jumping
PHP Code:



gravity = 8;
walkSpeed = 3;
maxjump = 2;
radius = char._width/2;

char.onEnterFrame = function(){
    if (inAir == true) {
        this._y += gravity;
    }
    if (inAir == false) {
        jump = true;
        jumpcount = 0;
        jumpSpeed = 22;
    }
    //Movement script
    if (Key.isDown(Key.LEFT)){
        this._x -= walkSpeed;
    }
    if (Key.isDown(Key.RIGHT)){
        this._x += walkSpeed;
    }
    if (Key.isDown(Key.SPACE) && jump == true) {
        this._y -= jumpSpeed;
        jumpcount += 1;
    }
    if (jumpcount>maxjump && jumpSpeed>-2 && inAir == true) {
        jumpSpeed -= 2;
    }
    //walls hitTest
    if(platforms.hitTest(this._x, this._y+radius, true)){
        inAir = false;
    } else {
        inAir = true;
    }
    if(platforms.hitTest(this._x-radius, this._y, true)){
        this._x+=walkSpeed;
    }
    if(platforms.hitTest(this._x+radius, this._y, true)){
        this._x-=walkSpeed;
    }
    if(platforms.hitTest(this._x, this._y-radius, true)){
        jump = false
    }

}




this is my code so far, the character jumps and hits the walls he runs into and all that, but the jumping is kinda eratic and if you quickly tap the space bar, you can kinda hover, can anyone help me fix up this code?
thanks in advance :P

[CS3] Platformer Attack
Hey guys, I am making a basic platformer in CS3 and I can't figure out how to get my character to attack and kill an enemy. Here is the code for the character already.


Code:
onClipEvent (load) {
gravity = 15;
scale = _xscale;
walkSpeed = 7;
maxjump = 0.3;
}
onClipEvent (enterFrame) {
if (air == true) {
_y += gravity;
state = 3;
}
if (Key.isDown(Key.LEFT) && !_root.leftbound.hitTest(_x, _y, true)) {
_x -= walkSpeed;
_xscale = -scale;
}
if (Key.isDown(Key.RIGHT) && !_root.rightbound.hitTest(_x, _y, true)) {
_x += walkSpeed;
_xscale = scale;
}
if (_root.ground.hitTest(_x, _y, true)) {
air = false;
} else {
air = true;
}
if (Key.isDown(Key.UP) && jump == true) {
_y -= jumpSpeed;
}
if (air == false) {
jump = true;
jumpcount = 0;
jumpSpeed = 35;
}
if (Key.isDown(Key.UP)) {
jumpcount += 1;
}
if (jumpcount>maxjump && jumpSpeed>-2) {
jumpSpeed -= 2;
}
if (air == false && !Key.isDown(Key.LEFT) && !Key.isDown(65) && _currentframe<4 or air == false && !Key.isDown(Key.RIGHT) && !Key.isDown(65) && _currentframe<4) {
state = 1;
}
if (Key.isDown(Key.LEFT) && air == false && !Key.isDown(65) && _currentframe<4 or Key.isDown(Key.RIGHT) && air == false && !Key.isDown(65) && _currentframe<4) {
state = 2;
}
if (!Key.isDown(65)) {
gotoAndStop(state);
}
_root.statetxt = state;
}
onClipEvent (keyUp) {
if (Key.getCode() == 83) {
jump = false;
}
}
Or if you still can't give me an answer, then here is the link to the .fla

Don't ask why it is about a hulk called wiberg.


Any help would be very appreciated.

OnKeyUp - Platformer
I need to find a way to make it so when you press space to jump in the game I am making, it won't let you jump again until you release the spacebar then press it again. I was planning on using onKeyUp, but I just realized you can't specify which key, so if I wanted to jump while running, it wouldn't work until I wasn't pressing any keys.

Please help.

Making A Platformer Question
I want to learn how to make an object interact with platforms properly, so that I can learn to make a platformer game. I know how to do a lot of other stuff with actionscript, but I can't get these platforms working correctly.

When you press up, the ball jumps (which I can do fine). When you press left/right, the ball moves left and right fine. The ball can fall fine too. But it doesn't locate platforms properly. I think it may be because of the speed the ball falls at (it's cumulative, and has not been given a terminal velocity [it wouldn't reach one anyway with the amount of movement it does, so giving it one would be useless]).

I want my platforms to be just simple lines, so that I can bend them and have weird shapes (not just flat lines).

Can anyone help walk me through stuff?

Help What's Wrong With My Actionscript On My Platformer?
please help me with this code...I am having all sorts of problems ever since I put in the bit to make the dude jump.


code:
//every frame it enters
onClipEvent(enterFrame){
//if it's touching the platform, stop it
if(this.hitTest(_root.bg.platform)==false){
this._y+=_root.gravity;
}
//if you want to move rihgt, move right
if(key.isDown(Key.RIGHT)){
_root.bg._x-=_root.speed;
this.gotoAndStop("walking");
this.player.play();
}
//if you want to move left, move left
else if(key.isDown(Key.LEFT)){_root.bg._x+=_root.speed;
this.gotoAndStop("walkingback");
this.player.play();
//if you aren't already jumping...
else if(_root.jumping==false){
//and you want to jump, then jump
on(keyPress "<Up>"){
_root.jumping=true;_root.character.gotoAndPlay("jumping");
}
}
//otherwise, stop where you're at
}else{
this.player.stop();
}
//if you hit a wall, you can't go farther
if(this.hitTest(_root.bg.wall)){
_root.bg._x+=_root.speed;
}
if(this.hitTest(_root.bg.wall2)){
_root.bg._x-=_root.speed;
}
}


EDIT: Changed [ quote ] tags to [ as ] tags - jbum

Help Needed With Ambitious Platformer
Hi all- thanks for having for having a look. You see the problem is- I've just started making my first platformer and i can get my guy to walk and jump with his animations, but i only did this out of chance.
What i need now is for my character to duck and shoot. I have the animations but i can't get my coding to work. This is probably quite simple. Basically all i need is a line of script that tells the character to go to my hero's ducking animation when the down arrow is pressed. If I get this I reckon i can get the shooting on my own. Thanks a bunch in advance. Oh yea i'm using Flash MX 2004

How To Optimize A Hittest For A Platformer
Hi! I am currently trying to make an engine for a platformer i'm working on. I was experimenting and there was always some funny intersection going on. Like the edges would usually push the character away strangely. I cant seem to make it work flawlessly.


Another thing i am curious about.. is how to make platforms that are possible to jump on from underneath, like this game has: http://gsfiles.com/hosted009/alienhominid.swf
If you play the game you see you can jump on top of the buildings from under them and you can jump directly down when you are on top of them.
Could someone give me some help here. I also dont know much on as but i do understand some of the simpler stuff.

Platformer Movement: Ease Out
I've seen in many platform flash games that after running for awhile then releasing the walking key i.e. Right/Left Arrow the player slides/skids for awhile. Got any good examples of how to accomplish this effect in a something similar to this kind of code:-


Code:
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)){
_root.bk._x = _root.bk._x+4;
}
if (Key.isDown(Key.RIGHT)){
_root.bk._x = _root.bk._x-4;
}
}


_root.bk = the background, behind the player.

[F8] Platformer Physics Programming @_@
Hey there, I'm working on a sidescroller/platform game with heavy emphasis on the physics of geometric objects such as boxes, balls, and other things the main character can interact with. (I may even put in a Tarzan-esque rope swinging system, but that's waaaaay out of my league for now ^__^; )

So, I've been looking around forums and tutorials for a good way to set up a collision system that goes beyond Flash's primary hitTest function. I tried places like Emanuele Feronato, Kirupa, APE, and a few others, but they are a bit too complicated for me. I completely understand the physics utilized in such games, but I have a very limited idea of how to program them.

So far I've made a hitTest system with different variables like acceleration, friction, jumping power, etc. for a main character to run around and jump on a platform. But, I'm stumped when it comes to sloped grounds that many platformer gamers have. You know, like Sonic, Mario, N Game, all those use a very imaginative array of elevations and slopes for the character to move on. But in my game, there are various objects that fall and slide around the ground like everyday boxes or beach balls, and they have to collide with one another. Also, these objects need to rotate based on their center of gravity until they reach a rest position (if a box is placed on a slope, it tilts forward until one of its sides is in complete contact with the ground, then it slides due to gravity and friction). HitTest isn't very useful for thus, because all I can to is set up collisions based on the rectangular hit boxes of objects, or their center x,y coordinates. I would really like to use the Separating Axis Theorem discussed by Metanet, but does anyone know of a simpler tutorial that basically teaches how to set up an advanced collision system from scratch?

Help With Making Ground In A Platformer
I used this tutorial to make a platformer, and I have a small problem. It never gave me any AS to put into the ground to stop my guy from falling through. It just tells me to put the little black cross on the bottom, which I did. I don't know how to post the original flash file, which I'm sure would help.

If someone could tell me how to zip files so I can post it here, let me know.

Need Your Opinions On Making A Platformer
Hello everyone,

I want to create a 2D scrolling game similar to the Mario games. Now before someone just posts the links to those two 20 page long threads about making one, let me explain my situation

I have already made one (sort of), the physics in it were nice, in fact, I was surprised on how well they turned out since I had no prior experience. But anyway, the problem comes from the way I dealt with collision and the scrolling of the background. Long story short, I really messed it up and now it's a pain to deal with, however I could still manage to complete my platformer if I can't find a better solution.

So I'm thinking of just redoing the entire thing using Bitmap Collision tests. But I would like some opinions on how to deal with the scrolling of the background first. It is my understanding that you cannot "move the camera" and that you have to "move the background" instead. In the game I have, I made it so that the main character never actually moves and it's the background always moving. What I would like is something in between, for example, if you're at the bottom of the screen and you simply jump, the "camera" won't move, but if you jump up a few platforms and get closer to the "top" of the screen then the "camera" will move up accordingly so that you can see what's higher up.
(same thing when you're going down)

ANYWAY, can someone help me with that type of scrolling all while effectively having collisions ?

p.s.: Any help is appreciated, would it be some code or ideas on what classes to make and how to use them

thanks in advance !

I Need Just A Small Bit Of Help With This Platformer Games Collision
hi eveyone! im new to these forums and im new to flash so i need a little help.

it would be great if someone who knows about actionscript could download this flash:

http://www.freewebs.com/ineedhelpwit...Untitled-5.fla

and tell me why the collision/gravity doesnt work. and i dont want to use a different method of collisions and levels just yet. oh and the code for everything pretty much you can open by double-click one of the blocks.

thanks,
doug9

Platformer: Can't Get MC To Change After Falling Has Stopped
In this testing i can't get the MC to change to the neutral blue color after it's detected that it's not falling or jumping anymore. Green is the color for jumping and yellow is the color for falling. The blue box underneath it is the hit detection for the floors. For some reason even after hitting the floor the yellow box won't change back to blue. any help will be appreciated, even if it's how to better the actionscripting that doesn't have to do with the jumping or animations.

Some Platformer/Destructable Terrain Problems
Ok, I attached my platform/destructable terrain test thingy which I am happy and surprised worked. (to play, arrow keys are move and jump, and click and drag to shoot a "bullet" that desroys terrain)
But, as you can see, there are quite a few problems.Going up a hill is fine, but when going down the player doen't cling to the ground.
Even if there if there is a massive 90 degree wall you can still go up it.
If you are inside a 'hole' even if there is ground above you you still can go right through it.
When holding a key down, you go 'in' to the ground a bit and come out when you stop.
Even if you can solve one of these I will be eternally grateful.
Thanks, Lucas

[JavaScript] Tile Based Platformer
a little something i cooked up during the absence of Flash that i am currently suffering to.

FIREFOX HTML:

Code:
<html>
<head>
<title>JavaScript Tilebased Scripting</title>


<style type="text/css">
div {
font-family: verdana;
font-size: 10px;
text-align: center;
}
.wall {
background-color: #EFEFEF;
border-color: #CCCCCC;
border-width: 1px;
border-style: solid;
position: absolute;

height: 19px;
width: 19px;
}
.character {
background-color: #DD9999;/*#9999DD*/;
border-color: #000000;
border-width: 1px;
border-style: solid;
position: absolute;

height: 19px;
width: 19px;
}

#controller {
background-color: #EFEFEF;
border-color: #CCCCCC;
border-width: 1px;
border-style: solid;

font-family: verdana;
font-size: 10px;
text-align: center;
}
</style>


<script language="JavaScript">

var objCount = 0;

startTile = {x: 1, y: 9};
var map = [
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
];

xOffset = 40;
yOffset = 40;
tileSize = 20; //if changing, remember to update the css too.

function makeObj(type, x, y) {
// <div class="type" style="top: xpx; left: ypx" />

if (type=="wall") {
name = type+"_"+x+"_"+y;
} else {
name = type+"_"+objCount;
}

writeThis = "<div id='"+name+"' class='"+type+"' style='left: "+Number(x*tileSize+xOffset)+"px; top: "+Number(y*tileSize+xOffset)+"px'>"+objCount+"</div>";

objCount++;
document.write(writeThis);

eval(name).x = x;
eval(name).y = y;

return eval(name);
}

function assessMap() {
for (y=0; y<map.length; y++) {
for (x=0; x<map[0].length; x++) {
if (map[y][x] == 1) {
makeObj("wall", x, y);
}
}
}
}

assessMap();
var mainChar = makeObj("character", startTile.x, startTile.y); //mainChar now acts as a reference to the div object for the character.
testDirections(mainChar);

function assessKeysDown(evt) {
key = evt.keyCode;
if (key == 37) {
keyLeft = true;
}
if (key == 39) {
keyRight = true;
}
if (key == 38) {
keyUp = true;
}
}
function assessKeysUp(evt) {
key = evt.keyCode;
if (key == 37) {
keyLeft = false;
}
if (key == 39) {
keyRight = false;
}
if (key == 38) {
keyUp = false;
}
}
function testDirections(currObj) {
left = Number(String(currObj.style.left).substring(0, String(currObj.style.left).length-2));
top = Number(String(currObj.style.top).substring(0, String(currObj.style.top).length-2));

bottom = Math.floor((top+tileSize-1-yOffset)/tileSize);
top = Math.floor((top-yOffset)/tileSize);
right = Math.floor((left+tileSize-1-xOffset)/tileSize);
left = Math.floor((left-xOffset)/tileSize);

currObj.canUp = true;
currObj.canDown = true;
currObj.canLeft = true;
currObj.canRight = true;

if (map[top-1][left] == 1 || map[top-1][right] == 1) {
currObj.canUp = false;
currObj.maxTop = top*tileSize+yOffset;
}
if (map[bottom+1][left] == 1 || map[bottom+1][right] == 1) {
currObj.canDown = false;
currObj.maxBottom = bottom*tileSize+yOffset;
}
if (map[top][left-1] == 1 || map[bottom][left-1] == 1) {
currObj.canLeft = false;
currObj.maxLeft = left*tileSize+xOffset;
}
if (map[top][right+1] == 1 || map[bottom][right+1] == 1) {
currObj.canRight = false;
currObj.maxRight = right*tileSize+xOffset;
}

//document.title = "t: "+top+", b: "+bottom+", l: "+left+", r: "+right;
document.title = "Up: "+currObj.canUp+", Down: "+currObj.canDown+", Right: "+currObj.canRight+", Left: "+currObj.canLeft;
}

//the main controller loop:
keyUp = false;
keyLeft = false;
keyRight = false;

xSpeed = 0;
ySpeed = 0;

function loop() {

left = Number(String(mainChar.style.left).substring(0, String(mainChar.style.left).length-2));
top = Number(String(mainChar.style.top).substring(0, String(mainChar.style.top).length-2));

if (keyRight) {
xSpeed += xSpeed < 5 ? 1 : 0;
} else if (keyLeft) {
xSpeed -= xSpeed > -5 ? 1 : 0;
} else {
xSpeed -= xSpeed != 0 ? xSpeed/Math.abs(xSpeed) : 0;
}

left += xSpeed;

//test that the object is still within bounds
if (!mainChar.canLeft && left < mainChar.maxLeft) {
left = mainChar.maxLeft;
}
if (!mainChar.canRight && left > mainChar.maxRight) {
left = mainChar.maxRight;
}

if (keyUp && !mainChar.canDown) {
ySpeed = -10;
}

ySpeed += ySpeed <= 19 ? 1 : 0; //gravitational effect
if (!mainChar.canDown && top + ySpeed > mainChar.maxBottom) {
ySpeed = 0;
top = mainChar.maxBottom;
}

if (!mainChar.canUp && top + ySpeed < mainChar.maxTop) {
ySpeed = 0;
top = mainChar.maxTop;
}

top += ySpeed;

mainChar.style.left = left;
mainChar.style.top = top;

testDirections(mainChar);

//loop again:
setTimeout("loop()", 100);
}
setTimeout("loop()", 100);

</script>


</head>
<body onKeyDown="assessKeysDown(event)" onKeyUp="assessKeysUp(event)" >
</body>

</html>

Maximum Jump Height For Platformer
I am making my second game, and it's going to be a platformer. Unfortunately, I have no idea how to make the character (named hero) jump only to a certain height, and then fall back down. someone, please post a way to do this!

[CS3/AS2.0] Platformer Game - Area Transitions
Hello it's my first time posting here.

(Flash CS3 AS 2.0 // Main timeline)


Background:
Im working on a birdseye view game, similar to Zelda. Like the old Zelda each area is on a square grid, one square on the grid is represented by the default flash workspace dimension. My plan is to have each frame a new area. So if my character wants to walk to a new area he will have to tell the flash to go to a new frame.


How this is done:
My character MC steps on an 'exit' MC which has the following hitTest code applied:

Code:
onClipEvent(enterFrame){
if(this.hitTest(_root.character)){
_root.gotoAndStop("room_2");
}
}
The character moves around with this code:

Code:
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){
this._y -=2.5;}
}
*and the same applies for all other directions *


The Problem:
My problem is that I am unable to get the character to appear in the correct position on the new frame (area).


For Example: My character exits north and he should appear on the south of the new frame. I can see my problem because the character exits north and in the new frame he appears in the exact same location the exit was on the previous frame.


What I thought would work is putting the character on his own layer/frame so in that area I am able to choose where he enters from by dragging it in the position. The problem with that is that if there is an area which can be entered by multiple entrances then I am unable to position him in a suitable location which matches the direction he enters from.


Concluding: What can I design to make my character appear on a specific entrance depending on what exit he took on a different frame?



Attached is a .fla file working on the said system. View it if you want a better understanding.

Thanks

[JavaScript] Tile Based Platformer
a little something i cooked up during the absence of Flash that i am currently suffering to.

FIREFOX HTML:

Code:
<html>
<head>
<title>JavaScript Tilebased Scripting</title>


<style type="text/css">
div {
font-family: verdana;
font-size: 10px;
text-align: center;
}
.wall {
background-color: #EFEFEF;
border-color: #CCCCCC;
border-width: 1px;
border-style: solid;
position: absolute;

height: 19px;
width: 19px;
}
.character {
background-color: #DD9999;/*#9999DD*/;
border-color: #000000;
border-width: 1px;
border-style: solid;
position: absolute;

height: 19px;
width: 19px;
}

#controller {
background-color: #EFEFEF;
border-color: #CCCCCC;
border-width: 1px;
border-style: solid;

font-family: verdana;
font-size: 10px;
text-align: center;
}
</style>


<script language="JavaScript">

var objCount = 0;

startTile = {x: 1, y: 9};
var map = [
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
];

xOffset = 40;
yOffset = 40;
tileSize = 20; //if changing, remember to update the css too.

function makeObj(type, x, y) {
// <div class="type" style="top: xpx; left: ypx" />

if (type=="wall") {
name = type+"_"+x+"_"+y;
} else {
name = type+"_"+objCount;
}

writeThis = "<div id='"+name+"' class='"+type+"' style='left: "+Number(x*tileSize+xOffset)+"px; top: "+Number(y*tileSize+xOffset)+"px'>"+objCount+"</div>";

objCount++;
document.write(writeThis);

eval(name).x = x;
eval(name).y = y;

return eval(name);
}

function assessMap() {
for (y=0; y<map.length; y++) {
for (x=0; x<map[0].length; x++) {
if (map[y][x] == 1) {
makeObj("wall", x, y);
}
}
}
}

assessMap();
var mainChar = makeObj("character", startTile.x, startTile.y); //mainChar now acts as a reference to the div object for the character.
testDirections(mainChar);

function assessKeysDown(evt) {
key = evt.keyCode;
if (key == 37) {
keyLeft = true;
}
if (key == 39) {
keyRight = true;
}
if (key == 38) {
keyUp = true;
}
}
function assessKeysUp(evt) {
key = evt.keyCode;
if (key == 37) {
keyLeft = false;
}
if (key == 39) {
keyRight = false;
}
if (key == 38) {
keyUp = false;
}
}
function testDirections(currObj) {
left = Number(String(currObj.style.left).substring(0, String(currObj.style.left).length-2));
top = Number(String(currObj.style.top).substring(0, String(currObj.style.top).length-2));

bottom = Math.floor((top+tileSize-1-yOffset)/tileSize);
top = Math.floor((top-yOffset)/tileSize);
right = Math.floor((left+tileSize-1-xOffset)/tileSize);
left = Math.floor((left-xOffset)/tileSize);

currObj.canUp = true;
currObj.canDown = true;
currObj.canLeft = true;
currObj.canRight = true;

if (map[top-1][left] == 1 || map[top-1][right] == 1) {
currObj.canUp = false;
currObj.maxTop = top*tileSize+yOffset;
}
if (map[bottom+1][left] == 1 || map[bottom+1][right] == 1) {
currObj.canDown = false;
currObj.maxBottom = bottom*tileSize+yOffset;
}
if (map[top][left-1] == 1 || map[bottom][left-1] == 1) {
currObj.canLeft = false;
currObj.maxLeft = left*tileSize+xOffset;
}
if (map[top][right+1] == 1 || map[bottom][right+1] == 1) {
currObj.canRight = false;
currObj.maxRight = right*tileSize+xOffset;
}

//document.title = "t: "+top+", b: "+bottom+", l: "+left+", r: "+right;
document.title = "Up: "+currObj.canUp+", Down: "+currObj.canDown+", Right: "+currObj.canRight+", Left: "+currObj.canLeft;
}

//the main controller loop:
keyUp = false;
keyLeft = false;
keyRight = false;

xSpeed = 0;
ySpeed = 0;

function loop() {

left = Number(String(mainChar.style.left).substring(0, String(mainChar.style.left).length-2));
top = Number(String(mainChar.style.top).substring(0, String(mainChar.style.top).length-2));

if (keyRight) {
xSpeed += xSpeed < 5 ? 1 : 0;
} else if (keyLeft) {
xSpeed -= xSpeed > -5 ? 1 : 0;
} else {
xSpeed -= xSpeed != 0 ? xSpeed/Math.abs(xSpeed) : 0;
}

left += xSpeed;

//test that the object is still within bounds
if (!mainChar.canLeft && left < mainChar.maxLeft) {
left = mainChar.maxLeft;
}
if (!mainChar.canRight && left > mainChar.maxRight) {
left = mainChar.maxRight;
}

if (keyUp && !mainChar.canDown) {
ySpeed = -10;
}

ySpeed += ySpeed <= 19 ? 1 : 0; //gravitational effect
if (!mainChar.canDown && top + ySpeed > mainChar.maxBottom) {
ySpeed = 0;
top = mainChar.maxBottom;
}

if (!mainChar.canUp && top + ySpeed < mainChar.maxTop) {
ySpeed = 0;
top = mainChar.maxTop;
}

top += ySpeed;

mainChar.style.left = left;
mainChar.style.top = top;

testDirections(mainChar);

//loop again:
setTimeout("loop()", 100);
}
setTimeout("loop()", 100);

</script>


</head>
<body onKeyDown="assessKeysDown(event)" onKeyUp="assessKeysUp(event)" >
</body>

</html>

Platformer - Rotation On Sloped Grounds
Greetings GotoAndLearn members. Recently I have been having some problems with a game I'm creating. My Actionscript skills are over average, but my math skills aren't at top. So what I'm making is a platformer game, and the problem comes when I'm making the sloped grounds engine.

I guess many of you have played the old sonic games, where the character rotates and moves after the ground. So, what I want is to be able to have my character rotate from the vector of the ground from where he is standing, I can fix the movement self, the rotation is the hard bit in my opinion.

I would be please to get some advice on this topic. :)

Ultimate Scroller
Hi. I am looking for something exactly like theultimateScroller, but if it's free. This neat little widget goes for like $30 dollars and I just can't get myself to buy it. Anyone know where to get one for free?

Thanks

Ultimate Strangeness
ive got a strange problem.

there are 2 moveiclips, a spaceship, which stays in the middle of the screen, and a map, which moves about, so itsa form of sidescrolling game.
the movement is done using xeef's coding he sent me a while ago, which is below.
i have a shooting script too, but my intresting problem is, how do i make the bullets spawn INSIDE the map movieclip, so as to simulate realistic physics on them.
in other words, at the moment, bullets spawn, outside the map, and move regardless of anything else at a steady speed towards the edge of the screen, which isnt what they would realisticially do, what i need them to do, is when they spawn, spawn inside the map moveiclip, thus inheriting its movement.
there are likely to be a LOT of bullets flying around, i suppose it needs to be fairly non-processor-draining

my shooting script:


Code:
depth = 0;
speed = 5;
nose = 7;
blast = function () {
angle = _root.ship._rotation;
angle = angle*Math.PI/180;
++depth;
name = "pea"+depth;
this.attachMovie("pea", name, depth);
this[name]._x = ship._x+nose*Math.cos(angle);
this[name]._y = ship._y+nose*Math.sin(angle);
this[name].xmov = 0
this[name].ymov = 0
_root.es.sendMessage("public", "bang");
this[name].onEnterFrame = function() {
this._x += this.xmov;
this._y += this.ymov;
if (this._y>=660) {
this.removeMovieClip();
}
if (this._y<=0) {
this.removeMovieClip();
}
if (this._x<=0) {
this.removeMovieClip();
}
if (this._x>=800) {
this.removeMovieClip();
}
};
};
and the movement script


Code:

onClipEvent (load) {
TS = 0;
TV = 0;
MS = 0;
MV = 0;
}
onClipEvent (enterFrame) {
count++;
mcount++;
if (Key.isDown(88) && count>=delay && energy>=energycost) {
_parent.blast();
count = 0;
energy -= energycost;
}
if (Key.isDown(37)) {
this.TV -= rotspeed;
_parent.pausevar = 100;
} else {
_parent.pausevar = 10000;
_parent.moveupdate();
}
if (Key.isDown(39)) {
this.TV += rotspeed;
_parent.pausevar = 100;
if (_parent.stuff == "0") {
unloadMovie("_parent.map.base");
}
} else {
_parent.pausevar = 10000;
_parent.moveupdate();
}
if (Key.isDown(38)) {
this.TS += speed;
_parent.pausevar = 100;
} else {
_parent.pausevar = 10000;
_parent.moveupdate();
}
this._rotation = this.TV;
TX = Math.cos(this.TV*Math.PI/180);
TY = Math.sin(this.TV*Math.PI/180);
MX = Math.cos(this.MV*Math.PI/180);
MY = Math.sin(this.MV*Math.PI/180);
ResultX = this.TS*TX+this.MS*MX;
ResultY = this.TS*TY+this.MS*MY;
Result = Math.sqrt(ResultX*ResultX+ResultY*ResultY);
ResultA = Math.atan2(ResultY, ResultX)*180/Math.PI;
this.MS = Result;
this.MV = ResultA;
if (this.MS<-maxspeed) {
this.MS = -maxspeed;
}
if (this.MS>maxspeed) {
this.MS = maxspeed;
}
this.TS += -this.TS/5;
_parent.map._x -= this.MS*MX;
_parent.map._y -= this.MS*MY;
_parent.stars._x -= this.MS*MX/7;
_parent.stars._y -= this.MS*MY/7;
dx = this._parent.ship._x-this._parent.spaceShip._x;
dy = this._parent.ship._y-this._parent.spaceShip._y;
d = Math.sqrt(Math.pow(dx, 2)+Math.pow(dy, 2));
if (d<this._parent.ship.r+this._parent.spaceShip.r) {
this._parent.ship.MV = 0;
}

}
help would be nice, and ill probbaly stick you on the credits, alonmg with xeef, of course, cos im sick and tired oftrying to solve this, ive been at it for 3 days -.-

Is There An Ultimate Preloader?
I have a site I am designing, that uses frame labels for each button

throught out the frames there is XML text being loaded in and various instances of the loader component.


Is ther a way to load everything in all at once from the preload scene????


Hmmmmm
anyone know

The Ultimate Scaler
I suddenly need to create a second version of a almost finished site,
that is very bitmap heavy, which will be scaled down to 75% approx of orginal flash site 8 size.
Experements with publishing at this size from flash have been of poor quality. Is there a miracle program or extention or anything anyone is aware of. The client would like to have a version for older 800x600 rez computers.

thanks

If Ever There Was An Ultimate Noob Question...
Okay totally noob question, does MC stand for Movie Clip???? ;D lol

Ultimate Dumb Question
Hey! I just figured out how to create movies on FLASH. OK.. Now, what I'm trying to do is simply create a page that says coming soon........(simple) I chose black as my background color, and when I typed in my text, It types it on a white BG. ??? How the hell can I get the just the letters to show up on top of the black BG color???

Ultimate Inertia Math....
Well That idea probably grabs your attention as much as the idea does for me. I am making a menu system and am wanting to have my MC's ease in and out with the movement and transparency. Below is the code I have now that is working a treat but it is very linear in motion. Can any of you Math/AS guru's out there give me an indication of what you would consider the ultimate ease in and ease out math function for it. I know what I have got below works quite well but if ou have any better ideas to write it I am all ears.

// sets the initial state of ButtonOver and ButtonClicked to false

var ButtonOver = false;

var ButtonClicked = false;

//

// Sets the bounds for the fade and the slide

var SlideHome = buttonText._y;

var SlideMax = 25;

var SlideSpeedDown = 10;

var SlideSpeedUp = SlideSpeedDown/2;

var FadeMin = 0;

var FadeMax = 100;

var FadeSpeedIn = 5;

var FadeSpeedOut = FadeSpeedIn*2;

//

// Sets the initial visability of the TextMaroon and the buttonHit area

setProperty("TextMaroon", _alpha, FadeMin);

setProperty("buttonHit", _alpha, FadeMin);

//
onClipEvent (enterFrame) {

//

// This is where all the fading and sliding is going on.

if (ButtonOver == true) {

if (TextMaroon._alpha < FadeMax) {

TextMaroon._alpha += FadeSpeedIn;

}

if (buttonText._y < SlideMax) {

buttonText._y += SlideSpeedDown;

}

}

if (ButtonOver == false) {

if (TextMaroon._alpha > FadeMin) {

TextMaroon._alpha -= FadeSpeedOut;

}

if (buttonText._y > SlideHome) {

buttonText._y -= SlideSpeedUp;

}

}

if (ButtonClicked == true) {

_parent._parent.Button.gotoAndStop(Clicked);

;

}

}

Yes, I Have Committed The Ultimate Cardinal Sin...
I have forgotten my password to import a flash file i created into flash 5. Due to a disk crash, all I have is the SWF file, which i had sent to a friend and he sent it back to me. It took me a lot of work and i sorta want to finish it...

Ultimate (text) Control
hello,

ive got pic from photoshop and i want 2 turn into a butotn, with text on top of it.

There two main problems

1) i need the text to be able to change

2) i dont want the text stopping the rollover from appearing (when the mouse is pased over)

the text box's instance name doesnt matter.

could some 1 please help

im sure theres an easy way 2 do it...i just havent found it yet

thanx a lot

PJ

The Ultimate Newbie Question.
What is this flash thing? I've downloaded the flash player, if that's what it takes. I want to make simple cartoons, like the ones on newgrounds.

Ultimate Newbie Here. (with Questions)
Hello and thanks for granting me free membership to this forum.
============================================
I've been here all of 5 minutes. I know nothing about Flash. I havent even bought the software yet. Here are my current questions:
============================================
1. What is the difference between Flash, Swift, Swish? If thats a tough long answer please post a link to where I can read about it
2. Which should I buy and where?
3. A link,or list of links to the best, up to date guides.
4. Your Tips for the absolute beginner, Words of wisdom, things you've learned from mistakes in the school of hard knocks that I could save hours by not repeating.
5. If you were allowed only 3 of your bookmarked flash sites, excluding this one, which would they be.
6. Is there a beginner group that gets together online, like MSN Messenger, to share battle scars or revelations? Could you post a link, or invite me?
============================================
Thats lots for now.(maybe too much?) If you are only answering one or two of these questions, please use the question number in your response, so it's easier for other newbies, (and me) to follow the thread.

Thanks in advance for any help you can offer, and thanks once more for allowing me to be a part of this community.
Have a most excellent day.

Dean

Ultimate Fullscreen Challenge...
i need to open my swf in a browser fullscreen.
i know the javascript that get a fullscreen window... no scrollbars blah blah bla...

my swf is 1600 x 1200, exactly like my screen. in the browser, the swf is offset from the top left corner of the screen by about 25 pixels, hich looks stupid and cuts off the right and bottom edges of the swf, because i have scaling off.

how can i get true fullscreen (with scaling) that works on all resolutions? i need to be able to switch between fullscreen and windowed anyways, so i'm gonna need to allow my swf to be scalable.

i'm not very html / javascript knowledgable, so any ideas please....

thanks a lot,
marvin

May Just Be The Ultimate Flash N00b
Okay, I d/led the free trial for Flash MX 2004. I did the lessons, and understood the drawing ones. My problem is that I am still completely lost.

My goal: Make a simple flash movie.

Could anyone please tell me how to accomplish this, or at least refer me to a guide?

Copyright © 2005-08 www.BigResource.com, All rights reserved