Moving Object
hi. I'm trying to have an object move to a certain position when clickig a button. I thought about doing it using a motion tween but that could be a problem since i might be moving different objects to different positions.
Is there a different way to do it?
is there function like for example _rotation (to rotate an object) that does it all in the same frame only that instead of rotate changes the position of the object?
If anyone could help I'd be really greatfull
G.
FlashKit > Flash Help > Flash MX
Posted on: 06-12-2004, 08:31 AM
View Complete Forum Thread with Replies
Sponsored Links:
Making An Object Dissapear Once A Moving Object Makes Contact With It
Hello there,
Im in need of some help. Basically I need a code which will make an object disappear once another moving object hits it (MovieClips controlled by AS)
For example, a bullet comes out of the gun and hits a can which makes the can disappear as soon as the bullet hits it.
Is it something to do with the "intersects" function? I've been trying to solve it all day and cant do it
Please help.
View Replies !
View Related
Whats It Called When You Drag An Object And Want The Object To Continue Moving
i am trying to work out how to make a draggable movie clip/button continue to move in the same direction as the drag guides it...hmmmm does this make sense???? what is this function / behaviour called.... i have looked at many many drag tutorials but at present have only managed to find drag and drop type onces with target positions.... also does any one know if it is possible assign multiple drag points.
regards....
View Replies !
View Related
Help: Moving An Object
Hey there.
Might be a simple thing to do, but I can't figure it out.
I have an object(movie clip). I would like to move this object to the postion I specify in the button and load a movie. If I click a different button I would like to reverse the animation and unload the movie first and than go to the next position I specify in the other button and so on. It might be simple to do but I'm not able to get a grip on it. Would anybody post me a .fla or some code. thank you very much.
YO
View Replies !
View Related
Moving An Object...
Hi there,
i am having some trouble with this:
lets say i want to move a object on click to a desired location on stage.
i tried it with on enterframe but it didn't stop. so i am looking for a script loop,that says:
on click move box to x and stop. (not just PUT
it there but move it with medium speed). then, when on stage,
on click move out of stage again.
i tried some if,fot,while loops but...well, thats why i am here
help
View Replies !
View Related
Moving An Object
Hi, I was wondering if someone could help me out. I am trying to have an object move via the arrow keys, so I can create a game. Something like having a car which moves left when i hit the left arrow key, and continuously goes farther left each time you hit it. The coding which seems logical to me that I am trying is using a button (for the symbol) and the action:
on (keyPress "<Up>") {
setProperty ("", _y, -5);
this script causes it to go up, but only once, any more clicks on the up key do nothing. Can anyone help me?
Thanks
Cam Taylor
View Replies !
View Related
Object Moving
ok,
i dont know how to explain this really...
lets say i make a stick man move its legs, ok lets say i made this frame by frame, when i do that, i dont know how to move the stick man from one side to another....
pls help
thanks
View Replies !
View Related
MC Moving An Object
how can i move a MC inside a movieclip with an action for the main movieclip like this:
onClipEvent (enterFrame) {
// if the mouse is over mc...
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.movieclipinside._y += 200;
} else {
this.movieclipinside._y -= 200
}
}
***BUT IT DID NOT WORK.. WHY? WHAT WAS WRONG... I WERE THINKING ON A TRICK TO DO IT... I DID NOT GET WHAT CODE WRITE
SOMEBODY KNOWS??
I ATTACHED THE FLA.. WHERE I USED 2 FRAMES WITH THE MC INSIDE AND IT MOVES IN ONE FRAME TO A CERTAIN POSITION AND IN THE NEXT FRAME IT MOVES BACK, THAT'S WHY I USED THIS CODE:
onClipEvent (enterFrame) {
// if the mouse is over mc...
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(3);
View Replies !
View Related
Moving An Object According To Something Else
I have this movie clip with a city. This is city is about 50 times as big as the screen itself. So i want is to have a man walk around in this city, then in the movie always let the man be in the center. The man must/should be in the movie clip because of other things moving around as well.
Is this possible or do i have do make every in the flash a keyframe to move the movieclip...
Flash
-Movie clip
--Man moving
--other things moving
View Replies !
View Related
Moving An Object
I got a script earler for when you click on an object you place this script on you can move it anywhere on you page. It works fine on everything but the cart. I placed it on the actions for cart and the background moves but the buttons and text do not? What am I doing wrong.
View Replies !
View Related
Moving An Object
What would the actionscript of a script be for something like this. I want an object to move and continue to move after the arrow keys have been hit.
So you you press UP it will move up even after you let go of the key.
(I will have It will be stoped by a wall...)
View Replies !
View Related
Object Moving
Okay, I have a object which has to be moved to x,y position by pressing spacebar. (motion-tween kind of movement where an object goes step-by-step)
How to achieve it with ActionScript?
View Replies !
View Related
Moving An Object
hi
im making a movie where i have a clip with an animation of little cartoon character walking. He sits there marching on the spot. All this is taking place inside a masked filmclip. Can someone please help me understand how to script the little guy so he goes marching from where I put him, clear across the stage, and then jump to a new frame within his timeline when he exits the masked area (itll be an empty frame)?
i notice that it really grinds on the cpu when there are heavily animated movieclips playing offstage, outside a masked area (especially ones that contain masks themselves).
Hope that made sense?
I would really appreciate your help, thanks in advance
Jan33
ps. wouldn that be an onClipEvent(EnterFrame) type thingy?
View Replies !
View Related
Moving An Object ...
ok, total noob question...
if this were director, i'd say something like:
"set the postion of sprite "ioghifse" to x,y"
... or something like that.. it's been a while.. but i dont see how flash would do something like that... setting the position of a... i guess the term here is symbol? or would i need it to be a movie clip...?
if i can resolve this, this silly project is all complete but the gruntwork...
thx in advance..
View Replies !
View Related
Moving An Object
Hi,
I have a 15 frame animation that i am importing into a movie clip.
when it is imported, flash drops on the stage.
i want to select those frames and be able to move all those frames to a new location.
however, when i select all the frames, and then click and drag, it only moves one of the 15 frames.
is there something that i am missing?
thanks,
View Replies !
View Related
Object Moving Towards Mouse,how?
Instead of locking the exact centre of a MC with the mouse,i want the MC to move towards mouse slowly and attache to it and if there is any mouse movement,it moves again.I am trying it this way:I made an MC which has a ball which starts at -200x and motion tweens to 0x of the MC.I put a stop action at frame 2 in this mc(mouselock).Now i put this mc in the main movie(having two frames) and put this action
Frame 1:
startDrag ("_root.mouselock");
x1 = _root._xmouse;
Frame2:
x2 = _root._xmouse;
/ get the position of MC "mouselock"
if (x1 |= x2) {
tellTarget ("_root.mouselock") {
gotoAndPlay (2); }
}
this dosnt work the intended way???any comments?sugestions?help?
View Replies !
View Related
Moving Object In Flash
Hi everyone,I'm trying to move an object acroos the screen in Flash 5 using action scipts instead of instances.
In flash 4 normally I'll two frame inside the object I want to move where in the first one I'll have this kind of script:
Set Property ("", X Position) = Getproperty ("", _x) +5
Play
and on the second frame: Go to Previous Frame
I've tried the same under Flash 5 but it doesn't work...why???
Please help
Giano
View Replies !
View Related
Moving An Object Between Layers
Is there an easy way (besides copy and paste) to move already placed items to a new or different layer? Often I find that I need to separate objects after I've placed them. Copy and paste works, but moves them on the stage. I'd like to assign an object to a different layer without messing up the alignment.
Thanks much.
View Replies !
View Related
Moving An Object Across The Screen
I need some help on how to move an object across the screen.
just from the left side to the right side of it.
it does'nt have to spin or anything, just move across.
The 2nd thing i need help on is how to make a simple animation
like a happy face to a sad face.
View Replies !
View Related
Moving Object (please Read)
Hi,
can someone help with making a script that move an object to x,y (example x=200,y=50) when you release on a button.
To explain what I mean please look at
http://www.007.com/enter/nav.html
When you release on a button the object moves to a (x,y)-point. Every button has it's own (x,y)-point.
thanxs for your help!!!
Tim
View Replies !
View Related
Targetting A Moving Object.
Hi Flashers
I'm trying to create a game with a stationary gun. I have an mc that I use, instead of the mouse
as the targetter I can get the bullet to fire at the mouse, where ever it is on the screen, but I
want it to fire at the mc. Can anyone help me with the scripting on this?
cheers
yeffer
View Replies !
View Related
Moving An Object Across The Screen...
Hi,
I draw a circle and I want to move it from one corner to another corner...(or)to all four corners.. what are the codes for this action to assign a button?..I mean when x=500 let my "circle" move down(y) and if "y = 400" let it move back to first position..
and so on..and I will happy if could write more on other directions
Thanks
View Replies !
View Related
Help On Simple Moving Object
Yep. it's simple. all i want to do is moving obejct. the problem is that i want to make that object to float up and down. can you imagine it?...like floating...so it's moving in such a manner that it swings. i tried to do it by using the motion tweening, but it seems really fake and doesn't look swinging. i tried increasing the frame rate, but it didn't do any good as my pc can't preview such a high frame rate correctly. then i stumbled accross actionscript.(i'm not expert in flash yet). the quyestion is, how do i accomplish what i want to do?...like making that object floating on the air. do i use actionscript or some simple motion tweening will solve it?
Cheers
View Replies !
View Related
Moving An Object Through Actionscript...
Hi!
I have a movie clip of a character. He is basically static, with the exception of his left arm....it waves back & forth.
I need to use actionscript to speed up the various instances I've placed of this character on the stage. -- so that all of these guys aren't waving at the same time. I would like to simply adjust the speed number of the script on each MC instance to my liking.
This seems like the sort of script that I should use but how do I just add it to the moving arm?? Would the script be added to one of the frames inside the MC or the graphic? I have no clue.
Example of script for motion:
speed = 2;
mc01.onEnterFrame = function ()
{
this._+= speed;
if (this._x < 800)
this._x += speed;
else
this._x = 0;
}
Please help! Thank you!!!!!!!!!!!!!!!!!!
r_tist
View Replies !
View Related
Moving Object With Time
I would like and objet to move after a certain time has elasped. I used some code I found here on the forum.. I added my movement part and it does not move??
Code:
onClipEvent (load) {
displayTime = 30;
}
onClipEvent (enterFrame) {
countDown = function(message){
displayTime--;
if (displayTime == 0){
clearInterval(timer);
trace("Times Up!");
_root.bird1._x = _root.bird1._x+5;//<---not working
}
}
timer = setInterval(countDown, 200);
//trace(getTimer());
if (_root.bird1._x>980) {
_root.bird1._x =-1000;
}
}
View Replies !
View Related
Slow Moving Object(s).
Hey everyone,
I'm a pompous moron when it comes to flash. Though, when it comes to graphic design, I know what I'm doing. So, I get frustrated and as we all know Flash is a very frustrating program when you're trying to learn how to use it. So, since this is a forum where no question is stupid my first question is: Is there anyone out there willing to help out a complete and total newbie? With learning actionscript and what-not. I'm a very fast learner; it's just now I'm in college and I don't have the time to read over dozens of scripts, and learn how to do this all on my own. I need a tutor.. There is no pay. lol,
Secondly, I see sites, and they have objects that move in quickly, and then they slow down when they get to their appointed destination. How is this done, I know by some sort of witch craft you all call "action script." So, if someone could point me in the right direction it'd be mostly appreciated.
Finally, I have one last question. Is there an easier way to change for lack of better words “pages” instead of making a separate animation for each page? I know you’re probably saying WTHeck? But remember that old saying, “There are four men, how many hands would have had to shaken before everyone is acquainted with each other?” The answer being 12, each man has to shake three other people’s hands before everyone is acquainted. Is there an easier way to make each page flow flawlessly to another page, with out having to create a new animation for each sub-category and category? You know, I’ve confused myself; so, if someone understands that then good for you. Lol, okay that’s it for tonight before my brain starts to leak out from my ear.
View Replies !
View Related
Moving An Object With A Button
how now?
I'm trying to move an object in a flash movie using a button on the screen. I can get it to move in increments everytime you press the button (ie. 5 pixels at a time etc) but want to get it to move constantly when you keep the mouse pressed down.
I've tried using an onEnterFrame function but my coding is completely inept.
Can anyone help?
Much obliged...
View Replies !
View Related
Moving An Object Along The X And Y Axis
Please don't laugh I am new to this.
I want to move an image to a specific spot simultaneously along the x and y axis after clicking on a button. I figured out how to move it along the x axis but not along the y. A perfect example of this would be to go to www.tolleson.com and view some of their portfolio. If someone could help me or direct me to a tutorial that would be awesome. Thanks for your time and I hope to here from you soon.
miller10
View Replies !
View Related
Inertia When Moving An Object
Hi:
I'm trying to add inertia to the movement of a movie clip, but can't figure out how; i'm using the traditional
code: onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x+=10;
}
and such. What do i need to do to keep the character moving on the direction it was heading, even when the left arrow is pressed, and until it has lost its momentum? (in short words: inertia).
Any help would be greatly appreciated.
Cheers
Sir Patroclo
View Replies !
View Related
Moving Object To Coordinate
Hi, I'm trying to create a game and move an object around a board. I have a button to "roll the dice" and it generates a random number. Now I am trying to get the object (Cow) to move to that specific coordination. Here is the code I am currently using, which generates the random number fine, but does not move the Cow.
Code:
on (release) {
rolled_number = Number(random(6))+2;
tellTarget ("/randomNum") {
gotoAndStop(/:rolled_number);
}
if (rolled_number == 1){
Cow._x=180;
Cow._y=120;
}
}
Any help is really appreciated! Thanks!
View Replies !
View Related
Moving An Object Using X And Y Values HELP PLEASE
Moving an Object Using X and Y Values Please Help can some one please help me. I am looking to have a button or movie clip move on the page but I cant figure out how to create a start and a stop point and have it move. some thing very simple would be great. any help will bring good karma, lol
I got this to move but how do i get it to stop at a fixed point
onClipEvent(enterFrame) {
box._x = 260;
box._y = 28;
speed = -2;
this._x += speed;
}
thanks in advance
matt
View Replies !
View Related
HELP-When Paused, How Do I Keep An Object Moving?
Hi guys,
Ive seen animations on newgrounds where an object (lets say hands swinging, while a stickman is walking) is moving, even when you pause the movie. Just wondering if any of you know how to do this, because it would make things alot easier so I dont have to change every frame, and so i can have something moving thru a frame with its hands moving at the same time, without changing each frames. thanks.
View Replies !
View Related
Please Help Moving Object Issues
Hello again,
I am getting so close to finishing my menu, just need a lilttle help figuring a few things out.
I have a button that moves an object, and itself when clicked.
I need to figure out, once it has moved that on the next click it moves back.
I have attached a sample. Please help.
Thanks,
Joe
View Replies !
View Related
BitmapData Object Moving?
I wanted to know if it was possible to move with actionscript a bitmapData object (image) inside a movieclip, because I have found that this object is centered in the movieclip and I can't seem to find a way to translate it ...(_x, _y) but is there a way to move it other than creating a second movieclip inside or using matrices?
View Replies !
View Related
Moving & Stoping An Object
How can I move/slide-in a text field from off of the main stage to a specific position on the main stage?
I know how to move an object, I just do not know how to stop it once it gets to a specific location on the main stage.
For example, say I have a dynamic text field know as "txt1" and it is to the left of my main stage. Say my main stage is 500px in width and 50px in height. I would like to be able to move my dynamic text field from left to right, until it reaches say 490px of my main stage and then stop there.
What I know how to do is this:
Code:
onEnterFrame = function() {
txt1._x += 3;
}
So how can I stop the above code once it reaches a specific spot on my main stage?
View Replies !
View Related
[F8] Moving An Object Across All Frames
So I haven't used Flash in a good two years, and unfortunately I forgot how to do anything in it. I have a short 8 frame .gif, and I want to reposition it on my flash document, but when I do it, it only moves it for one frame. I've tried selecting all the frames and whatnot, but it's not happening for me. Thanks for any help in advance!
View Replies !
View Related
[F8] Moving An Object Across All Frames
So I haven't used flash in two years, and in that process I forgot how to do anything in it. So I'm wondering, how do I move an object (namely a .gif) across all frames? I just want it to remain in one place, no motion tween or anything, but when I try to move it it'll only move it for one frame.
Thanks in advance for any help!
View Replies !
View Related
Rotating A Moving Object
I have a bunch of movie clips on the stage that are postcards that you can throw around with a throwing script and sort through them with hitTestObject. I want to be able to have the pictures rotate as you move but I am having trouble with determining a way to track the mouse in relation to a moving object that will create a realistic rotation. Here's what I've got so far but it's not that great. if anyone has any ideas or can point me in the right direction I'd appreciate it.
here's a site with which accomplishes what I'm talking about:
website link
ActionScript Code:
function rotateObject(evt:Event):void {
dx=mouseX - this.x;
dy=mouseY - this.y;
//trace("dx..." + dx);
//trace("dy..." + dy);
radians=Math.atan2(dy, dx);
//trace("radians..." + radians);
this.rotation = radians * 180 / Math.PI;
//trace(this.rotation);
}
View Replies !
View Related
Moving Object With Keyboard
I have an object, lets just say it is a character in a game, I wish to have this object be controlled by they keyboard, so that left and right rotate it, and up and down move it forward and backwards.
I have left/right sorted, but I am having a lot of difficulty with the up/down keys.
ActionScript Code:
onClipEvent (keyDown) {
if (Key.isDown(Key.UP)) {
this._y = this._y+((5*Math.sin(this._rotation/(Math.PI/180))))/(Math.PI/180);
}
}
onClipEvent (keyDown) {
if (Key.isDown(Key.LEFT)) {
this._rotation = this._rotation-10;
}
}
onClipEvent (keyDown) {
if (Key.isDown(Key.RIGHT)) {
this._rotation = this._rotation+10;
}
}
where
ActionScript Code:
this._y = this._y+((5*Math.sin(this._rotation/(Math.PI/180))))/(Math.PI/180);
is the code for moving the object in the Y direction when you press UP (I will be able to modify it for down etc.). It is pretty rubbishy at the moment as I have been trying all sorts of weird and wonderfull, but wrong, ways of doing it -_- - basically what I have attempted to do is have program work out (from the given angel [this._rotation] and how far I want it to move in total [5]) how much the object needs to move in the Y and X directions.
Thankyou in advance for any help
View Replies !
View Related
Moving Object In Various Directions
Hi Team,
Firstly, I'm fairly new to Flash (thank god for FlashKit and similiar sites aye? )
Here's the situation I'm in:
I have 2 buttons on my stage. When I click one button I want to move an object in one direction. When I click the other button, I want the same object to move in a different direction. The movement, ofcourse, must be animated.
How should I go about doing this?
Any ideas, hints, tips and links are muchly appreciated!
View Replies !
View Related
Moving An Object Using Actionscript
i just have one problem with the tutorial "Sliding Menus:Moving an Object on Roll Over using ActionScript"
when i do as told in the tutorial, everything works fine. But when i load
that .swf into my main movie, it seems that all my coodinates _x and _y are
not valide anymore, the movie always come at the edge of the target/movie in
which i load the .swf from your tutorial. i tried to change the _root part
but nothing... i tyied many thing actually but i still face the same
problem. the only solution i found was to nest the.swf from the turial into
a movie which is then loaded in my target/movie in my main movie.
i hope i did not lose you with all those "movie".
but i need help cause i i don't get why it works in it's own movie but not when you load it???????????????????????????????????????
View Replies !
View Related
Listener On Moving Object?
Greetings
I've a question:
i'm attaching 3 mc's to my _root
when you press a button, they all move to a specific location by using mx.transitions. Now, my question is: how can i detect if my button is arrived at this location?
I was thinking of a listener, but there isn't a method called onMoving
Thanks dudes!
View Replies !
View Related
Moving An Object By Dragging Another
Hi,
I'm trying to get an image (xray machine) to drag over a man to reveal his x-ray. Sounds simple, have got mask to drag over image but without the 'magnifying glass' image to move with it, and have got magnifying glass to move with it but then mask moves around and only reveals same part of underlying image(like its dragging the under image too). is there a way of using _x and _y of magnifying glass to equal the mask's coordinates and get them to move together without having to be in the same movie clip
View Replies !
View Related
Moving An Object In The Stage
Any help on this would be greatly appreciated. I have an object that is serving as a background for a flash website. The background object (a table) moves and rotates around when clicked, exposing different parts of the table on the stage when the user clicks.
Here is as close an example as I can find:
http://www.vermeersch.ca/
My problem is when i want to transition between two points on the table, the table has to rotate and move.. and by just using a motion tween between the two points results in the table rotating off the stage for a few frames (thus exposing the background and making it look really cheezy). I was trying my hand at using motion guides, but can't do it with any accuracy.
So, my question is: Is there a way to guide an object as it rotates and moves so that it doesn't move off screen? (there is plenty of room on the table if i can just guide its path through the 2 second transition). Thanks for any support.
View Replies !
View Related
|