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




Bounce.easeOut



Has anyone worked before with Bounce.easeOut? I am trying to create a simulation of a rock skipping across water. It will be dynamically created as the user will input the strength, height, friction, etc. into the simulation so that the rock will skip respectively with the input. The physics part I have no problem working out, and I am fairly decent with AS 2.0, however I have never used Bounce.easeOut before. Here is the code I have now:
Code:
import mx.transitions.Tween;import mx.transitions.easing.*;skipTime = 0;skipStrength = 0;this.throw_btn.onRelease = function(){ _root.skipStrength = (_root.skipStrength_txt.text / 100) * 700; _root.skipTime = (1 / _root.skipStrength_txt.text) * 100; new Tween(_root.ball_mc, "_y", Bounce.easeOut, _root.ball_mc._y,500, _root.skipTime, true); new Tween(_root.ball_mc, "_x", None.easeNone, _root.ball_mc._x, _root.skipStrength, _root.skipTime, true);}
Obviously I haven't accounted for all physics properties yet. This was more of a test. Currently I am entering a value from 1 - 100 to have the magnitude of how far the rock skips(bounces) across the stage. Currently it's physically innaccurate so obviously the lesser the strength the time is exaggerated, but I don't really care about that right now. What I want to know is if there is some way to control the number of bounces. No matter what value I put in, whether it be 10, 50 or 100 it always bounces 3 times then comes to a rest at the appropriate location on the stage. How do I change it so that there are more/less bounces? Is Bounce.easeOut even the correct transition I should be using? I'm not entirely sure about that. Any ideas?



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 11-24-2008, 11:52 AM


View Complete Forum Thread with Replies

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

Easeout Problem
Im currently developing a map got this easeout problem that should recognise the instance name of the building that is clicked from the xml menu and it should slide to that spot .
any im currently trying to fix it but i need to be fast.could a nyone give me any ideas.

[F8] How To Incorporate A EaseOut Tween Into This
I'm working on a slider menu and I have that working just fine. However now I want to figure out how to have it so that when I rollOut of the menu it doesn't just stop, but does an easeOut effect so it slows and stops. I've never used the tween class before and I'm not sure exactly how to incorporate it into my existing script. I've given it several tries but to not avail, I just get some crazy results. Can anyone take a look and help me out?

I've attached a very simplified version of what I have so far because the original was too big. Thanks for your time and any help you can give.

Cheers.

Modifying Elastic.easeOut
I want to modify the current Elastic.easeOut function to be less bouncy. This is the code:
Code:
/**
* The <code>easeOut()</code> method starts motion fast
* and then decelerates motion as it executes.
*
* @param t Specifies the current time, between 0 and duration inclusive.
*
* @param b Specifies the initial value of the animation property.
*
* @param c Specifies the total change in the animation property.
*
* @param d Specifies the duration of the motion.
*
* @param a Specifies the amplitude of the sine wave.
*
* @param p Specifies the period of the sine wave.
*
* @return The value of the interpolated property at the specified time.
* @playerversion Flash 9.0.28.0
* @langversion 3.0
* @keyword Ease, Copy Motion as ActionScript
* @see fl.motion.FunctionEase
*/
public static function easeOut(t:Number, b:Number,
c:Number, d:Number,
a:Number = 0, p:Number = 0):Number
{
if (t == 0)
return b;

if ((t /= d) == 1)
return b + c;

if (!p)
p = d * 0.3;

var s:Number;
if (!a || a < Math.abs(c))
{
a = c;
s = p / 4;
}
else
{
s = p / (2 * Math.PI) * Math.asin(c / a);
}

return a * Math.pow(2, -10 * t) *
Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
}
I just don't know what I would have to do to modify this..

Regular.easeOut Issue
I'm using MX2004.

This is basically what I want to happen: When a button is clicked, a movieclip starts playing. When that movie clip hits a certain frame, I want another specified movieclip (_root.viewer_mc.slides_mc) to move left by 170px. I'm using the following code:

_root.viewer_mc.slides_mc = new mx.transitions.Tween(_root.viewer_mc.slides_mc, "_x", mx.transitions.easing.Regular.easeOut, (_root.viewer_mc.slides_mc._x), (_root.viewer_mc.slides_mc._x-170), .75, true);

This works fine ONCE but if you click the button again, nothing happens. I think maybe flash isn't updating the value of _root.viewer_mc.slides_mc._x or something. Any idea how I could get this working? It driving me crazy!

