ActionScript 2.0 :: Make A Function That Moves The Character?
Aug 7, 2004
I have a problem with functions.I want to make a function that moves the character and let him do a different thing like kicking or going down and jumping. Here is the code i have:
Code:
function enableKeyMovement(clip) {
clip.onKeyDown = function() {[code]....
i want the up key to be pressed once, the down key to be hold on to and when released it goes back, and the right and left to be hold on to and when released goes back to 1.
View 1 Replies
Similar Posts:
Sep 16, 2009
I am trying to make my screen scroll as my character moves to the edge of it, but when I get to the edge of the screen nothing happens, I think this could be something to do with my registration points but I'm not sure. I have added trace statements for debugging but no luck. I have included my Fla so you can see what I mean.
Here: [URL]
Here is the code I am using to try and make this happen
PHP Code:
// scroll the LBground if character gets past half way up or down the stage
function scrollLevel():void {
// Horizontal scrolling
var horizontalCentre:Number = stage.stageWidth / 2;
var horizontalPosition:Number = LBground.x + Mchar;
[Code] .....
View 2 Replies
Aug 11, 2009
i was wondering if any of you out there could tell me how it is possible to make a movieclip of a character and when the character is dragged about the screen by the curser, how do you make the characters arms and legs swing about in a realistic fashion.
View 2 Replies
Dec 30, 2008
how to do a basic action tween in actionscript 2. I can only find tutorials on AS3 ones or AS2 ones with easing, i dont want easing. i want it so when someone clicks somewhere on the stage the "character" moves to the position that was clicked.
View 2 Replies
May 31, 2011
I am using the following code as part of a set of scrollable bars to change each bar in relation to another when one is dragged. It works until the user swipes the bar as fast as possible then the numbers go wrong.[code]...
View 1 Replies
Jul 21, 2011
i am trying to find out how i would make an image pan right and left and up and down following the movements of the mouse. so when you move your mouse to the right the image moves to the right, same for other movements.
has anyone seen any scripts i could use or knw the code. happy to donate to paypal for the code.
View 4 Replies
Dec 11, 2009
To start things off, I use Flash CS3.moving menu that moves on its own when the mouse moves around it. Like the menu moves up when the mouse moves down.[URL]i have found similar tutorials for what i wanted.. but they are AS2 or older versions of flash..and what i needed is more along the lines of AS3 as that's what my class is learning and using.Does anyone know of an AS3 or anything that works with Flash CS3 tutorial thats what I'm asking?
View 0 Replies
Dec 19, 2009
i want to make the character in my flash game make a jump when the player presses a key,e.g. 'space',even the player release the key instantly,the character will still finish the complete jump process.
View 1 Replies
Apr 13, 2011
I've got an app based on four frames with seperate events on each frame. The app is powered in AS3 and every frame calls stop(); and everything works well but the swf file in flash player has a problem where if the user hits control > play it moves to the next frame.How can I stop this? A simple conditional would prevent it but errors are triggered this way from ongoing functions from a previous frame.
View 3 Replies
Jun 13, 2005
I have a button that every time we press it it moves one unity down (button._y++) However how to make move it faster or moves more than an unity at a time?
View 2 Replies
Nov 1, 2007
I'm trying to make a progress bar that moves from 0 to 100 over a specific period of time. This time will be dynamic. It might be 10 seconds and it might be 13.2 seconds or whatever. The overall width of the progress bar will never change but the amount of time it takes to go from 0 to 100 will.
View 3 Replies
Nov 17, 2010
I'm trying to make a game where the player moves and the background scrolls to make it look like the player is moving but really the background is. The problem is whenever I blow something up in the game the explosion follows the player instead of staying with the background.
View 14 Replies
Apr 1, 2010
i have some dynamic text inside a moive clip which is supposed to hold the users' mouse x/y.my code is
_root.findx = _root._xmouse;
_root.findy = _root._ymouse;
my problem is how can i make the clip update itself so that everytime the mouse moves the code will change?
i feel bad abt posting this question, but idk what the problem is.
View 4 Replies
Apr 9, 2010
New to AS and would like to know how to make a simple page where the viewer has to click several buttons before it moves on to the next scene. They can only go to the next scene when all of the buttons have been clicked.
View 3 Replies
Aug 1, 2010
I'm developing a game, here is a screenshot:I have a function in my main loop called moveShip that moves the player's ship if some buttons are pressed. The trouble is, some commands began to break it recently, such as removeChild(debriefingScreen), and I have no idea why. Also, firing (spawning bullet movie clips) restores the moveShip functionality 0_
View 2 Replies
Apr 21, 2010
I have MC masked with TEXT,when the user moves his mouse down more text appears from the bottom and when he moves it goes bakc to the original position...I do not want the mouse wheel .. I woudl like to do it by mouse hovering...
View 5 Replies
Jan 3, 2010
I have a character with multiple animations by way of movieclips, and I'm trying to have it move using the Key.isDown function. Now, my character is moving correctly, but when the key is released, the animation keeps playing. I tried adding a stop command at the end of the walkcycle animation, but that just causes the character to stay frozen on the last frame of the cycle.
Here is the ActionScript Code:
onClipEvent(load) {
var direction = "left";
var speed = 2;
} onClipEvent(enterFrame) {
[Code] .....
View 3 Replies
Jun 26, 2010
So I'm making a platforming game, how do I make my character have a different animation for when he runs or jumps?
View 4 Replies
Jul 31, 2011
how would i make a level that follows the character? would it be a on enter frame event?
View 13 Replies
Feb 5, 2011
I got a curve(e.g. movieclip) which i want my character to go on when i press left/right arrow. How to make that?
View 2 Replies
May 12, 2010
I've created a walk cycle using bone tool on a character but i don't know how to make it move from one part of the screen to the other. The character is made up of 6 layers, 4 of which are armatures and 2 have motion tweens.
View 1 Replies
Nov 14, 2006
I am creating a game in flash using spirte sheets of megaman and I have a problem setting up script to make him jump. I am able to have megaman run side to side and also shoot but I can not get him to jump. Here is a sample of my code:
var hspeed = 0;
var vspeed = 0;
var i = 0;
[code].....
View 3 Replies
Oct 12, 2008
How would i make an enemy bullet go towards the main character?
View 7 Replies
Feb 16, 2009
im making a platform game at the moment and i need for the screen to follow the character, at the moment i've got the code on the background symbol and all the baddies in that symbol so when you press the arrow key the symbol moves to the side the code i have on this is
onClipEvent (load) {
walkSpeed = 2;
}
onClipEvent (enterFrame) {
if (air == true) {
[Code]....
if anyone knows a way to put this on the camera
View 1 Replies
Jun 8, 2011
I want to know how to make a character attack in a game. I've made a platformer game in which a character moves and jumps and collects the score balls, but the only thing I can't do is make him hit enemies.
View 1 Replies
Dec 24, 2011
How would I go about doing this but not directly like 360. like lets say my mouse is to the left of the character the character would than face its left frame I made for him like lets say his left frame is frame 2.
View 8 Replies
Feb 12, 2012
I want to make a fighting game with my own character skins and those of my friends as a fun thing.I'd like it to have an intro, menu, character select, level select. I'd like the levels to be able to scroll and for the characters to have health metres. So what I am looking for is either a tutorial to build this up, or be able to look at a completed one and take it apart. I'll be able to handle the art on my own.
View 4 Replies
Aug 10, 2011
how do i make my animation not fall of the stage when i make it move with they arrow keys?also how do i make my character jump when i hit the space bar using actionscript?
View 1 Replies
Mar 25, 2010
I have a 2D game (top down), and I would like to make the character escape from a shot, but not just walk away from the shot (I mean, don't be pushed by the shot), I want it to have a good dodging skills.The variables are:
shotX - shot x position
shotY - shot y position
shotSpeedX - shot x speed[code].....
View 2 Replies
Jan 21, 2011
I have one character which can face several directions: t, b, l, r, tl, tr, bl, br.The type of camera is top-down 2d
T stands for Top, which is when he is looking to the top of the screen
B = Bottom
L = Left
R = Right
The character can look to other directions, like the Top-Left of the screen, which is tl
How do I calculate which direction he should look to if I only have one variable, rotation?
View 1 Replies