ActionScript 2.0 :: Easing And Moving Mc?
Mar 1, 2010Who knows the first and second "this" refers to what mc
View 12 RepliesWho knows the first and second "this" refers to what mc
View 12 RepliesHow do I can I adjust the Easing property of moving MC when I am moving the MC with AS (not with motion tween)? I got an MC and I am increasing it's _x by 1 till the _x got to 100. How can I adjust the easing, so that when it become close to 100 it will slowly stopped?
View 14 RepliesI have a stack of images that I need to move down when the mouse is above y = 250 and up when the mouse is below y = 250. I have this code, but the problem is I don't know how to add easing.
Code:
onEnterFrame = function() {
someConstant = 2342;
lastIndex = picThumbArray.length - 1;
[Code]....
how do i can i adjust the Easing property of moving MC when im moving the MC with AS (not with motion tween) ?!i got an MC and im increasing it's _x by 1 till the _x got to 100.how can i adjust the easing, so that when it become close to 100 it will slowly stopped?
View 14 Repliesim trying to create this custom menu a bit more efficiently. As written, it operates fine glitch free. However, id like to incorporate some easing into the movement of each movie clip.
[code]...
how to incorporate tween classes and then easing?
I've built a code to cyclically move a scene on the bottom of my stage; I've done this to make a slowing-and-stop-easing effect at anytime the command will arrive. The entire scene mc is _x long something like 6000 px. The whole code goes in this way:
1) importing on the stage (with attachMovie) a mc with this code inside:
onClipEvent(enterFrame) {
_parent._parent.fondo_mc._x -= countermovement;
if (_parent._parent.fondo_mc._x <= -5800) {[code].....
The code goes right, but I need to improve it.Now there is just a variable, I tought to use two vars to implement the whole code in a setInterval, but maybe it's unuseful, and actually I can't use it in the right way.
Second issue: actually when slowAndStop function is called the scene slow too fast, if I take it to 15 it slow better but the scene is running too fast...
The best would be that the scene slow down and stop following: A) a temporal variable (and I can try to implement it with setInterval, that for istance is a cycle)
B) an indipendent moving variable, so that on one side I set the speed, on the other side I set the slow-and-stop in a matter of time with countermovement.I also tried to use a second variable:
var counter:Number = 15;
// set the _x increment
var countermovement:Number = counter/2;
but the scene slow and goes backward a bit
I'm familiar with how to ease something in using motion math. Easing out would not be that bad either. But how would I script something easing in half way, then easing out the second half? It would start slow, gradually move faster, then slow to a stop at the end. - almost like a sine wave I guess?
View 1 Repliesim 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].......
what i have is a tween on a movie clip of a popcorn kernel on one layer and a tween on a button on another layer to follow the movie clip. i want to be able to roll over the kernel and make it "pop". i changed my over on the button to popped corn (this works) but i want it to stay popped for the rest of the tween.
View 11 RepliesI want to know how i can moving my scene by moving a mouse over them.
to understand what i want exactly ckeck this link :- [URL]
I have some simple script that has 2 "movie clips". What I want to do is to start moving the second movie clip at the same time when the 1st starts moving. (both start moving at the same time) I tried the following script but it never works:
[Code]...
not really that handy with scripting, was wondering if someone knows how to add some easing to this. Right now i gave an mc that rolls out and back, but i would like there to be a bit of ease in ease out on it if possible.on the mc that you rollover is this
on(rollOver) {
this.forwards=true;
this.backwards=false;
[code]......
How can I add bounce easing to a classic tween in FlashCS4 ?
View 1 RepliesI'm having trouble with the new keyframing model in Flash CS4.Say I have a symbol that starts here, then moves over there, then waits, then moves back over there again, etc. etc.Using the new model, all of these movements seem to be considered the same and single tween.If I apply easing, the easing affects the entire range of keyframes. This doesn't make sense? I may want the symbol to slow down when it gets "there" and have different easing for different movements. Does this make sense?
View 1 RepliesIn this documentation it says that flash CS5 should support custom easing, just like old good CS3 and earlier versions of flash.however, this feature seems to be missing from CS5. it says:Click the Edit button next to the Ease slider in the frame Property inspector.but there is no "edit button" in the panel with easing slider.
View 4 RepliesI have a Flash Movie which has an image that zooms in/out and can be reset using the following code.
[Code]....
The effect is not very smooth so my question is how do i do this with easing.
I've created a page that contains 3 different movie clips that scroll left and right in respose to the mouse. They each move at different rates and create a parallax effect. My question is how do I ease the movie clips in and out of their stop positions? At the moment they all run full speed in and out of a stop.[code]
View 3 Repliesi have this script that i am using to drag with easing. it works but how do i make sure it stops when it gets to the edge of the movie. Right now since there is easing on it, you can throw the shape right off of the stage. Is there a way it can stop?
[Code]...
Using one of the tutorial under "Best of Kirupa thread", I managed to modify the script and get a resizable dynamic photo gallery working perfectly. Now, I have an external swf with the following script. It works fine independently but when I load it in the container MC of my photo gallery, it don't. What's wrong with the script and what do I need to double check and change?
[AS]
onClipEvent (load) {
_x = 0;
_y = 0;
[Code].....
Hi,
I'm trying to create a not that ordinary typewriter. The thing is, that I wan't it to ease. So I just thought that I could use: speed^0.5, but it really doesn't seem to affect the speed?
The idea is, that the first part of the text is written into the textField very fast, and then it types slower and slower...
This code works, but there's no easing, don't now if there's an easy way to add that:
[AS]TextField.prototype.typewriter = function(stringy, func) {
var myText = this;
var i = 0;
var intv = setInterval(function () {
myText.text = stringy.substring(0, i);
i += 2;
if (i>stringy.length) {
clearInterval(intv);
}
updateAfterEvent();
}, func);
};
var mystring = "here goes the text";
var speed = 10;
txt.typewriter(mystring, speed);
[/AS]Thanks, Morten
how to put any easing into the rotation for the life of me...
Code:
mouseDirection = (Math.atan2(gMouse.y-_y, gMouse.x-_x)/Math.PI*180)+180;
_rotation=mouseDirection;
//Some attempts:::
[Code]....
I am creating a vertical menu with sub-links, which expand out once the main link is pressed, pushing all the buttons below them downwards (with easing). Except when i give one of the links a _y position to ease to, it never fully makes it to it, by under 1 pixel, leaving it slightly blurred.For example, i want to ease one of the buttons below the clicked-on button to _y = 300. but it eases to 299.5.
the equation for this is..
onClipEvent (enterFrame) {
dist = _root.link_03_pos - this._y;
travel = dist / _root.speed;
this._y += travel;
}
_root.link_03_pos is passed a new _y position when any button is pressed.Why, when the dist is smaller than 1, does flash stop moving the mc?
Has anybody found a way to ease motion only between keyframes, not the whole animation? In classic u get separate easings.Generally, I want to convert old tween to new for more control, but it seems to be impossible.
View 4 RepliesI have a dynamic textfield that loads an xml file and I'm looking for a good tutorial on how to create a custom scrollbar component to scroll the textfield with easing.
View 4 RepliesRight. I've been trying to make interactive 360 animtions, which consist of 36 separate images which make up the final animation. I've managed to make the images interactive by clicking and dragging them, but I would like to add something extra to it now.I would like to add (not sure if this is the right name for it) frame easing? For example, when the user clicks and drags the 3D object at speed, the object slows down gradually, rather than to a complete stop when the mouse is up. I found an example of this on Flashtunning
View 3 RepliesI have an xml sheet that has a number of values - one of them contains the type of easing that I would like to apply to a movie clip.
Code:
<settings loop="false">
<section duration="5">
<image startX="-120" endX="0" startY="-80" endY="0" startAlpha="100" endAlpha="100" duration="6" easing="Elastic.easeOut" delay="0" startScale="90" endScale="100">images/9_properties_l.jpg</image>
[Code] .....
I've tried type casting as "function" as well and it doesn't seem to be working. Any ideas?
CS4: Motion Tween With Multiple Eases?
well, In Flash CS3, it was actually possible to give an easing instruction to each segment (keyframes) of an animation. In Flash CS4, in between two frames of an Motion Tween, isn't it possible anymore? I'm trying but the easing instruction applies only for the entire Motion Tween.
I've got a png sequence of a 3d object rotating on my timeline. My as3 find the mouse.x and uses math to choose which frame in the sequence to move to. I need to be add easing to the movement.
AS3 in use:
stage.addEventListener(MouseEvent.MOUSE_MOVE,findF rame);
function findFrame(event:Event):void{
var frame:int = Math.floor((stage.mouseX/stage.stageWidth) * 31);
gotoAndStop(frame);
}
Using Voetsjoeba's golden formula, I've made some panels that ease into place. But why can't they start at 0,0? It seems I have to start the panels from the middle of the stage or else they drift off the edge, even with x and y specified in the code.
View 8 RepliesI am just wandering how do I use the equations I downloaded from robertpenner. Whenever I try even working out of the book I get error messages like
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 350: There is no method with the name 'easeOutBounce'.
return(Math.easeOutBounce(t * 2 - d, 0, c, d) * 0.500000 + c * 0.500000 + b);
Why does it say there is no method with the name bounceEaseOut. How I can use these in my flash movies.