Back.easeOut Problem
I have this code to move my mc:

PHP Code:



var myTween1:Tween = new Tween(mc1, "y", Back.easeOut, 420, 0, GetRandomRange(13,18), true); 




the movie plays fine and then after about EVERY 1 min everything just stops and stays that way forever. anyone have any idea why? or did it happen to anyone else before...

tnx for any input

Drop, Bounce, Collide, Bounce?
Hi!
I'm trying to figure out how to get 2 (or more) movie clips to bounce off each other and it's a bit frustrating since I'm just learning HitTest etc.

What I have:

- I have 2 movie clips, a circle and a square.
- each movie clip has actionscript for the "falling" gravity to work.
- each movie clip has a button in it with actionscript for the dragging and releasing etc.
- When the movie loads, the circle and square drop from the top of the stage and bounce (using gravity etc).
- You can drag and "toss" each object and it will bounce off the sides and bottom of the stage.

What I'm trying to do:

1) I'd like the circle and square to bounce off each other when they collide just like they bounce off the sides of the stage (right now they bounce behind or in front of eachother based on their layer depths).
2) Also, but less important, I'd like them to bounce off the top of the stage too instead of flying up and out.

Questions:

- How do I make this work? I've seen many examples using HitTest etc on instances of one movieclip, but my movie clips need to be different since they will be turned into separate objects/graphics later (if that makes sense). Is this still a HitTest solution? I don't think so since I'm not really using HitTest to begin with? I've tried incorporating code from some of those examples, but it just doesn't work.

I've attached 2 files - one in Flash 8 format, and another in Flash mx2004 format so hopefully someone can open one of them, take a look at the code and give me some help.

I appreciate it

Peace,

Hondo311

Easeout Using Mx Tween Class Method
hi,
i have text at runtime and i want to scroll it with a easeout effect using mx tween class.
the below link shows exactly what im looking for...the tut does have a fla example but method is not what im after.

http://www.actionscript.org/showMovie.php?id=571

i want to achieve the same using a class method.
can some one guide me where and how to code and include the class code ?

just trying my hand at class methods

this is the code i have for the text at runtime(that's what its called ? )

code:
this.createTextField("mytext", this.getNextHighestDepth(), 200, 10, 300, 100);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.selectable = false;
mytext.text = "Lorem ipsum dolor sit amet, consectetur adipscing elit, sed diam nonnumy eiusmod tempor incidunt ut labore et dolore magna aliquam erat volupat.Et harumd dereud facilis est er expedit distinct. Nam liber a tempor cum soluta nobis eligend optio comque nihil quod a impedit anim id quod maxim placeat.";
var mystyle:TextFormat = new TextFormat();
mystyle.font= "georgia";
mystyle.size = 12;
mystyle.color = 0x990000
mytext.setTextFormat(mystyle);


regards,
Arie

[MX04] Regular.easeOut Issue - Please Help
This is basically what I want to happen: When a button is clicked, a movieclip starts playing. When that movie clip hits a certain frame, I want another specified movieclip (_root.viewer_mc.slides_mc) to move left by 170px. I'm using the following code:

_root.viewer_mc.slides_mc = new mx.transitions.Tween(_root.viewer_mc.slides_mc, "_x", mx.transitions.easing.Regular.easeOut, (_root.viewer_mc.slides_mc._x), (_root.viewer_mc.slides_mc._x-170), .75, true);

This works fine ONCE but if you click the button again, nothing happens. I think maybe flash isn't updating the value of _root.viewer_mc.slides_mc._x or something. Any idea how I could get this working? It driving me crazy!

Would Someone Mx.transitions.easing.Strong.easeOut Explain For Me?
what is this mysterious line?

im done with mouserecord (talking about my physical fitness)

mx.transitions.easing.Strong.easeOut make me into nebula, here is a screenshot from what part i mean (didn't see it working yet)



and the hole program, thanks

Transitions.easing.Elastic.easeOut Problem
I upgraded to Flash 8 and now this doesn't work. Am I missing something?

Thanks,
Zach


Code:
onClipEvent (load) {
//
easeType = mx.transitions.easing.Elastic.easeOut;
startX = 2;
startY = 36;
endX = 2;
endY = 45;
speed = 1.5;
//
mcTween = new mx.transitions.Tween(this, "_x", easeType, startX, endX, speed, true);
mcTween = new mx.transitions.Tween(this, "_y", easeType, startY, endY, speed, true);
}

Error #1069: Property EaseOut Not Found On Gs.
Hello all,

I am using the TweenLite engine (Quart)...

I am receiving the following Reference Error:

ReferenceError: Error #1069: Property easeOut not found on gs.TweenLite and there is no default value.
at gs::TweenLite()
at gs::TweenLite$/to()
at main_fla::MainTimeline/initSite()
at main_fla::MainTimeline/frame1()

I have used the following import statement in TweenLite.as :

import gs.easing.Quart;
import gs.easing.Quart.easeOut;

and beginning at line 356 of TweenLite.as the following:

public static function easeOut(param1:Number, param2:Number, param3:Number, param4:Number) : Number
{
var _loc_5:* = param1 / param4;
param1 = param1 / param4;
return (-param3) * _loc_5 * (param1 - 2) + param2;
}// end function


I have used the following import statement in MainTimeline.as :

import gs.easing.Quart;
import gs.easing.Quart.easeOut;


I can't seem to figure out what I am doing wrong...

Movie Bounce In Bounce Out
Hi

I want to make a menu that bounces in on key press (for ipaq ppc)and when pressed again with the stylus bounces back out. I am using Flash MX but can not get this to work. Any ideas gretefully received.

Thanks

Bounce, Collide, Bounce Again?
Hi!

Flash 8 Actionscript question:

I'm trying to figure out how to get 2 (or more) movie clips to bounce off each other and it's a bit frustrating since I'm just learning HitTest etc.

What I have:

- I have 2 movie clips, a circle and a square.
- each movie clip has actionscript for the "falling" gravity to work.
- each movie clip has a button in it with actionscript for the dragging and releasing etc.
- When the movie loads, the circle and square drop from the top of the stage and bounce (using gravity etc).
- You can drag and "throw each" object and it will bounce off the sides and bottom of the stage.

What I'm trying to do:

1) I'd like the circle and square to bounce off each other when they collide just like they bounce off the sides of the stage (right now they bounce behind or in front of eachother based on their layer depths).
2) Also, but less important, I'd like them to bounce off the top of the stage too instead of flying up and out.

