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.
FlashKit > Flash Help > Flash MX
Posted on: 12-02-2002, 01:58 PM
View Complete Forum Thread with Replies
Sponsored Links:
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
Intermediate Gray Screen Seen While Moving From One Screen To Another
I am integrating flash with VC++ using ActiveX.Here when I click on buttons to go to the next screen an intermediate blank screen flashes for a second that looks very odd.In fact for some screens that have many movie clips the blank screen stays there for a few seconds before showing the actual frame. This causes a blinking effect that is not proper.I wish to know why this happens and how it can be removed.
Thanks in advance.
View Replies !
View Related
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
Moving Car Across Screen... Then Changes To Another
Hi im new to actionscripting, just starting to learn it. I need to make an animation where shops go past along with cloud and the road and 3 different types of caravans will drive on the road.
I have already done the clouds and the moving shops, and im wondering if someone can help me getting the caravans to work.
Basically caravan number 1 needs to drive on screen from the left, keep driving for a few minutes then drive back where it came from, and then caravan number 2 appears, does the same thing then goes back to allow caravan 3 to go on. This will need to be in a constant loop.
I have uploaded my animation if you want to view it.
Much help would be appreciated thanks.
p.s. Please do not worry about the current graphic's for the caravans. I will change them later when i get the pictures. Thankss!
EDIT: Sorry this is for Flash 8 Professional
View Replies !
View Related
Moving The Screen
I need help working out this code I got for moving the screen.
Code:
this.onEnterFrame=function(){
if(this._xmouse>this._width){
_parent._x+=5;
}
if(this._xmouse<this._width){
_parent._x-=5;
}
if(this._ymouse>this._height){
_parent._y+=5;
}
if(this._ymouse<this._height){
_parent._y-=5;
}
}
You see I created a Square with Alpha 0% and slapped this code on it. The problem is, I'm tring to make the screen move up, down, right or left when the mouse is over the top, bottem, right or left of the screen, but it moves in other directions when it's not at the t,b,r or l of the screen and won't move back. Maybe the code is wrong or I did something wrong with the square. If someone can please help me.
View Replies !
View Related
Moving Several Movies Off Screen At Once
Hello everybody!
I hope I can make myself clear and what I want to do:
I have several movies (each is a picture which can be dragged around the stage by the user). All movies are placed in one layer.
The idea is when the user clicks to go on to another part of the flash movie I'd like to wipe all pictures of stage at once. Like the moment the user clicks to go on all movies are moved to the left and off stage by an invisible hand.
I have no idea what the action script code is. I guess it is fairly easy, just some mathmetics but I don't know how to start (like "on release move movie_01, movie_02...08 to the left"). I hope someone understands what I wanna do and can help me?
With best regards!
Cheers!
View Replies !
View Related
Moving Symbol Across Screen
Ive posted once before and didnt get much response. but thats ok ive got a simplier question now.
i want to move myBall._x 5 pixels every second. here is my code that i have placed in the "actions for Frame1 of Layer Name myBall"...
onClipEvent (load) {
setInterval(moveIt(),1000);
function moveIt(){
this._x = this._x + 5;
}
}
im still struggling to grasp where MX ActionScript is placed.
any suggestions? thank you
View Replies !
View Related
Moving Symbol Across Screen
Ive posted once before and didnt get much response. but thats ok ive got a simplier question now.
i want to move myBall._x 5 pixels every second. here is my code that i have placed in the "actions for Frame1 of Layer Name myBall"...
onClipEvent (load) {
setInterval(moveIt(),1000);
function moveIt(){
this._x = this._x + 5;
}
}
im still struggling to grasp where MX ActionScript is placed.
any suggestions? thank you
View Replies !
View Related
Help With Scrolling Screen And Moving Sprite
I'm building a protoype for a game (dont mind the graphics).
What I want to do is to move a sprite around a screen.
The screen should move if the sprite moves, unless it is close to the edges.
It works fine when moving to the right side and going back.
Once the sprite moves from the left side, the sprite doesnt stop in the middle of the screen as it should. Instead both the background and the sprite moves, until the sprite moves to the edge of the screen which is wrong.
The sprite should stay in centre unless it reaches the edges.
Can anybody help?
It looks so simple, but I've tried for days to figure this out.
Thank you.
Here's the link: http://birkelid.com/flash/kontroll.fla
View Replies !
View Related
Stopping Items From Moving Off Screen, Possible?
Hello again people, ive got my paddles to move at last. Now im trying to stop them from going off the stage at the top and the bottom. If you keep the key presses up or down it will continue to move into I guess indefinatly. Ive added an if statement after my movement code but it dont seem to work, Anyone know why this peice of code is not working thanks.
Code:
private function keyPressedDown(event:KeyboardEvent):void {
var key:uint = event.keyCode;
var step:uint = 5
switch (key) {
case Keyboard.UP :
myleftbat.y -= step;
if (myleftbat.y > stage.stageHeight) {
myleftbat.y < (stage.stageHeight);
}
break;
case Keyboard.DOWN :
myleftbat.y += step;
if (myleftbat.y < stage.stageHeight) {
myleftbat.y == (stage.stageHeight);
}
break;
case Keyboard.NUMPAD_8:
myrightbat.y -= step;
if (myleftbat.y > stage.stageHeight) {
myleftbat.y < (stage.stageHeight);
}
break;
case Keyboard.NUMPAD_2:
myrightbat.y += step;
if (myleftbat.y < stage.stageHeight) {
myleftbat.y == (stage.stageHeight);
}
break;
}
View Replies !
View Related
Panning/moving Images Across A Screen
I am creating a flash site and as part of my intro i want a series of images to pan across the middle of the page in a steady motion and smooth stated with no jerks, and at a constant slow pace through out, how can i ge this to happen? Hope someone can help thank you, i have mamaneged to do it useing tweens and a lot of timeline space but the effect is not smooth and the speed of it is too quick is there a way without tweens(as it takes up mor memeory) that i can achieve this effect?
thank you
View Replies !
View Related
Moving A Symbol From Random X Position Across Screen.
I am trying to create a rain type effect, but i don't know how to using actionscript. I want the rain symbol to start at a random location above the stage, and then fall at an angle to the bottom. I also want the rain symbol to start to fall at different times. If you can help me with this i would greatly apreciate it.
View Replies !
View Related
Red Artifacts Left On Screen When Moving With Actionscript?
I've got several small moveiclips moving around the screen to different locations using the tween class, and for some reason it leaves little red artifacts in their trail on the screen that won't go away. any way to refresh the screen or something?
Is the only way around this to cache the movieclips as bitmaps? that seems to fix it, but i don't want to do that...
View Replies !
View Related
Scaling And Moving A Line Across The Screen In Repsonse To A Rollover
Hi people!!
Wow - 3wks today! Scary! Anyway....
I really need some help!
I've got a horizontal menu running across the top of the page. Its a simplistic looking one using just words as buttons. However I would like to make it a little more interesting by having a line that will shift from button to button (left to right etc.) as the user rolls over the respective buttons, so it 'underlines' them.
I can make it jump from button to button by having the line as an MC then using the _x(position) property, but really I would like it to 'move' accross the screen to each button.
If possible to make it even sexier! I would like to be able to change the _xscale of the line so it 'grows' / 'shrinks' to the right size of each word.
REALLY hope someone can help me!!
Cheers Deadhands
Anything nice in your Advent Calendars today?!
View Replies !
View Related
Have A Moving Ball On Screen... Want Coordinates In Text Boxes
first off i am using flash mx 2004
i am trying to get a ball to move around on the screen cooresponding to pressing the appropriate arrow keys... i got that to work
i also want the x/y coordinates of the circle to always be displayed in text boxes... i keep getting an "undefined" in the text box instead of the coordinate...
i created the circle... converted it to a movie clicp called "circle"
i then clicked on the circle and put the code to move it if arrow keys are pressed
PHP Code:
onClipEvent(enterFrame){ blah blah blah (it works just find) }
then i created a new layer called actions... i threw 4 text boxes on the screen... 2 of them are just regular static fields that say Xcoord: and Ycoord: .... the other two are dynamic text boxes with varx and vary
i went to the actions for that layer and typed
PHP Code:
varx=_root.circle._x; vary=_root.circle._y;
i thought that would work but as i said it just displays "undefined" in the boxes
it must be a simple problem... and i hope i am posting correctly... thanks!
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 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.
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 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
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
|