ActionScript 2.0 :: Movement - Stop Moving Object
Oct 11, 2004i need a movement script that makes an object move to where i want it to then stop. i cant seem to find a script for this anywhere.
View 4 Repliesi need a movement script that makes an object move to where i want it to then stop. i cant seem to find a script for this anywhere.
View 4 Replieshow do i stop the movement of an object moving from left to right. I want to be able to place it anywhere id like.
View 2 RepliesI am looking for the AS for moving an abject with WASD. I had it working with Key.Left, Key.Right, Key.Up, and Key.Down but I want to change them to WASD.
Code:
if (Key.isDown(Key.LEFT)) {
this._x+=moveSpeed;
} else if (Key.isDown(Key.RIGHT)) {
this._x-=moveSpeed;
} if (Key.isDown(Key.DOWN)) {
this._y+=moveSpeed;
} else if (Key.isDown(Key.UP)) {
this._y-=moveSpeed;
}}
I have made a class file player and another class file landscape. The player class file has methods that allow the player to move. Where would I put code to make the landscape move with the player? Would the code go into the player class file or the document class file? I don't know how I could link the landscape movement with the player movement
player.as class file
Code:
//the package
package actionscript{
import flash.display.*;
import flash.events.*;
import flash.media.*;
[Code] .....
how i can stop the movement of one object when one other object is over one third object
View 1 RepliesI have this code where I want edge_btn to move to the left side of the stage, but I can't figure out how to get it to stop. It just keeps going. Also, I have edge_btn rotating the entire time in the beginning of the timeline.
[Code]...
I am making a new site, and was making buttons that looked a little similar like this buts on the left) and wanted that to do with Actionscript.I followed a tutorial on Kirupa on moving stuff with actionscript
Code:
onClipEvent(enterFrame) {
speed = 30;
[code].....
I have a ball moving around the screen, position updated on ENTER_FRAME. My problem is that there is a considerable amount of flicker going on. I have thought about using something like TweenLite to move the ball but as the position is being updated frame-to-frame I don't think that will work.[code]...
View 2 RepliesI am trying the get the center movie to stop remaining centered with the scaling movie when It gets less than 200 pixels of the left hand margin. x.200 and stop being centered on the y axis also at 100 pixels y.100 Here is the current code I was trying to write that is positioned on the object: Just avoid the comments, just left them there for reference to what's in my movie. Also need an if statement made for the y axis. (explained earlier)
onClipEvent(load){
this._x = Stage.width + 250;
this._y = Stage.height/2;
// This function will Position the object in Place
[code]....
Currently I'm trying to make a basic game (using AS 2) but I'm having trouble getting the basic physics to behave. I have a ball which is supposed to fall until it touches the ground. It can also be dragged around the screen by the cursor.I want the ball to fall only if it isn't being held, but for some reason the condition isn't working properly. No matter how I structure the condition, the ball still falls even when it's being held (in fact I can move it from side to side, it is still being held even though it's falling downward).I've tried putting this on the ball to make it fall conditionally:
Code:
onClipEvent(enterFrame){
if(hitTest(_root.ground1) == false){
[code].......
As the title says: Stop object from moving further when collision occurs.
Right now I'm trying to make a sliding puzzle. So far I have a block which I can click and drag around, and a few walls which are the boundaries. What I'm trying to do is make an area where the block can slide within the boundaries. So when you try to drag the block into an direction it will stop, whether you got mouse_down or mouse_up. My script so far
Code:
stop();
//Sliding Blocks
MCBlock1.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
[Code]....
Also I need to use a lot of boundaries, so if there's a way to apply this script easily to several objects
im currently making an "AS3 beat em up" ala streets of rage or double dragon.Currently i have my character moving and a few animations done and i am trying to figure out how to make attacks work.I have some "basic" animation for his attack, but im not sure how to get it to work correctley.What happens is, if you press control (the attack button) whilst the character is walking he just keeps moving and is stopped on the attack frame.I want the character to stop moving if the attack is pressed and once it is released start moving again.
hero.gotoAndStop('still');
var left:Boolean = false;
var right:Boolean = false;[code].......
I have a MC that follows the mouse. I want to do so the MC will smoothly/softly stop when i stop moving the mouse. Is it hard to code, And it would be very nice if someone could do some code for it
View 2 RepliesI'd like to control a mc movement on_x direction (or _y) when the mouse mouves horizontaly (or verticaly). So when I mouve the mouse to the right the mc mouves to the lefht and it mouves to the right when the mouse moves to the lefht. It's for a window effect.
View 8 RepliesI would like to create something similar to this: and only need a few things to complete it.What is missing is to make the whole flash movie (the white area, including the watches and cursor) move from left to right and right to left depending on the movement of the cursor (round circle) .. Panning effect I have attached the file i am working on..maybe that makes it easier to understand
View 5 RepliesI was wondering if it was possible to move a MClip from a defined "point A" to a defined "point B" (precisely), but this with a "snake or bubble" movement (or something like that).
View 8 RepliesI found this AS2 tutorial online but I'd like to achieve this in AS3. I tried transcribing but the setProperty is throwing me off.
[Code]...
I am about to make a gallery where all the pictures are ligned up, in a vertical row collum.I wan to make the Movieclip move in the opposite direction of my mouse movement
View 2 Replieswhat wrong with the functin 'stopFish' Without this function the fish in the tank swims but when I add it, it doesnt anymore. I just want the fish to stop swimming after I clicked it and start swimming after another click.
View 1 RepliesI'm doing a tut to learn animation through AS, but can't figure out how to stop the MC
[Code]....
i need that the word stop moving when i make a rollover on it and in the rollout make the word continue with the falling, the fla file its attached
View 4 RepliesI have a movie clip that is moving dynamically with this code.
Code:
onClipEvent(enterFrame) {
speed = -5;
this._x += speed;
}
how to stop this movement at a _x postiiton.
so i have a MC called "pala" and a button called "nappi" .. i have the following script in the first frame of the movie and everything works how it should, but how do i get the "pala" stop moving when it reaches the property -307 ?[code]
View 5 RepliesI'm working on a website and I have a movieclip that I want to move, but it would be easier to have actionscript control the movement. I need it to slide up along the y-axis for a certain amount of pixels and then stop, preferably even being able to set how long it'll take to go from point a to point b. does anyone know the script for this?
View 10 RepliesIn moving with actionscript, how do you stop the movement at a particular location?
View 1 RepliesI have a movieclip instance named "ground" i have it set up so that the ground moves constantly to the left as a scrolling BG. what I want is that when the user presses the "space" button, the ground moves down then back up in a a parabolic path. and it does. but I want the movieclip to stop moving vertically(make dy equal to zero) when it returns to its original y position. how can this be achieved?
Code:
package{
import flash.display.*;
[code].....
Is there a way to have a MovieClip with startDrag, but to force only horizontal and vertical (i.e. not diagonal) movement?
View 4 RepliesAvoiding tweening what method can I use to get a shape to move from off the stage on the right to a position centre stage. I want to control the speed of the movement and I want to stop the movement after a defined period.
I have tried to use for loops and if conditionals but neither work.
I want the movement to execute on a button press.
when I use this code it just infinitly fades in
[Code]...
i have 10 pics on the stage and i need to give them random movement and swepdepth for each image when i rollover.my problem is that the random movement stop on the start this is my code:[code]
View 6 Replies