Questions:

- How do I make this work? I've seen many examples using HitTest etc on instances of one movieclip, but my movie clips need to be different since they will be turned into separate objects/graphics later (if that makes sense). Is this still a HitTest solution? I don't think so since I'm not really using HitTest to begin with? I've tried incorporating code from some of those examples, but it just doesn't work.

I've attached 2 files - one in Flash 8 format, and another in Flash mx2004 format so hopefully someone can open one of them, take a look at the code and give me some help.

I appreciate it

Peace,

Hondo311

Bounce Down...?
I want to have an object drop down to like 200px from the top, not hit anything, but then realistically bounce up and down slower and slower, like you know... it doesn't just come down and thats it. Kind of hard to explain, but I hope you get it and can help! Thanks!

Bounce, C'mon Bounce
Hiya,

Pretty new to all this, but can somebody point me in the direction of anywhere that'll explain how to get objects of different dimensions to float around in a square/circle bouncing of each other and the walls. The bouncing bits need to be buttons, incidentally.

Thank you!

Bounce
Flash MX

ok, I want to do the simple task of, when an object moves, whenever it hits any other object, it bounces at the angle opposite frome whence it came. I also want to make the object move to begin with.

so, if there is a circle in the frame, and it hits the side at a 30 degree angle, it goes off at a thirty degree angle. Physics.

Bounce
cant get ball to bounce off of a wall on both side

its a short little wall in the center of my screen and i want the ball to bounce off of it on the left and the right side.

Bounce
how can you make an object bounce against a wall?

Get A Little Bounce (MX)
Hi all,

I'm rather new to all this and have what will hopefully be a straight forward question.

I want to animate an object, with actionscript, falling from the top of the screen to land with a bounce. No interactivty nothing.

Can any one point me in the right direction?

Thanks

Bounce
how do i make a symbol bounce around the document at a slow speed useing code, so i dont have to animate the whole thing

Bounce
I really need help but I can't explain myself very well, so I will just send you to the swf file and maybe you can help me. here is the link: http://www.newgrounds.com/portal/view/174139 The problem is when you run into the planet, I want the ship to bounce off rather than stick in it like it is mud. I am simply implementing the use of two movement vars. (xv and yv) so currently, I just set them to zero. I have tried stuff like xv = -xv and I even tried the long way 'round if xv > 0 .....
If you have any suggestions please post them
thanks!

