Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Easing Following Button



Ill try to explain my problem as best as possible.

I wanted to create a button that followed the users mouse.

Heres what i did..

Scene1 contains a movie clip with the following action script.

onClipEvent (load) {
_x = 0;
_y = 0;
speed = 45;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}


Since with a movie, you do not have access too the On Mouse Event actionscript available, i go into the movie (edit) delete its contents and insert a new button INSIDE the movie. This results in a button that follows my mouse instead of just a simple movie clip.


The problem i am having is i can not get action scripts to launch from the button. The On Mouse Event wont do anything. All i want the button to do is

on (release) {
gotoAndPlay ("Scene2", 1);
}

But when i click the button nothing happens. I am fairly certain that flash is seeing this moving object as a button because in IE, the cursor changes from an arrow to a poiting finger and i am able to edit the button's up, over, down, and hit frames which respond correctly in the movie.

I am VERY confused by this. All i can think is maybe i can not execute actionscripts from a button within an instance of a movie.


Any suggestions? hope that made sense!


Feel free to download my source at http://www.infernalarts.com/index2.fla

Keith



KirupaForum > Flash > Flash 8 (and earlier) > Flash 5
Posted on: 03-04-2004, 08:57 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Button Easing
Hi,

If I want a button when pressed go to a certain x/y co-ordinate, by not using tween but using actionscript how can i do this?

pixelmisfit

Easing Following Button
Ill try to explain my problem as best as possible.

I wanted to create a button that followed the users mouse.

Heres what i did..

Scene1 contains a movie clip with the following action script.

onClipEvent (load) {
_x = 0;
_y = 0;
speed = 45;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}


Since with a movie, you do not have access too the On Mouse Event actionscript available, i go into the movie (edit) delete its contents and insert a new button INSIDE the movie. This results in a button that follows my mouse instead of just a simple movie clip.


The problem i am having is i can not get action scripts to launch from the button. The On Mouse Event wont do anything. All i want the button to do is

on (release) {
gotoAndPlay ("Scene2", 1);
}

But when i click the button nothing happens. I am fairly certain that flash is seeing this moving object as a button because in IE, the cursor changes from an arrow to a poiting finger and i am able to edit the button's up, over, down, and hit frames which respond correctly in the movie.

I am VERY confused by this. All i can think is maybe i can not execute actionscripts from a button within an instance of a movie.


Any suggestions? hope that made sense!


Feel free to download my source at http://www.infernalarts.com/index2.fla

Keith

