ActionScript 3.0 :: Running Movement Of The Character And The Second Frame Is On Standing Position
Dec 20, 2010
RIGHTNOW, Im doing my game development but I have problem based on my game control.this is my question..
I have two frames. the first frame is on running movement of the character and the second frame is on standing position.This two frames has only one kind of character,but I seperated the two movement in two frames witch are running and standing positon.my problem is how can I do the mouseEvent,if onclick the character will continue on running and if on release the character will do is to standing position.
View 2 Replies
Similar Posts:
Sep 24, 2010
I have a 9 frames image of a character.In other language generally i used to make character animation by looping the array consisting of different frames and drawing each frame when pressing key.What i want to do is when i press left or right key, i want to draw each frame that makes character movement and update x coordinates of frames, and it will appear as character is moving.
View 4 Replies
Jun 10, 2011
how to get the camera to move with a character? At the minute he just moves off screen when i press right rather than the camera following him.
View 3 Replies
Feb 17, 2011
im having a little issue with my character animation when i use the arrow keys to move him. everything works but the fact that the "Running" animation wont stop. i tryed i few things and i only end up breaking the code.
if (Key.isDown(Key.RIGHT)) {
this.gotoAndStop(2);
_x += speed;
[Code]....
View 2 Replies
Jul 16, 2010
im having a little issue with my character animation when i use the arrow keys to move him.everything works but the fact that the "Running" animation wont stop.
if (Key.isDown(Key.RIGHT)) {
this.gotoAndStop(2);
_x += speed;
[code].....
View 1 Replies
Mar 14, 2011
Right now I have all the animations for each direction in a movieclip within one movieclip.However, when I use the arrow keys to move the walking animations don't playWhen I stop, the appropriate animations play, however. Here is my code:
Code:
onClipEvent (load) {
facing = 1;
[code]....
View 1 Replies
Jun 11, 2005
i have made the movie clips for my character walking in 4 different directions but i have no idea how to make it so when the up arrow key is pressed, for instance, the movie clip of my character walking up is played.
View 7 Replies
Dec 17, 2011
my movement script looks like thisActionScript2.0)
[Code]....
View 1 Replies
Apr 15, 2010
I'm sorry if this is the wrong section. But I'm looking for help with my actionscript coding. I'm fairly new to Flash. I've only scripted some simple websites so far and this is the first time I try to make a flash game. I started yesterday but I'm already having problems with my script.
I have a scene with 2 layers: one with my character and one with the bounds (ground, ceiling and walls).
Inside my character movie clip, I have this: Which is basically a bunch of frames labeled and with the action to stop();. Each one containing another movie clip with the respective animations. So the idea was, when I press "A", jump to "walk left". And it kinda worked, but I have some problems and I'm not really sure how to solve them.
[Code]...
View 2 Replies
Aug 24, 2010
1. Character Movement: as you know the iPhone/iPod touch doesnt have any sort of keypad and so when creating a game that has character movements onscreen buttons need to be used. My question is this; how exactly do i make it so that when the player taps/holds down a button (is the same as mouse clicking it) my character moves.
2. adding a physics style fall: once i have created this movement using on screen buttons i now need to create a jump, so what i need is something so that when the player clicks the "jump" button the sprite moves up a certain amount and then stops moving up and falls down.
View 2 Replies
Nov 8, 2009
I'm doing a simple game where you move the character using the arrow keys and shoot using the Mouse. The character rotates based on the Mouse angle. I have two problems: when I move the character, he moves once, then stops then moves again as normal. My other problem is that when I click over a MovieClip, the bullet goes to the wrong angle.My moving function:
Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
function keyHandler(event:KeyboardEvent):void {
[code]....
View 2 Replies
Feb 8, 2010
I am designing a character to move right and left but the character is not recognising the floor movieclip and is falling straight threw the floor.I have attached a zip file with the flash document sample and associated Actionscript file.
View 2 Replies
Aug 9, 2010
1. How do I prevent my scuba diver from leaving the screen? As when i hold either up, down, left or right long enough he will leave the stage entirely.2. How can I make my sharks enter the screen at random rather than having them enter from the same position each time? Here is my code:
(FOR MY SCUBA)
onClipEvent (load) {
xspeed = 10;
[code].....
View 3 Replies
Feb 24, 2011
I want to make my character moves randomly that is character will base on random numbers(for example generate 4 random numbers) and character's favorite(for example fast food, west food, Chinese food) to move. The character will move randomly with 4 direction that is move up, move down, move right and move left(any speed will do). Should i have four function with four movement.
View 1 Replies
Jul 16, 2004
I have a MC which is a lady that raises her arms up and down. From the main timeline i want to tell that "ladyMC" (also sitting on the main timeline) to play to and stop on specific frames. I have tried it two different ways but am obviously missing something. The first way i tried just using an if/else and getting the current frame #.
Code:
if(lady._currentframe < 22){
lady.play();
[code]....
View 2 Replies
Feb 10, 2008
i want a character to move on a globe. the movement of the character is shown though not by shifting the positions of the caharcter but by the rotation of the surface of the globe. buttons are used to move leftward and rightward.
Also, there are three layers of the globe to show depth. how would i script it so that the layers of the globe rotate at different speed?
i've uploaded a zipped of a fla file.
View 3 Replies
Mar 12, 2009
Right basically I have a character and a background. The background scrolls as you press left or right on keyboard to create the illusion of movement. I want the character to flip when you change from holding down left to right and vice versa, but when I do the following code it doubles the size of the character once and then it stays. It flips fine but in the transformed fat size.
Here's the code:
var mySpeed:Number = 10;
function keyIsDown(evt:KeyboardEvent):void{
if(evt.keyCode==Keyboard.RIGHT){
walkingPlane_mc.x+=mySpeed;
greyCharacter_mc.scaleX=-1;
[Code] .....
View 4 Replies
Aug 7, 2008
am pretty new to Kirupa and Flash. I have a little problem, concerning a character hitting a wall. What i have: a char that can jump and move around by the arrow keys. What i need: character shall stop movement if he hits a geometry. But being able to start movement again, besides through the geometry. I'd like to reach this with gskinners CheckForCollision class. Have a look here: [URl] But i didnt manage my code to get it work. So maybe you could leak me some information on how to get this done. Heres my code so far:
[Code]...
edit admits: so far i have a character mc called "player" and one called "level". i would apply the code to the player, and it would be cool to have the possibility to check collision of the player with multiple MCs, not only the level.
View 2 Replies
Jun 2, 2009
sample codes. In those codes they are using a verticalChange variable for the time-based character movement.But I can't figure out how this code works and why we needthose calculations - char.dy*timeDiff + timeDiff*gravity?So here is the code:
Code:
// assume character pulled down by gravity
var verticalChange:Number = char.dy*timeDiff + timeDiff*gravity;
[code]....
View 4 Replies
Sep 14, 2010
If I removeChild frame animated Movieclip, will it automatically stop running the frames inside it? Actually without calling mc.stop();
View 2 Replies
Aug 7, 2009
I have a timeline with a bunch of frames. At the beginning of my timeline (frame 2) I have actionscript that makes movieclips that are transparent (alpha 0) visible, and also some rollover and link/button code using a tween class. On frame 3 I have other movies that are visible etc. Frame 3 has stop code, and a frame anchor named "page2". For instance for the moviedclip "page_1" I have this code:
[Code]...
View 0 Replies
Jul 26, 2010
I am making a frame by frame animation, where I draw a character, make a new frame and use the onion skin to slightly move my character. Is there a way to make a certain part faster than others? I made a character prepare to kick someone, but since i was doing it frame by frame it looks slow. So instead of taking out frames and making it look choppy, how do I make a certain part faster or increase its FPS? I tried making a new scene and changing its FPS, but that still changes the overall FPS.
View 6 Replies
Feb 24, 2012
how to get the X and Y coordinates of a character in a string based on index? I find it odd that I can get the exact letter and index by clicking a character in a text field, but I haven't found anything in code that can get those coordinates without a user click. Seems like they would have to know the x,y of the individual indexs to be able to tell you what letter you're clicking based on your own mouse coordinates.
View 3 Replies
May 12, 2010
I am trying to get the position of the last character in the text field. The below script works fine till I change the width of the text from 110 to 109 or add some extra characters in the text field. For some reason the value of frame variable returns null if I change the width from 110 to 109 or add some extra characters in the field.
ActionScript Code:
var myTextField:TextField = new TextField();
var spotlight:Shape = new Shape();
myTextField.width=110;
[Code]....
View 0 Replies
Feb 13, 2012
I have a string of 0:'000000' named stringtest I need to replace the 0 at the position x with 1. My code in flixel(a free library to create games)
Code: Select allif (FlxG.keys.justPressed("X"))
{
stringtest=stringtest.replace(stringtest.substring(1,2), '1');
}
it doesn;t replace the second 0 with 1., but it replaces the first one. However if the initial sting is 'let's go' if I press x the letter e is replaced with 1. if the string is 'eet's go' if i press x the first e is replaced with 1 and if i press x again the second letter e is replaced.
View 2 Replies
Aug 28, 2009
I have textfield and a custom curso movie clip on a parent movie clip. Now I need to move the cursor the characters on the textfiled ,whenever there is righ of left movement. It is similar to the movement of the cursor on the webpages or the login textboxes.I'm trying to find a solution for placing the cursor movie clip on the particular character, but could not.
View 2 Replies
Nov 13, 2011
I wanted to built an enemy that is able to move on stage randomly in xposition and perhaps able to detect my character within the detectable zone and chase after me.. but currently I just wanted to make the enemy move randomly in x-position for starter.
It is my first time making and enemy with AI, but I'm just wasn't sure where to begin, I have used a fairy easy script to animated the movieclip in the beginning but got stucks whenever it reaches 960 or below 0 of the stage
addEventListener(Event.ENTER_FRAME,initGames);
function initGames(e:Event):void{
moveEnemy();
}
[Code].....
View 8 Replies
Apr 24, 2005
I'm having a problem with a little movement script I wrote for a MC I have. I believe it either has to do with variable scoping, or with a coordinate system problem. (If I change the xPos and yPos in the onClipEvent (load) to 0,0...then the MC starts in the middle of the field (MC) I'm trying to move it inside of.) Basically...the ActionScript you see below is a part of the "Player" MC...who is supposed to move around a "field" MC I have.
I was assuming setting xPos and yPos to 0 would have the Player MC starting at the very top left of the entire screen...which instead it starts in the middle of the "field" MC.) Also - When I press the different arrow keys...the Player MC jumps around to different locations...but once at the new location the movement (in a single direction) works okay.
[Code]...
View 11 Replies
Jul 13, 2004
I have 10 images in 10 frames ( 1 image per frame ). So I'm trying to make the frame to go to the next one when the mouse is moved to the right, and make the frame to go to the prev one when the mouse is moved to the left.
View 14 Replies
Oct 22, 2009
if i wanna set the postion of a button to the position of a character on screen and when the character moves so deos the buttons what would be the best way to do that?
View 3 Replies