BOunce Bounce
Hi,

i am using MX 2000 & am looking for a script to create something like the bounce effect on the menu in this URL: www.hoitytoity.co.za

thx,
A.

Bounce
Hello again, I had been making a simple game to practice my actionscripting,
It's a ball that moves with the direction keys,
What I did was make 4 separate Mc's as walls; top bottom left and right,
I was able to make the ball bounce from these Mc's by using hitTest and x / yspeed - x / yspeed*2,
that worked by making the ball "bounce" in the opposite direction at the same speed as when it hit,

I've now changed the walls into one wall, I've changed the code to x / y *= -1,
That inverts the direction BUT...
When it hits it goes literally opposite direction so x and y is inverted not creating the "bounce" effect.
Is there another way that this could be achieved?
Thank you in advance!







Attach Code

onClipEvent(load) {
speed = 3;
friction = 0.96;
yspeed = 0;
xspeed = 0;
}
onClipEvent(enterFrame) {
//calculationssss
_y += yspeed;
_x += xspeed;
yspeed *= friction;
xspeed *= friction;
_rotation += xspeed;
//movement
if(Key.isDown(Key.DOWN)){
yspeed += speed;
}
if(Key.isDown(Key.UP)){
yspeed -= speed;
}
if(Key.isDown(Key.RIGHT)){
xspeed += speed;
}
if(Key.isDown(Key.LEFT)){
xspeed -= speed;
}
if(_root.wall.hitTest(_x,_y, true)) {
yspeed *= -1;
xspeed *= -1;
}
}

Help Me With The Bounce
sorry for my english.
how I can make to bounce this like if it were hanging?

example

Help With Slide And Bounce
I'm trying to make some text slide onto the screen and then bounce naturally when it hits its required position.
I would also like to fade it it as it slide.

I'm sure all this can be done with actionscript but all I get so far is the slide movement.

Drag And Bounce
i saw a cool effect at the misssixty.com site. there is an image that you can drag upwards, then you let go and the image falls down and bounces up again. the jumps get smaller and smaller like they would in the real world. any ideas on how to do this. or any tutorials would be great.

Drag And Bounce
i saw a really cool effect at http://www.missixty.com

there is a heart that you can drag up on the screen. when you let go, it realistically bounces up and down.

any ideas on how to copy this?

MC Bounce Around Screen
Im making a screen saver and I want MC to bounce around the screen. I search the movies and tutorials but the only one I found that was what I wanted did work for me.

Anyone know how to make MC bounce around the screen? There are 6 MC's. I need this ASAP.

How Do I Get An Elastic Bounce?
This might be a silly question: but, how do I get an elastic bounce?

I've seen it on many sites: you click on something, say for example, the object will bounce to and forth and come to rest. This all happening in half a second.

I could attempt to achieve a bounce with some tweening.
But, all the examples I've seen, seem to have a 'natural' elastic bounce. It's something that I can't create with a simple teen.

Does ANYONE know what I'm taking about?

Any help/pointers would be really appreciated.

Thanks.


Jam

Mc Scaling With Bounce Help Me
i want that mc scaling with bounce. it's start 50 px by 50 px and i would like to scale to 100 px by 100 with bounce!!!

The Bounce Of The Ball
Ok, it's me again. Hope no one minds me asking all these questions. I know how to make the ball move on a motion guide. But, I don't know how to make it look like a real ball. I fill it with a radial granet to simulate shadow. But as it moves the shadow should follow the light, and I don't know how to do that. Also, when it hits the ground it should smush a little before it bounces back up right? How do I make it smush and then unsmush? Please help.

Bounce In Boxes
How do you make bounce in Boxes? I've seen them used on TONS of web sites and they look neat

Incase you're wondering wtf I'm talking about, its like the box comes in, expands then shrinks to a normal rectangle like. I'll try to find an example

Adding 'bounce'
Right i have a movieclip (a plain square called 'box') a button (called button), and a script which enlarges the movie smoothly. But I want to add a 'bounce' effect so that when the move reaches its destination size it streches out a bit (gets bigger) then springs back to destination size. Kinda an elastic effect.

Here is the code:

Button code:


Code:
on (press) {
_root.box.change = true;
_root.box.goaly = 300;
_root.box.change = true;
_root.box.goalx = 500;
}
Movie code:


Code:
onClipEvent (enterFrame) {
if (change == true) {
_xscale += (goalx-_xscale)/3;
_yscale += (goaly-_yscale)/3;
}
}
If anyone can help it would be most appreciated

Bounce When Click
Hello.
I am trying to animate an MC instance named myName, Specifically, I am trying to make it bounce on a y point. I can't figure out why it is not working. Here is my code:

-- first frame action

g = 150;
elastic = .7;
BallRadius = getProperty("myName", _height)/2;
nameBounce = false;


-- button action

on (release) {
nameBounce = true;
}


-- MC action

onClipEvent (load) {
if (nameBounce) {
y = getProperty("_root.myName", _y);
vert = Number(vert)+Number((g/10));
y = Number(y)+Number((vert/10));
if (Number(y)>Number((200-BallRadius))) {
y = 200-BallRadius;
vx = (vx*elastic);
vert = -(vert*elastic);
}
setProperty("_root.myName", _y, y);
if (_root.myName_y==200) {
nameBounce = false;
}
}
}

Is the error in the logic or the syntax?
Thanks for any help you offer.
1M.

. . .add Elastic Bounce
Hello,
I'm trying to add an elastic feel to a MC that
grows when the Hit Test is activated, and shrinks back to it's original size when hit test is false. I'm using this code below which works perfectly, but I can't figure out how to add a bouncy elastic feel to it when it grows and shrinks back.

// control position of object
onClipEvent (load) {
ease = 5;
xmove = _x;
}
onClipEvent (enterFrame) {
_x += (xmove-_x)/ease;
}
// control scale of object
onClipEvent (load) {
scaleease = 5;
xscale = _xscale;
yscale = _yscale;
}
onClipEvent (enterFrame) {
_yscale += (yscale-_yscale)/scaleease;
_xscale += (xscale-_xscale)/scaleease;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.nav01.xscale = 1200;
_root.nav01.yscale = 7000;
} else {
_root.nav01.xscale = 100;
_root.nav01.yscale = 100;
}
}

How Do I Get An Elastic Bounce?
How do I get an elastic bounce at the end of an object coming onto screen?

I've learnt how to move an object using actionscript so that it eases in... but I've seen in many other websites where objects have a little bounce at the end before coming to a rest - HOW DO I DO THIS!?

Any help would be appreciated.

Thanks.


Jam

Bounce Effect
I have a simple box, Ive shrunken it before the movie loads, that when loaded, it maximizes the box to its original size... im trying to give it that bounce effect so when it maximizes it looks rubbery-ish..