Button Easing
I'm trying to start doing my own actionscript or at least be able to create what I want from different tutorials and I've worked on this for several hours and I've seem to keep getting the same problem. I need to make 9 different buttons ease to a ceratain _X spot when you hover over them. Pretty much I'm starting out with a MC adding some 'onClipEvent' and then in the MC I'm putting a button with an 'on (rollOver) {' on it. Everytime it converts the MC to a Button or pulls the button to be the over all type.

I know there are ways to make an MC become a button w/o putting a button in it and I think that is what I need to do. While I work on that I was wondering if there is a certain way to go about this. Thanks guys!

Button Easing
Hi,

If I want a button when pressed go to a certain x/y co-ordinate, by not using tween but using actionscript how can i do this?

pixelmisfit

Button Easing Problem
I've been trying to get multiple button to ease or tween like most of the popular sites. Mine seems to be not working correctly. I was wondering some one could look over my FLA (flash 8) and help me out.


Thanks

Button Setting Var, Easing Equations
hello. this what im trying to achieve:
using robpenner’s easing equations i am trying to have
a mc (instance name: gray) move to a specified _x
position on a button release.
//code in my first frame:
// quadratic easing in/out - acceleration until halfway, then deceleration
Math.easeInOutQuad = function (t, b, c, d) {
if (t < d/2) return 2*c*t*t/(d*d) + b;
var ts = t - d/2;
return -2*c*ts*ts/(d*d) + 2*c*ts/d + c/2 + b;
}

//button code:
on (rollOver) {
_root.gray:start = getProperty(_root.gray, _x);
_root.gray.go = "1";
_root.gray.t = "0";
}

on (rollOut) {
_root.gray:start = getProperty(_root.gray, _x);
_root.gray.go = "0";
_root.gray.t = "0";
}

//code on my mc, gray:
onClipEvent (load) {
start = this._x;
end = 450; // where mc will end movement
change = end - start;
duration = 100;
t = 0;
}

onClipEvent (enterFrame) {
if ((t<=duration) and (go == 1)) {
t++;
this._x = Math.easeInOutQuad(t, start, change, duration);
} else if ((t<=duration) and (go == 0)) {
t++;
this._x = Math.easeInOutQuad(t, start, change, duration);
}
}

this works except for when i rollOut, gray starts moving,
but not back to where it started, it keeps moving onward.

ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ ˆˆˆˆˆˆˆˆˆˆˆˆˆˆ
my next attempt was with the release (which is what i really want to use)

//the code on my button:
on (release) {
_root.gray:start = getProperty(_root.gray, _x);
_root.gray.go = "1";
_root.gray.t = "0";
}

// the code on my mc, gray:
onClipEvent (load) {
start = this._x;
end = 450; // where mc will end movement
change = end - start;
duration = 10;
t = 0;
}
onClipEvent (enterFrame) {
if (go == 1) {
t++;
this._x = Math.easeInOutQuad(t, start, change, duration);
}
}

what happens: gray moves to its end position but then
it suddenly returns to where it started and keeps
moving past the start and off the screen.

Any ideas how i can make gray move to my _x using
this button release easing script?
thanks
d

[F8] Adding Easing To Non-button Scroller
Hallo, I'm pretty new to actionscript so please bear with me...

I'm using this non-button scroller code, with all the values changed to make it vertical instead of horizontal. It works perfectly but I want to make the motion smoother so when you mouse over the scroll area it accelerates into the scroll and when you mouse off it decelerates to a stop. Any help appreciated

Button Stops Looping Mc With Easing?
Hi, does anyone know how I can make this:

on (release) {
my_mc.stop();
}

(Where my_mc is a movieclip that has continuous looping movement)
I want the continuous movement to easeOut and stop at its current timeline location when I click a button.
Any help is truly appreciated.

Linking Animation To Button But With Easing
Hello All

I have a little project that I'm working on where I have a navigation system which is controlled by a scroller. So what happens is that if you move it up some elements get larger and if you click on the down arrow those ones get smaller and others get larger... pretty simple stuff and nothing I can't do myself.... what I'd like to do though is have easing so that if you move up elements get larger with easing... therefore starting slower and going faster then slowing down at it gets to it's target...

Any idea how to do this?

Easing Rotation On Button Event
Hi,

I have a button and a MC. I want to achieve the following:

when I click on the button my MC rotate to 180degrees with an easing sin.
when i click again on this button or and other button my MC go back to the
original position with an easing sin.

this is where I am at so far but i cant get the MC to rotate gradually

MovieClip.prototype.rotation = function() {
truc.onRelease = function() {
if (this.bob == true) {
bob._rotation += (180-this._rotation)/9;
}else{
bob._rotation += (180-bob._rotation)/9;
}
}

};
bob.rotation();



also how to back to initial position using the same button?


cheers

Moving An MC With Easing With A Click Of A Button
Hello. I am having some trouble getting my movie clip to move with some easing
I have been following the Sliding Menu tutorial (http://www.kirupa.com/developer/flash8/slidingMenu.htm)

There used to be one which you could enter an x and y value that you wish a movie clip to move to on a button click.

It used to be in the place of that tutorial.

Any idea where this has gone?

Thanks

Howto Make A Button Easing Fx?
howto make a button easing fx.... ?

ex. i hav a movieclip with a scale tweening effect... i hav a button. if i rollover to my button, i want my movieclip to play. if i rollout my button, i want to play my movieclip reverse... while my movieclip is playing reverse and i rollover to my button, i want my movieclip to play even the reverse play is not yet finish... it's like easing. not like when i rollover my button, the movieclip will play at the start.

how can i do that... can anybody help me...? please... asap. thank you...

Easing Menu Drag Button Issue
I have a button inside a MC, and I'm trying to get it so if you pull it out a certain distance, it eases a menu out, but if it's not out far enough it eases back in, the same, but in reverse when trying to close the menu...the code I have seems to work, but it opens when you click it first, without dragging it past the point where it has to be to fully open...hope that's not too confusing the code it this:
code:
_root.dragMenu.dragBut.onPress = function() {
startDrag(this._parent, false, 645, 370, 720, 370);
};
_root.dragMenu.dragBut.onRelease = function() {
trace(this._parent._x);
noBut();//disables the button while in motion
if (_global.opening == 1) {
_global.opening = 0;
} else {
_global.opening = 1;
}
if (this._parent._x>=655 && _global.opening == 1) {//line1
this._parent.easeX(720);
} else {
this._parent.easeX(645);
}
if (this._parent._x<=715 && _global.opening != 1) {
this._parent.easeX(645);
} else {
this._parent.easeX(720);//line2
}
stopDrag();
};


on first click, even if the _x is less than 655, as the line I commented as line1 above suggests, it always jumps to _x 720, as in line2 above.


it drags from 645 to 720 in total..not a lot of room to play with either

if anyone has any ideas, I'd be very appreciative...thanks


Adam

Easing To A Full Pixel When To Told To By A Button
on
_root.MC1
code:
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;

// declare a function for easing, so
// we can turn it off and reuse it

myEase = function()
{
// keep track of distance to target
var dx = endX - _x;
var dy = endY - _y;

// if distance within 1/2 a pixel
if (Math.abs(dx) < .5 && Math.abs(dy) < .5) {
// go all the way
_x = endX;
_y = endY;
// and stop calling this function
onEnterFrame = undefined;
}
else {
// otherwise, do the Zeno thing
_x += dx/speed;
_y += dy/speed;
}
}

}

onClipEvent (mouseDown) {
onEnterFrame = myEase;
}

on a button
code:
on(release){
_root.MC1.endX = 85;
_root.MC1.endY = 120;
}

The mc does not round off to the whole position.....is it becuase the endX and endY are assigned from an outside clip?

if that is the case how do I correct that?

would I need to put a
code:
if(_root.MC1._x>=84 && _root.MC1._x<=86
_root.MC1._x=85


Cause that would suck.

Two Problems - Easing Mask And Nested Button
Hi,
I'm having a problem with easing a mask. The problem, is that it won't ease, until you click and release, and then it eases fine for a while, before going back to rigid non-easing.
Heres my code. (I think it's a problem with my stopDrag command).


Code:
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}
on (rollOver) {
startDrag(dragmask, true);
}
on (release) {
stopDrag();
}


The other difficulty I'm having is quite annoying.
I have a button - I eventually want to build a whole menu, but I was just testing something, so a simple button - And I discovered that it won't recognize the button as being there, because my mask covers it somehow.
Take a look at the file.
It won't even recognize the other button.
I don't think it would be an issue, but the button needs to be masked, as well, otherwise I'd just put it on another layer.

Any help would be great.

Heres the swf, hope that's enough, until I find a place to host fla's.

link

P.s Anyone know where I can host fla's for free - decent file size.
Thanks,
Herald of Woe

Problem Applying Easing From _level2 Button To _level1 MC
Hi,
I'm new in actionscripting and I'm trying to understand basics. Here is what I want to do:

I have MyMC title on a _level1 movie. When the movie loads for the first time, I apply easing to MyMC, so it move with style, and I load a text variable.

------------
import mx.transitions.Tween;
import mx.transitions.easing.*;

new Tween(title, "_x", Regular.easeOut, 1324, 596.3, 1.5, true);

title.title_txt="TITLE"

stop();
------------



What I want to do is move again this title menu with easing and change his text when I click on my button menu placed on a _level2 movie.

------------
on(release)
{
new Tween(_level1.title, "_x", Regular.easeOut, 1324, 596.3, 1.5, true);
_level1.title.title_txt="TITLE2"
}
------------

But... It doesn't work.
Can you help me to understand my mistakes, maybe it's a targetting/path problem ?
Thank you

Actionscript Pro Required: Syntax Help Required For Button To Initiate Easing
Hi guys I was wondering if any of you actionscript daddio’s could give me 2 minutes of your time and help me write the appropriate syntax to make the below example work on a button release rather than on the MC mouse down state that it currently uses.

http://www.fluid.com/experiments/timecode/mx_time.html

If you click on the geek panel drop down menu, you will see that it generates the appropriate code for the on onMouseDown,, however I want to call the easing from a button.

If someone could give me an example of the correct syntax using the “easeInquad” function that would be brilliant.

How To Make "bit-101.com" Easing Script Work With A Button
I'm trying to make bit-101.com's easing script work with a Button to control the x y coordinates of a movie clip.

For example, I want to have four buttons that tell the same movie clip to move into different x y coordinates with the bit-101.com easing technique (or any easing technique.)

Easing Tutorial
http://www.bit-101.com/tutorials/easing.html
Heres the easing Technique Code that is applied onto a movie clip.

onClipEvent(load){
_x=0;
_y=0;
speed=2;
}
onClipEvent(mouseDown){
targetx=_root._xmouse;
targety=_root._ymouse;
}
onClipEvent(enterFrame){
_x+=(targetx-_x)/speed;
_y+=(targety-_y)/speed;
}


I know if I change the "targetx=_root._xmouse;" to "targetx=400;" that it will move the MC into the position I specify, but I need it to be controlled by a specific button.

Frame Based Easing, Into Time Based Easing (in Actionscript)
i have code to move something from placeA-placeB based on time...then i also have a code to move something from placeA-placeB with easing, but its based on frames...can someone supply me with an easing formula based on time?

Easing Out AND Easing In Using Math?
Hello,
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?

Any thoughts? I appreciate any feedback.

Easing
I would like to Ease some symbols/images into my movie - I am not getting the hang of it. They are still appearing "instantly" - I need a more gradual appearance. Help?! thanks
UFO (and Rush) rocks!

Easing In And Out
Simple Question:

I have an object that moves to the right then stops. I want to ease the movement out then ease it in. I can't seem to figure out how to ease the movement on both ends. Setting the ease numbers in motion tweening won't allow for an ease on both ends. I can't believe this isn't possible, so how can I control the ease from the first keyframe and the last?

Thank You,

Bob

Easing....need A Lil Help
Not too sure why this process seems so complicated,but I am having some problems with easing. Lets say I have two keyframes and on one keyframe the easing is set at 0 and the other side of the keyframe its set to -50(slow down), shouldnt the movement of an object set between the keyframes slow down as the frames progress? Nothing seems to happen? Do youhave to have more than two keyframes set up to do this? All i want is a simple smooth slowdown of motion or speedup of motion to make my animations not look so linear. I have also included three keyframes....one set at 0 easing, then 25 easing, and then 50 easing....and still no sign of speeding up....just plain linear movement. Could someone please educate me on how this easing is done??

Easing...please Help
Not too sure why this process seems so complicated,but I am having some problems with easing. Lets say I have two keyframes and on one keyframe the easing is set at 0 and the other side of the keyframe its set to -50(slow down), shouldnt the movement of an object set between the keyframes slow down as the frames progress? Nothing seems to happen? Do youhave to have more than two keyframes set up to do this? All i want is a simple smooth slowdown of motion or speedup of motion to make my animations not look so linear. I have also included three keyframes....one set at 0 easing, then 25 easing, and then 50 easing....and still no sign of speeding up....just plain linear movement. Could someone please educate me on how this easing is done??

Easing
CAN SOMEONE HELP OUT. HOW DO YOU PUT SIMPLE EASING TO A MC?

Easing?
Hi,

Can anyone recommend a good tutorial on easing? I want my transitions to have a more natural look. Any suggestions?

Cheers,
Jen

AS Easing Help
I have about 15 movie clips in a movie that i want to scale with ease. Ive tried doing this a number of different ways. all of which have woked but they severely slow down the perfomance of my site.

ideally i would like to use penners equations

I want to have a function on the first frame of the main timeline

i.e


PHP Code:



#include "easing_equations.as"
/////////////////////////////////////

function doScale() {
    callback_txt.text = "";
    //
    var w = parseFloat(destw_txt.text);
    var h = parseFloat(desth_txt.text);
    var dur = parseFloat(dur_txt.text);

    square_mc.scaleClip("easeInOutCubic", w, h, dur);
    //callback event invoked when tweening is done
    square_mc.onScaleDone = function() {
        delete this.onEnterFrame;
    //    callback_txt.text = "callback - scaling done";
    };
}




then call the function like this:

PHP Code:



square_mc.scaleClip("easeOutCubic", 300, 150, 30);




but i want to have it delete this.onEnterframe
when the scale is complete.

can anybody help set up this function properly so it doesnt bog down the processor?

MC Easing
ok this shouldnt be too hard i hope i want to move a movie clip to a certain spot on a button release comand like this

code:
on (release){
_root.MC._x = 67;
}


but i dont just want the movie clip to appear there i want it to "ease" there how can i get it to do this?

Easing Help Please
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (mouseDown) {
endX = 85;
endY = 120;
}
onClipEvent (enterFrame) {
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}

two questions.....

1) Technically this MC will never stop, it will look like it does does doesnt actually, so a if MC1 == (_x = 85,_y = 120) will actually work?

2) How can I make it so when it is DAMN close to just round up to the exact position.
would MC._x = Math.round(MC._x); and MC._y = Math.round(MC._y)

