ActionScript 2.0 :: Moving A MC Smoothly?
Jun 3, 2006
Right I have a movieclip called Menu1 and I currently have a function that when called moves that movie clip to a set of co-ordinates. The function is run on a onEnterFrame. The codes is as follows
Code:
function moveMenu(xValue:Number, yValue:Number){
if (this.Menu1._x> xValue) {
[Code].....
So at the moment, the values (x and y) are passed to the function and it moves to that location 45px per frame and when it is within 45px of the target it jumps to the exact point.
1) I want the movieclip to accelerate and deaccelerate as it moves.
2) At the moment it doesn't take the direct route it only goes up down left right and at a 45 degree diagonal. I want it to go to the point in a straight line.
View 2 Replies
Similar Posts:
Mar 18, 2009
I have made a rotating images but the images are not moving smoothly. You can see the example at:-URL...Does anyone know why the images not moving smoothly?
View 3 Replies
Jun 1, 2011
I am trying to animate the circle to follow the cursor point. Its working fine, but when you move the cursor little faster the animation struck.
import flash.events.MouseEvent;import fl.transitions.Tween;import fl.transitions.*;import fl.transitions.easing.*;
var moveXY:Number;var speed:Number = 1;
[Code].....
View 8 Replies
Mar 14, 2012
I've got a problem in actionscript3 with moving large DisplayObject-s. When the size of the DisplayObject is quite large (more than screen size) the movement loses smoothness and it looks like the object starts jumping forward and backward, which overall looks very unpleasant.
Does anybody know the way to fix that? I am trying to make a sort of a race game, where I need to move the background sprite to make the illusion of movement.
Code:
private var obj:Sprite;
private var canvas:Sprite;
// determines spatial spread of circles
private var size:int = 1000;
[Code]....
View 3 Replies
Oct 2, 2010
I have a movieclip (mstone) depicting a signpost, which is within another movieclip (graphic1). I am trying to scale mstone to increase by about 44%, and it needs to move along the screen in such as manner that it is moving towards the user. Some how the scale and the x,y coordinates I am providing don't seem to reflect the same way as it normally would, when I see the website live.
Is there a smooth way to move the clip, without specifying particular x,y co-ordinates?? I am using the _xscale, _yscale, _x and _y properties. Not producing the desired effect.
View 5 Replies
Mar 14, 2012
I've got a problem in actionscript3 with moving large DisplayObject-s. When the size of the DisplayObject is quite large (more than screen size) the movement loses smoothness and it looks like the object starts jumping forward and backward, which overall looks very unpleasant. Does anybody know the way to fix that? I am trying to make a sort of a race game, where I need to move the background sprite to make the illusion of movement.
View 1 Replies
Aug 1, 2004
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 Replies
Nov 30, 2009
I am doing an animation with a movie clip that needs to follow the mouse on the Y axis only smoothly and needs to stay inside a fixed dimension. (e.g. the mc could moves 200px left or 200px right maximum) And I want it to stop smoothly too when it reach the limits.
View 1 Replies
Feb 16, 2012
I am developing a ipad game using flash CS5. When I run it in flash or web browser, it run quite smoothly but when I published it into ipa file and run it on my own ipad, it became very very slow. Since my game has many stages and characters, the amount of symbols may up to more than 50. That makes the flash file more than 100mb (but the ipa is only 11mb) All of the symbols are exported in frame 1.
1)if I used preloader and exports the symbols in frame 2, will my game run more smoothly? is one preloader when the game is loaded enough? or it is need for every game scenes?
2)Is there any other technique that a big game developed in Flash has to follow in order can be run in low configurations devices?
3)Why many other big game can run so smoothly although it contains a lot more characters and background than mine?
View 3 Replies
Aug 1, 2004
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 Replies
Nov 30, 2009
I am doing an animation with a movie clip that needs to follow the mouse on the Y axis only smoothly and needs to stay inside a fixed dimension. (e.g. the mc could moves 200px left or 200px right maximum) And I want it to stop smoothly too when it reach the limits.
View 2 Replies
May 17, 2011
I have 2 problems. I need to make a blur transition system where I can blur objects in and out smoothly. I'm thinking I could base it on timers and certain events/variables/values. Don't know if the blur class goes with the transition class or not. My 2nd problem I may make another thread. How would I influence the 3D angle of an object via actionscipt? I'd like to do a cool viewpoint/angle effect as you move your mouse across the screen.
View 3 Replies
Dec 21, 2010
I will need to display the frames of an FLV at different rates.
Here are some examples:
the user will 'scrub' through the flv frames(front/back) the flv will need to play at half the speed on a user interaction.
Currently I'm using LoaderMax and it's VideoLoader object to load and play FLV files. I've tried using the playProgress property, but only the keyframes of the FLV are displayed. I got the same result with the basic setup(using the NetStream class)
As a workaround, I playback the FLV once, and cache BitmapData instances in which I draw/cache each frame of the video. After this is done, I use the BitmapData Vector to update a Bitmap on stage. Scrubbing/changing speed works fine with this method, but still the user needs to see(wait for) the sequence once, while it gets cached, which I don't like.
View 2 Replies
Jan 21, 2009
take a peek at youtube main pageWhat's your thoughts on the "Lost" TV show preview there. It's huge, it has sound, nonetheless it runs smoothly and almost instantaneously. And the quality is greatIt is interactive therefore it's kind of like a tiny mini website within the website, swf with video in it, right?now how do you get video of this quality to run this smoothly as far as AS goes? Looking in the Safari Activity window I don't even see things downloading (of considerable kilobyte size that is)
View 1 Replies
Nov 30, 2009
I am doing an animation with a movie clip that needs to follow the mouse on the Y axis only smoothly and needs to stay inside a fixed dimension. (e.g. the mc could moves 200px left or 200px right maximum) And I want it to stop smoothly too when it reach the limits.
View 1 Replies
Jan 28, 2010
I am working on a website that, among other things, has an flv player to display certain flv videos. The problem is that some times the videos don't play smoothly even if they are fully loaded. I am using AS3 to load the videos to the flv player
conn= new NetConnection();
conn.connect(null);
stream1 = new NetStream(conn);
[code]....
My guess is that it happens due to connection speed/size of videos, but if so, wouldn't it play smoothly once the video is fully loaded?
View 1 Replies
Jan 10, 2005
Does anyone knows how to fade images smoothly using actionscript
View 1 Replies
May 17, 2007
i have music that im gonna put in the timeline...music& sfx...and i want is so that when someone clicks a button to another section, that the music on that particular section doesnt just cut off, that it goes from volume 100 to 0 smoothly, like if one were to turn the volume down on a radio.
View 5 Replies
Nov 2, 2010
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].......
View 2 Replies
Jun 14, 2009
i want to make a bar jump smoothly from one scale to another, basically like a visual sound output without the sound. I've been stuck on this one for a few hours now and i know it must be just a logic problem
[Code].....
Whats happening here is that the Bar is scaling to the first random point perfectly but as soon as its target becomes a number around 0.50ish it will stick around that forever because the difference will be too small from there to the next point (i think). So is there any way that it can still make large jumps while using Zeno's Paradox type easing?
View 1 Replies
Jun 1, 2009
I think I might of already posted this, but the forums are loading at about 400k a sec so I don't feel like wasting another 25 minutes just look through the first page of threads or my history.
I have an object that I want to smoothly move along the x axis when the user clicks on the screen. I first made a prototype that would make the ball end at a location I specified by doing x = 450; I then tried looping ball1.x += 1 with a for/do (I encapsulated it with a boolean so the if ball1.x got to 450 it would stop) statement and I couldn't see the ball transition, I just saw it stop at the 450 mark.
View 9 Replies
Jul 13, 2009
I have exported my flash project into swf format
it is not playing smoothly
Even in the test movie also it is coming like that
I have increased the frame rate to 120fps even it is coming like that
View 3 Replies
Jul 28, 2009
I am trying to smoothly integrate a video player into my website. Specifically, I want the "header image" on a page to transform into a video player when a user clicks a small "watch video" icon. I plan to use Flash CS4 for the project. A great example of this is found on the following website by clicking the "watch video" button: [Url]
View 5 Replies
Jun 10, 2011
I got this code and i whant to make it so unit moves smoothly to the destination i got told to seach key words like LiteTween and built in tween
unit.onRelease = function(){ _root.onMouseUp = function(){ unit._x = _xmouse; unit._y = _ymouse; delete _root.onMouseUp; }}
View 7 Replies
Aug 15, 2011
How do I build a scrollbar that listens when certain text is at some Y position and triggers certain animations(MovieClips to play or stop)? I was using this code but is not so responsive sometimes works and sometimes no.
import com.tis.utils.components.Scrollbar;
var s2Bar:Scrollbar = new Scrollbar(aboutMC.about);
s2Bar.name = "ScrollBarMc";
[Code].....
View 1 Replies
Jun 28, 2011
I have a Flex 3 app that has elements that a user can add to the main canvas then resize and reposition.
There are 3 key functions I am using for the resize which are as follows[code]...
View 1 Replies
Feb 16, 2012
I'm programming a game in as3 using flashDevelop the player (among other things) is moving across the screen using EnterFrame event which update his coordinates while he moves its hard to see details of the animation and its look kinda blur how do i fix this problem?
View 3 Replies
May 8, 2010
i'm rewriting my game code in as3 and can't figure out how to make my hero move smoothly once the directional keys are down. In as2 all I had to do was putting a line lke this: "if(key.isDown(Key.RIGHT)" and as long as the right arrow was being pressed, my hero was moving nicely across the screen. In as3, however, having written a very similar code, the hero knd of gets oddly "blocked" from moving. My as code looks liek this:
[Code]...
View 1 Replies
Oct 13, 2010
I am trying to make an object smoothly rotate towards the mouse.
ActionScript Code:
var rot:Number = 0;
var smoothing:int = 5;
stage.addEventListener("enterFrame", step);
function step(e:Event):void {
// point_direction is a function I have created that finds the angle between 2 points. I know this functions works as it is supposed to
rot = point_direction(obj.x, obj.y, mouseX, mouseY);
obj.rotation += (rot - obj.rotation) / smoothing;
}
This code works, except when I pass the mouse over the center of the object on the left side it seems to spin the long way around. So if I move the mouse down the center of the object on it's left side, it will spin a long way counter-clockwise to reach the mouse instead of the tiny length if it had spun clockwise.
View 3 Replies
Dec 7, 2010
I am using Adobe AIR to develop for Android and loading xml text into a dynamic text field.... when I drag the text to see more or less, it is PAINFULLY slow
View 0 Replies