Bounce Off Walls
hey guys, i've attached a file for you to look at. when you open it go to the "menu" scene (there's nothing in gameplay yet, but i will need your help there too probably in the future). in menu, see that little black ball on the right (frame 38)? can you show me what action to add to that ball to make it start from that point... pick a random direction to go in... and whenever it hits any of the walls to bounce back... i want it to just continue to bounce around the screen in the background. (of course though, i want it to bounce back continueing on at the angle it hit the wall from.... do you follow me? did i phrase that right? do you get why i'm TRYING to say?)

Bounce Animation
Hey all,

I am trying to achieve a good animation that makes it look as if the object is bouncing a little bit right before it locks into place. just a small bounce and i need it to be smooth. this is part of a menu that pops up is supposed to bounce a little and then stop in its place. what i have tried to do is create a motion tween of it going into place then moving backwars a little bit and then going back. i dont know if it matters but im doing this with a bitmap not a vector graphic. the way i have it going it looks very awkward and it moves very sporadicly sort of. is there a better way to achieve this effect. i hope you know what i am talking about at least maybe a little. thanks

Rob

Bounce Effect
Anyone know how i can create a simple basic bouncing box effect? Just want to create a box that you drag from side to side and it bounces off the vertical walls on either side......no 'up and down' bouncing just left to right.

MC Follows The Cursor With Bounce?
I know how to make a movieclip follow the mouse cursor around a movie, but what I need to do is more similar to the www.sobebev.com navigation bar. That is, the item following the cursor should be limited to one axis, have a bit of bounce or sassyness to it, and disappear once the cursor leaves.

Any ideas on what the actionscript/math for this would look like?

Slide In And Bounce?
I'm trying to create a simple effect where a MC slides in from outsid the stage and kind of bounces to a stop. It's the same idea as a bouncing ball but along the x axis instead of the y axis.

I've read through a ton of tutorials and samples but I'm just not getting it. So many of them have drag and throw or follow the mouse and I can't seem to take out what I don't need and keep the script working.

sorry. I'm guessing that elastic effects are THE most asked question on here.

EDIT:

Ok I found this and it works pretty good

onClipEvent (enterFrame) {
// MOVING SCIPT PART
var speed = 8;
var viscosity = 1.5;
// Where to go-----------------------------
xpos = 294;
// Move to xpos script-------------------
difference = xpos-this._x;
xvelocity = (xvelocity+(difference)/speed)/viscosity;
this._x += xvelocity;
}

I need to have another clip come in from the right though, how do I reverse the direction of movment? Also what do I change to make it zippier? I want it to realy go "SPROING!!!"

Adding Bounce
I am using this code to move MCs on the stage but I would like to add a nice bounce effect to it so that they actually go passed the set xy then spring back a few times until it reaches the correct position. Can anyone give me some ideas on how to add that to my code?

function moveMe() {
this.const = .3;
// difference of position
this.d_difx = (this.targX-this._x);
this.d_dify = (this.targY-this._y);
// set position
this._x += this.d_difx*this.const;
this._y += this.d_dify*this.const;
// shut this off
if ((Math.abs(this.d_difx)<=1) && (Math.abs(this.d_dify)<=1)) {
delete (this.onEnterFrame);
}
}

And here is how I tell the MC to move
mcName.targX = 0;
macName.targY = 499.75;
mcName.onEnterFrame = _root.moveMe;


Thanks,

Bounce Menu
Ello ..is there anyone know how to make such bounce

menu just like in this site..go to news section and u'll

see..

http://www.clcsarquitectos.com/main_en.html

it's really tweaking menu....any walkthrough or sample

would be great....

thnks in adv

Bounce While Being Moved
If I had a circle, and I wanted it to be controled by the arrow keys, but not just move right ot left, but to bounce while doing that, how would I do this?

Thanks

EDIT: It would be like a game where you can walk left and right and jump, but when it jumps, ther wouls be gravity

Bounce Or Damping?
I have this code on a movieclip which works nicely.

onClipEvent(enterFrame){
_x += (positionx - _x) * .2;
_y += (positiony - _y) * .2;
_root.but1.onPress = function(){
positionx = 18;
positiony = 18;
};
_root.but2.onPress = function(){
positionx = -550;
positiony = 18;
};
_root.but3.onPress = function(){
positionx = 18;
positiony = -400;
};
_root.but4.onPress = function(){
positionx = -550;
positiony = -400;
};
}

Do any of you flash gurus know how I might add code that would make the clip bounce a little rather than going straight into position?

Thanks in advance!

Bounce Effect
I'm trying to get a "bounce" effect on a movieclip when it scales. Right now I have it scaling smoothly but I would like it to "bounce" or scale a bit past it's intended point and back to the intended point. I hope this makes sense. Here's what the clipEvent on my clip looks like now and the button actions as well.

code:
onClipEvent(enterFrame) {
_xscale += (newScale - _xscale) / 3;
_yscale += (newScale - _yscale) / 3;
}


my_btn.onRollOver = function() {
myclip.newScale = 110;
}
my_btn.onRollOut = function() {
myclip.newScale = 100;
}


Thanks for any help

Bounce Off At Angle...
Hi guys...

I figure this one shouldnt be too hard.

What would be an ideal algorithm for having a ball bounce off a wall, when the rotation of the ball is given, and the direction that the wall is facing is given...

all i need is a script that takes the given direction of a ball, the given direction of the wall it has bounced off, and turns it into a new resulting direction for the ball...

looking at the directions i drew on the attached image, heres another example of some input and output.

ball_rotation = -25, wall_rotation = -180,
resulting_rotation = -155

ball_rotation = +45, wall_rotation = -135,
resulting_rotation = -135
(ie: ball simply reverses direction in this case)

ball_rotation = +135, wall_rotation = -90,
resulting_rotation = -135

does anyone know where I can get some good resources for this? or even make up a quick script demonstration?

also, if you're finding my explaination hard to follow, ill post an example in flash as soon as i can...

thanks guys
~theWaste

edit: image updated

Rollovers Bounce Around:
i made a button in mx 2004 and when i cursor over the up state the over state shows up not in the exact same place and the same for the down and hit states.
if u need more info please let me know. its not uploaded yet so i can't demonstrate. i've selected center horizontally and center vertically for all states.
don't know what i've done to have this result.
any advice would be great. thanks.

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