work and if so HOW to amke it all come together...easing is killing me !

AS For Easing In/ Out?
Can anyone provide me with a way to ease in or out a MC with actionscript with a random value?

Help With Easing
Yes, I am a newbie!

I have used some script from a tut. and can't get the starting position of my movieclip to work. Could someone help me out? I wan't the movieclip to start at the y=300 location, but it continually goes to the x=0,y=0 location. Could someone explain what I am doing wrong.

Thanks in advance,

THS 2000


3mg zipped fla file.


onClipEvent (load) {
_x = 0;
_y = 300;
div = 5; //This value just determines the speed
//the transistions.
}
onClipEvent (enterFrame) {
_x += (endX-_x)/div;
_y += (endY-_y)/div;


_root.home.onRelease = function() {
endX = 200;
endY = 100;
};
_root.project.onRelease = function() {
endY = 300;
};
_root.plans.onRelease = function() {
endX = 700;
endY = 300;
};
_root.location.onRelease = function() {
endX = 500;
endY = 300;
};
_root.gallery.onRelease = function() {
endX = 650;
endY = 300;
};
_root.sales.onRelease = function() {
endX = 400;
endY = 300;
};
_root.retail.onRelease = function() {
endX = 200;
endY = 300;
};
}

What Exactly Is Easing
Easeing in vs out?

