ActionScript 3.0 :: Create That Effect - Keep Movement Speed?
Oct 2, 2010
I have been trying to find a way to make an object that is being dragged keep the speed and angle of the dragging movement, I have been trying some physics libraries but I want to know the basics to create that effect,
I was actually trying to create an easing effect that bases on the movement of the mouse, very similar to:[URL]how i could actually write an actionscript to create this "esaing" ability...I have actually attached my own file for your convience, and i really really really hope you guys could assist me in this area!
I have a Mogli (Junglebook-like) Character that i got to move with the arrow keys on the keyboard.
I want the character to jump (so for example , he must while moving to the right of the "gamearea" , you must be able to hit a key (say for example the "control" key ) and then the character must jump ( go up ) and as soon as the key is released he must obviously come down.
And also how do one set movement speed on any particular movement.
I have made it so you can move with the arrow keys and that works out great. But, every time you click a new key the speed increases for some reason which i do not want. I want it to go in the direction with the same speed.
I am trying to get an object to track my mouse on press and i am using a tween. However, the nature of the tween is such that the time taken for the object would move would always be constant despite the distance.
I would like to make the object travel at a constant speed regardless of the distance. Is it correct for me to use a tween? If not what should I be using?The code for my tween is as follows.
map_mc.tracker_mc is the mouse cursor that would appear when onPress while the map_mc.crosshair_mc is the object that would track my cursor's movements.
I am trying to write a script to move a ball MC smoothly across the stage, without using tweens. I have thus far been successful, but there is one problem: the way I have it set up, speed increases with distance! I need the speed to remain constant. I understand why, but I can't figure out what approach to take to make the speed constant.
ActionScript Code: var speed = 100; var newx, newy, distx, disty, speedt;[code].....
I have a rock movieclip that is in an array and a timed function that places an instance of the rock on the stage every 5 seconds. So every 5 seconds a rock is placed onto the stage. What I want is when a rock is placed onto the stage it rotates either clockwise or anticlockwise. So every 5 seconds a rock appears and it will rotate either clockwise or anitclockwise. I also want the rocks to rotate at a random speed. So every time a rock appears its rotation speed will be different. I also need the rocks to move in a random direction. So every time a rock appears it will travel in a different direction to the previous rock.
I am currently working on a Flash application in which I have several vertical bars that go across the window, and when one of the bars is clicked on, the others move to either the left or the right to create space to the right of the selected bar for a large image.[URL].. I have already written enough of the script to get the bars to move to where they should be when they are clicked on, but they do it instantly--there is no show of movement between point 1 and point 2 (this being the starting and ending x coordinates for each movieclip).
If you're wondering about any of my number values, they are the way they are because the document is 800 wide, it has 5 vertical bars within it, each of them 30 wide, and the bars are 5 pixels apart when placed next to each other. Anyways, here's the script I am currently working with:
[Code]...
With this code, all the speed variable does is determine the length of the pause before the bar goes from its original x coordinate to its final x coordinate. I have tried to replace the line that reads "clip3_mc._x += speed;" with several variations ("clip3_mc._x ++;" , "clip_mc._x = clip_mc._x + 15"), but I don't think that's the issue.
I use something like this code to detect the speed of the movement of a dragged object
PHP Code:
if (!go) { this["position_"+i] = this._y; i++;[code]....
This way I can find in what direction the mouse vertically has moved and at what speed. The problem is that every once in a while the speed will be in the opposite direction. What do people use to detect the direction of the movement of the mouse?
is there any Class available to set the speed of the movement tween by pixel per cetain period?because, if using the standart Tween function, the speed is set by the lenght per certain period.later on if i want to adjust the original and finish state, the speed of the movement became different because the period is the same, but the lenght is chaged.
I tried with AS2 to animate the movement of a cylinder going non stop up and down and with possibility to change speed. I managed the sliding down and the acceleration of the cylinder but it does not recognize the limit where it has to stop and make the movement backwards to starting position.[code]
Here is the .fla, I'm hoping to speed up the cube effect transition. I've been toying with the variables, and nothing is working...perhaps it works off the grid somehow? You can download the file here, it was too big by 150kb to upload here, If the download doesn't work, here's a link to the page I found the transition effect on, it's the bottom flash video. [URL]
I was wondering if anyone could show me how to achieve the effect on this site:asically, the script for how to make the mouse position effect the position on the movieclips.
I made a horizontal scroll bar using kirupa file for a vertical one, but i need to add an ease effect on the movement of the movieclip. The code i use follows.
How do I do a scale movement using the easy effect? I study a lot of examples, using speed/5, but... didn't work. I just saw a site that tells what do I want to do: [URL]
I'm creating a game like a paper plane movement. The movement should start with the drag and throw effect . With the drag and throw speed, the paper plane must fly through the scene with a glide movement. I got confused with its physics.
So I got this from the tut on this site and it's works great.I can't figure out though how to make the speed random as well as the movent. I want all my little clips to move at random speeds in adition to direction.
actually i want to create this kinda effect which i'm using for my own blog... i'm not a programmer, i'm a designer but i do know 30% of actionscript 2.0
here what i want to achieve is showing in the attached document
how to use AS to create movement with easing in AND out?
I was trying to get an mc spin according to the speed of the mouse. So when I move my mouse quickly, the object starts spinning faster and faster, but after reaching it's maximum speed, it slows down again.
I'd be very interested to see how this motion is achieved with actionscript alone and not with tweening. This is the scenario I would like to see - two buttons that dont move of course When button one is pressed a green square slides in nice and smoothly using actionscript. When button two is pressed, the green square slides out and is replaced with a blue square - so whenever on of the buttons is pressed, the square on screen slides out before the other one slides in.
It would also be good if the green square and blue squares were in their own swf files and loaded into levels rather than an empty movie clip.
[code]I follwed i tutorial the other day on how to create random bubble movement snd it works but the bubbles generate across the page, but i just want them to generate between around 300 x 500 pixels