I Think I Have Easing Down
well i sat there messing with a str8 line & A SQUARE and doing the shape tweening for about a good 20 minutes, and increasing an decreasing the speed of the EASE i got it go pretty smooth. which im happy about, but the thing i want to bounce up & down is going to be a ball w/ a char attacked to it, its like a ball hits a stick figure & it goes boucning around with him, ive found if i draw ANY FORGEIN OBJECT onto the alrdy made ball (simply by making ball witht he fill in color alrdy in it) and i animate it using shape tweening or motion tweening, it does its job but as it does it the color becomes all distorted, the color twists in an out along w/ the drawing, literally it twists around, which looks cool but is not the thing i want, so my Q is, how do i draw a pic (like a man) & make him boucne up an down smoothly?

like take this for instance, am able to make a ball move like this bird, very good i must say but the bird isn't just a ball, its obviously DRAWN UP, mainly the head, but when i draw ahead and try to move it it becomes all disoritented & twists around, any ideaS?

here is the link

http://www.newgrounds.com/portal/view/158417

& if that 1 don't work try

click here

im talkin about that little yellow bird at the beginnin.

thanx in advance.

Easing
It would be so cool if someone could help me out on this one...I have buttons (item1, item2 etc.) that are referred to in the action script for my MC to make pictures scroll up and down. But I have a next and previous buttons...that I'm not sure how to write the script for.

It's such a cool thing and yet...my ability to write script is sooo limited.

www.bluejaygraphics.com/pages/fotom.htm

The script for the MC is:

onClipEvent (load) {
_x = 0;
_y = 0;
velocity = 4;
}


onClipEvent (enterFrame) {

_x += (endX - _x) / velocity;
_y += (endY - _y) / velocity;

_root.item1.onRelease = function() {
endX = 0;
endY = 0;
};

_root.item2.onRelease = function() {
endX = 0;
endY = -465;
};

_root.item3.onRelease = function() {
endX = 0;
endY = -947;
};

_root.item4.onRelease = function() {
endX = 0;
endY = -1418;
};

_root.item5.onRelease = function() {
endX = 0;
endY = -1895;
};

_root.item6.onRelease = function() {
endX = 0;
endY = -2210;
};

_root.item8.onRelease = function() {
endX = 0;
endY = -2210;
};

}

Does anyone have an idea?
thanks

Easing
Hi.
Follwing AS is jbum protoype function which I changed a litle bit.
I am not an expert so forgive me any mistakes.
This prototype function move mc to X,Y, scale scaleX, scaleY, change width and height, rotate by angle. Movement is made with two kind of easing. If I put inside my MC in
frame1

Code:
stop();
//move to x,y 360,300 and scale to 20 _xscale = 20
this.startTween(360,300,n,20,n,n,n,n);

frame2

Code:
stop();
//then move to x,y 40,300 and rotate by 20 _rotation = 20
this.startTween(40,300,n,n,n,n,20,n);

etc
I can achieve complex move with various efect. (where n is "dont change")

If some of you can adopt Robert Penner http://www.robertpenner.com/easing/easing_equations.as functions in order to choose diffrent easing that would be great.


Code:

MovieClip.prototype.doTween = function() {
// get elapsed time in milliseconds
var elapsedTime = getTimer()-this.startTime;
// convert to easing ratio 0-1
var k = elapsedTime/this.duration;
trace(k)
if (k>1) {
// are we done yet?
k = 1;
this.onEnterFrame = undefined;
//play next frame and aplly new parameters
this.nextFrame()
}
// apply easing
//k = k*k*(3-2*k); // easeing-out easing-in
k = 1-Math.pow(1-k, 2); //easing-out
// apply easing
// perform the tween


if(this.startX){
this._x = this.startX+(this.deltaX*k);
}
if(this.startY){
this._y = this.startY+(this.deltaY*k);
}
if(this.startXscale){
this._xscale = -this.startXscale+(this.deltaSx*k);
}
if(this.startYscale){
this._yscale = -this.startYscale+(this.deltaSy*k);
}
if(this.startWidth){
this._width = this.startWidth+(this.deltaW*k);
}
if(this.startHeight){
this._height = this.startHeight+(this.deltaH*k);
}
if(this.startAngle){
this._rotation = this.startAngle+(this.deltaR*k);

}
};
MovieClip.prototype.startTween = function(newX,newY,newXscale,newYscale,newWidth,newHeight,newRotation, seconds) {
//default seconds
if(!seconds) seconds=1.1

// get start time, in milliseconds
this.startTime = getTimer();
// compute duration in milliseconds
this.duration = seconds*300;
// get start and end values


if(int(newX)) {
this.startX = this._x;
this.targetX = newX;
this.deltaX = this.targetX-this.startX;
} else {
this.startX = this._x;
this.deltaX = 0
}
if(int(newY)) {
this.startY = this._y;
this.targetY = newY;
this.deltaY = this.targetY-this.startY;
} else {
this.startY = this._y;
this.deltaY=0
}
if(int(newXscale)) {
this.startXscale = this._xscale;
this.targetXscale = newXscale;
this.deltaSx = this.targetXscale-this.startX;
} else {
this.startXscale = this._xscale;
this.deltaSx=0
}
if(int(newYscale)) {
this.startYscale = this._yscale;
this.targetYscale = newYscale;
this.deltaSy = this.targetYscale-this.startY;
} else {
this.startYscale = this._yscale;
this.deltaSy=0
}
if(int(newWidth)) {
this.startWidth = this._width;
this.targetWidth = newWidth;
this.deltaW = this.targetWidth-this.startWidth;
} else {
this.startWidth = this._width;
this.deltaW=0
}
if(int(newHeight)) {
this.startHeight = this._height;
this.targetHeight = newHeight;
this.deltaH = this.targetHeight-this.startHeight;
} else {
this.startHeight = this._height;
this.deltaH=0
}

if(int(newRotation)) {
this.startAngle = newRotation;
this.deltaR = this.targetAngle-this.startAngle;
} else {
this.startAngle = this._rotation
this.deltaR=0
}

// compute the difference (the 'delta')
// begin tweening
this.onEnterFrame = this.doTween;

};

Easing At 100 Going In And Out... Possible?
ok i bet you dont know what i mean.. so.. ill explain it in detail.. or try atleast..

i want to make a tween motion ease at 100 points.. but i want it to start off easing at -100 points aswell.. so in the middle of the tween is the climax (the fastest part of the tween) of the motion.. is this possible? if so how! this would really help!

thanks so much

Easing In And Out
Hi, hoping someone can help.

Tried to access the tutorials link but it was not working.

My actionscripting is basic but I understand the below code. I was wondering with this how would be able to ease in and out (to different degrees, like when tweening), whether that be with size or alpha.


onClipEvent (load) {
this._xscale = 10;
this._yscale = 10;
this._alpha = 20;
}
onClipEvent (enterFrame) {
if (this._xscale<140) {
this._xscale += 10;
}
if (this. _yscale<140) {
this._yscale += 10;
}
if (this. _alpha<100) {
this._alpha += 10;
}

}


Thanks

Easing
i saw an easing script on a scroller. i have the easing script but i'm not sure as to where to put it for it to take effect.

i saw it here:

http://www.flashloaded.com/ultimate.php

any ideas?

Easing
I know how to ease and I know how to move an object by increments, but I can't combine the two.

If you open the attachment you'll realize the forward and back button should move the images 160 pixels respectively. How can I make than an easing motion while maintaining the 160 pixel move, rather than a fixed desitination.

Thanks!

A Bug In My Easing
I use the tween easing transitions classes to bring a mc on stage.
The move gets done by rollOver and rollOut.
The move is huggly and uncertain...why is this. What do I do wrong ?
I put a small example in the attachement.

Help With Easing
Can anyone tell me how I can ease an object in/out with actionscript on an object that actually uses a tween animation on the timeline? I know I can set the easing in the properties but I don't want to do it that way. Basically I have a scale that measures the percentage of donations given. The scale moves to the right or left and at a slight angle upward/downward based off of the percentage calculated. It compares the current frame to the percentage and uses the nextframe/prevframe functions to move back/forward. There are 100 frames in the animation (1 frame per percent). I don't like the quick stop once it gets to the frame that equals the percent and would like it to ease in. I just don't know if I can do this with my current set up.

Thanks in advance

Below is the AS:


PHP Code:



/** set up xml object **/
var my_xml = new XML();
my_xml.load("http://localhost:2730/CampaignTicker/getDataService.asmx/getCampaignData");
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success){
    if (success){
        //trace(this);
        var rootNode = this.firstChild.childNodes;
        var goal = rootNode[1].childNodes.toString();
        var donations = rootNode[0].childNodes.toString();
        _global.org_donations = donations;
        init(goal, donations);
    }else{
        trace("error loading xml");
        testText.text = "error loading xml";
    }
}
/** load intitial data **/
function init(goal, donations){
    
    //trace("goal: " + goal);
    //trace("donations: " + donations);

    if(donations == ""){
        var percentage = 0;
    }else{
        var percentage = Math.floor(donations/goal*100);
    }
    //trace("percentage: " + percentage);
    if(percentage > 100){
        percentage = 100;    
    }else{
        percentage = percentage;    
    }

    _root.onEnterFrame = function(){
        
        _root.goal_amount.Text = Math.currencyFormat(goal);
        
        if(_root._currentframe <= percentage){
            _root.nextFrame();
            _root.magnifyingGlass.percentDisplay.Text = (_root._currentframe - 1 + "%");
            //trace("Current frame: " +_root._currentframe);
            if(_root._currentframe == percentage || percentage == 1){
                _root.raisedToDate.Text = "Raised to date:";
                _root.totalRaised.Text = Math.currencyFormat(donations);
            }
            
        }else{
            if(percentage == 0){
                _root.magnifyingGlass.percentDisplay.Text = ("0%");
                _root.raisedToDate.Text = "Raised to date:";
                _root.totalRaised.Text= Math.currencyFormat(donations);
            }
            delete this.onEnterFrame;
        }
    }
}

/** intialize reload interval **/
setInterval(reload, 5000, _global.donations);

/** test for changed data **/
function reload(org_donations){
    
    var my_xml = new XML();
    my_xml.load("http://localhost:2730/CampaignTicker/getDataService.asmx/getCampaignData");
    my_xml.ignoreWhite = true;
    my_xml.onLoad = function(success){
        if (success){
            //trace(this);
            var rootNode = this.firstChild.childNodes;
            var goal = rootNode[1].childNodes.toString();
            var new_donations = rootNode[0].childNodes.toString();
            if(_global.org_donations != new_donations && new_donations != ""){
                reloadDonations(goal, new_donations);
            }else if(new_donations == ""){
                reloadDonations(goal, 0);
            }
        }else{
            trace("error loading xml");
            testText.text = "error loading xml";
        }
    }
}

/** if data has change, reload it **/
function reloadDonations(goal, new_donations){
    //trace("reloaded");
    
    if(new_donations == ""){
        var new_percentage = 0;
    }else{
        var new_percentage = Math.floor(new_donations/goal*100);
    }
    
    if(new_percentage > 100){
        new_percentage = 100;    
    }else{
        new_percentage = new_percentage;    
    }
    
    //trace("percentage: " + new_percentage);
    //trace("new donations: " + new_donations);
    //trace("goal: " + goal);
    
    
    _root.onEnterFrame = function(){
        
        if((_root._currentframe <= new_percentage)  && (new_donations > _global.org_donations)){
            _root.nextFrame();
            _root.magnifyingGlass.percentDisplay.Text = (_root._currentframe - 1 + "%");
            //trace("Current frame: " +_root._currentframe);
            if(_root._currentframe == new_percentage || new_percentage == 1){
                _root.raisedToDate.Text = "Raised to date:";
                _root.totalRaised.Text = Math.currencyFormat(new_donations);
            }
        }else if((_root._currentframe >= new_percentage) && (new_donations < _global.org_donations)){
            _root.prevFrame();
            _root.magnifyingGlass.percentDisplay.Text = (_root._currentframe + 1 + "%");
            if(_root._currentframe == new_percentage || new_percentage == 1){
                _root.raisedToDate.Text = "Raised to date:";
                _root.totalRaised.Text = Math.currencyFormat(new_donations);
            }
        }else{
            /*if(new_percentage == 0){
                _root.magnifyingGlass.percentDisplay.Text = ("0%");
                _root.raisedToDate.Text = "Raised to date:";
                _root.totalRaised.Text= Math.currencyFormat(_global.new_donations);
            }*/
            delete this.onEnterFrame;
            _global.org_donations = new_donations;
        }
    }
}

Easing Q?
I have an image scroller it has taken me an age to get near finished.
it calls pics from xml, then scrolls them using a scroll bar.

I would like to add some easing to soften the movement a bit, but i cant make it happen at all!
Can anyone offer any pointers?

Also the scroll is a bit sketchy at one end and i don't see why!

Any help would be most welcome.
thank you for all the tutorials to date

Easing
I have tried to ease my moving objects but i cant really see the difference if i use out 100 at the begining of the tween and -100 at the end of the same tween. i tryed the other way but it seems for me that it is always working the same way. How is easing really working and how does in and out relate to the moving object?

Thanks

Easing Pan
Hi Everyone,

I have searched on the forums but maybe I am searching for the wrong thing?

I am looking for the technique that is used on www.leejeans.com.au

I guess it is an easing pan...

Any ideas would be greatly appreciated!

Help With Easing
Having a hard time explaining what it is I am trying to do.

I want to ease only part of an object, a semi-circle to be specific.

The flat edge has to move depending on the mouse position but I want the peak of the curved edge to remain stationary. Now Easing I have down pat.. Worked out a small segment of actionscript that I can just paste into any object and have it ease itself within a range.

Im not sure how I owuld go about just easing part of an object tho, or if it is even possible.

All help appreciated.

Easing
I'm pretty new at this, so I apologize if this question is stupid. This is with regards to lostinbeta's easing tutorial:
I'm wondering if it possible to make the ball leave a trail behind it when it moves toward the mouse. Or is it possible to simply cause the ball to ease across the screen and leave a trail. Any links to tuts that could teach me this?

Thanks

Easing A Box
I suck at actionscript, and I tried to figure this out my self but theres got to be an easier way. I just want a simple box to move from bottom to the top using easing. Can anyone try and keep this simple for me?
thank you in advance

Help W/ EASING
HEY guys,

thanks for checkin out my post! i need help with easing...how do i re-create this or if u would point me into a GREAT detailed tutorial..

http://www.jerzees.com/jz_2005/index_flash.html

should i make the glass buttons in flash also? i want my buttons to ease like that..

newbie here..

plz help.

Easing Help
HEY,

im making a site with the easing feature with the tutorial off of actionscript.org here: http://www.actionscript.org/tutorial...em/index.shtml

however, this tutorial doesnt explain really how to make a project from scratch good enough, only adding actionscipt to it and the source file.

is there any one who can help me or find me a better tutorial?

Copyright © 2005-08 www.BigResource.com, All rights reserved