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




Easing Equation



I need a easing equation that starts really slow and goes out really fast. Already searched but only found the usual ones. (this._alpha += ((50)/10)

thanx



ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 12-17-2004, 10:01 PM


View Complete Forum Thread with Replies

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

Can Someone Help Me Add Easing To This Equation?
This script is designed to control the frame in the movie clip relative to the _xmouse position. I just want to add easing to the equation and I'm having a difficult time doing it. Everything I've tried kills the effect.

Code:
onClipEvent (mouseMove) {
this.gotoAndStop(Math.round(200-_root._xmouse/4));
updateAfterEvent(mouseMove);
} {

I've attached the fla file; I'm trying to make the movement more natural.

Easing Equation
howdy Y'All

Anyone know an equation for moving an object real slow and then speeding up rapidly towards the end of it's movement(note, I'm using a destination due to fact that this is for a game and thus I cannot use the destination as part of this equation)

right now I'm using:

var vy:Number = 0;
var speed:Number = .001;

vy += speed*exponential;
exponential += 1;

which isn't reall giving me a good easing solution, it speeds up too soon.

A Custom Easing Equation
Does anyone know of the formula to get an EaseInOut movement?
I need to control the movement 'manually' onEnterFrame, I'm avoiding using any tween classes (both in-built and custom ones like zigo).

for example if I want an EaseOut movement, I just divide the distance between currentValue and targetValue.

e.g.

HTML Code:
xs= (_x-xTarget)/10
_x+=xs
how do i go about creating an easeInOut?

Can Anyone Me Sence Of This Rebbertpenner Easing Equation.
As tweening robert pernner easing. If you look at the fla and press the letter 'B' that's the easing i want to makes the easing ball_Mc ease, it eases to the next location moving in a curve s bend to the next location. I only want the one equation so that i have a two buttons(prob eventauly more) but for an example two btns and when you press on one button the ball_Mc moves to the xpos set and the ypos set. So that all the other code is deleted and only left the math on the ball_mc to make it move the same as if you press the 'B" in the tweenrobpenner.fla

Easing Equation Coming Up Short
Hey...ive got a weird problem with this easing equation. I'm sure you've seen it before:


Code:
if (this.panelPosition < showPanel){
goto = topPos + (barHeight * this.panelPosition)
this._y += (goto - this._y) * .3;
trace (goto)
}


right now barHeight = 16 and topPos = 9, and panelPosition is from 0 to 5 depending on which panel.

whats going in the enterFrame is i set up a variable to determine where the panel should move to. Then I use that easing formula to move it..except it actuall stopping about 5 pixels or so before where it should. Any ideas?

Rich

Adjust Easing Equation: Move By _x And Then By _y
I've got a basic easing equation that i use:

code:
onClipEvent (load) {
_x = 0;
_y = 0;
targetx = 200;
targety = 200;
speed = 2;
}
onClipEvent (enterFrame) {
_x += (targetx-_x)/speed;
_y += (targety-_y)/speed;
}


i was wondering how it would be possible to adjust this so that the mc moves to targetx first and then moves to targety after, i.e. moves along the x axis to its target, when it gets there it will then move to targety along the y axis. I tried adding a simple if loop inside the onClipEvent(enterframe) but i couldnt make it work.

thanks.

Adjust Easing Equation: Move By _x And Then By _y
I've got a basic easing equation that i use:


ActionScript Code:
onClipEvent (load) {
    _x = 0;
    _y = 0;
    targetx = 200;
    targety = 200;
    speed = 2;
}
onClipEvent (enterFrame) {
    _x += (targetx-_x)/speed;
    _y += (targety-_y)/speed;
}

i was wondering how it would be possible to adjust this so that the mc moves to targetx first and then moves to targety after, i.e. moves along the x axis to its target, when it gets there it will then move to targety along the y axis. I tried adding a simple if loop inside the onClipEvent(enterframe) but i couldnt make it work.

thanks.

Penner Easing Equation Problems
I have a actionscript 2 file that I am trying to perform some of the penner easing equations; however, everytime I try to publish the file it spits out this error "There is no property with the name 'easeOutElastic'. But when I am in the code window and I check for actionscript errors it displays that I have no errors. The errors only happen when I export the file. Is this the way I am calling the easing functions? Thanks for your help.


function onRelease()
{
this.stopDrag();
this.begin = this._x;
this.change = -begin;
this.duration = 16;
this.time = 0;
this.onEnterFrame = function ()
{
++this.time;
if (this.time < this.duration)
{
this._x = Math.easeOutElastic(this.time, this.begin, this.change, this.duration, 5, 5);
}
else
{
delete this.onEnterFrame;
} // end else if
};
} // End of the function
function onReleaseOutside()
{
onRelease();
} // End of the function
var begin;
var change;
var duration;
Number;
var time;
Math.easeOutElastic = function (t, b, c, d, a, p)
{
if (t == 0)
{
return (b);
} // end if
t = t / d;
if (t == 1)
{
return (b + c);
} // end if
if (!p)
{
p = d * 3.000000E-001;
} // end if
if (a < Math.abs(c))
{
a = c;
var _loc7 = p / 4;
}
else
{
_loc7 = p / 6.283185E+000 * Math.asin(c / a);
} // end else if
return (a * Math.pow(2, -10 * t) * Math.sin((t * d - _loc7) * 6.283185E+000 / p) + c + b);
};
}

Built-in Tweens - Flash's Easing Equation
I've been wondering for a while about the mathematical properties of Flash's built-in easing. I thought it was probably cubic, because a lot of animation programs use cubic splines for their easing. Either that or quadratic.

Turns out Flash has quadratic easing (x^2). Here's a fun science experiment you can try at home. Create a movieclip and tween it on the timeline from _x of 0 to 100, from frames 1 to 11. Put a trace code on the movieclip:

onClipEvent (enterFrame) {
trace(_x);
}

Your output:

1
4
9
16
25
36
49
63.95
80.95
99.95
-----------

x = t*t

=]

~
Robert Penner
Vancouver, Canada
http://www.robertpenner.com
~

Math Problem: Trying To Reverse Robert Penner's Easing Equation
This is probably a very easy math problem but I have hit a mental block with trying to figure it out. Below is an easing equation by Robert Penner that I am trying to solve for one of the variables in the equation.

// exponential easing in - accelerating from zero velocity
// t: current time, b: beginning value, c: change in position, d: duration
function easInExpo(t, b, c, d) {
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
};

I am only concerned with the portion :
c * Math.pow(2, 10 * (t/d - 1)) + b;

I want to create an equation in actionscript 2.0 that will solve for t.
SOMEBODY PLEASE HELP ME OUT

Penner Equation : Easing.Quad.easeIn = "100". But How Do "33" ?
Hello,

This is a simple question about Penner Easing.

When you use easing.Quad.easeIn , this is like if you create in the IDE a tweening with a value of "100". The return of the easeIn function gave the same value. Ok.

But now if I set the tweening in the IDE to "33" and I want to obtain the same values with the Penner equation. How can I do it ? Is it possible ?

Thanks

Valid 3d Equation
Can anybody tell me;
a) If this is a valid method for rendering a 3d shape
b) Does it help anyone understand 3d calculations better
http://www.nlc.net.au/~oceana/3dmenu1.swf
I looking to do a tutorial if this method is correct.
BlinkOk

Circle's Equation....
Hi

Can somebody tell me what is the equation for the "circle" in maths?
as i am trying to do something in AS to assign the MC to move in a circle...
Thanks in advance...

MKit de HK

Using A Mathematical Equation?
Hey guys,
I'm wanting to make a jazzy flash movie that randomly fills the window with little boxes starting from the middle. Sort of like on the loading page of Der Baurer's (spelling?) web site but different in the sense that the boxes are smaller.

I'm wondering if there is some mathematical equation of some sort that could do this automatically since manually animating this would be next to impossible.

Has anyone ever tried this before or know if it can be done?

Thanks.

Graphing Equation
how do i write script that will find the x position object and the y position of the mouse to find give the object its new y position? check out this diagram at

http://www.iamstatic.com/josh/problem.jpg

the object's x position increases at a constant rate.
and the object's y position is dictated by the y position of the mouse and how far along the object is on the x axis.
any guesses?
j.

Curve Equation
I will like to know if it's possible to use flash

By entering the molarity and volume of an acid/base with an indicator.......press the button to show the titration curve
and the different graphs will appear upon entering different values

For example....the x-axis will show the volume entered and the y-axis will show the ph value from 0 to 14

thanks

Knob GUI Equation
Okay....I've got a knob....that I can turn clockwise from 7o'clock to 5o'clock.
The 7 o'clock value is 20...the 5o'clock value is 20000.

at 8'oclock the value should APPROXIMATELY 40
9o'clock=80
10o'clock=160
11o'clock=320
12o'clock=640
1o'clock=1280
2o'clock=2560
3o'clock=5120
4o'clock=10240

i've currently got my knob returning values between 0 and 1....

does anybody have any idea what equation that would be to make the knob have more of an exponential effect??

SubString Equation
Hello,
I need help.
How to find b

substring(b, 3, 1) * substring(b, 6, 1) == 72

Best regards

Curve Equation
OK, so I am mathmatically challenged...I am trying to write a function that will move an object in a curve motion (1/2 a circle)with 3 variables: speed, end Y position, and radius. I know how to write a linear motion with easing, but a curve is beyond my knowledge...anyone care to help me getting started??


Thanks,
Al

CurveTo Equation Help
Hi, i'm using a basic curveTo() function to draw a curve (attached pic). I'm not having any trouble drawing it but I want to get an equation out of the curve which I can use to find x and y points along the curve. I've searched google for a bit and these forums, couldn't find anything. Just thinking about the type of equation used to draw these curves hurts my head

Any help is appreciated, thanks in advance.

AS Ease Equation 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?

String To Equation
Is there an easy way or some kind of function that can turn a string into an equation? Say I have:

var string = "4 + 5";

is there something that can get it so it will be counted as 9?

Equation Parser
This class will take a function of x as a string and then evaluates that equation at a value. This class requires my extended math class which can be found here:
http://www.kirupa.com/forum/showthread.php?t=251648



The Class:

ActionScript Code:
package { public class Equation extends Object {    private static const PAREN_PATTERN:RegExp = /(?:(|^)([^()]+)(?:)|$)/;  private static const VARIABLE_PATTERN:RegExp = /[xpie]{1,2}/g;  private static const FUNCTION_PATTERN:RegExp = /([a-z]+)(([^()]+))/;  private static const POWER_PATTERN:RegExp = /(-?d+(?:.d+)?)([^])(-?d+(?:.d+)?)/;  private static const MUL_DIV_PATTERN:RegExp = /(-?d+(?:.d+)?)([*/%])(-?d+(?:.d+)?)/;  private static const ADD_SUB_PATTERN:RegExp = /(-?d+(?:.d+)?)([+-])(-?d+(?:.d+)?)/;    private var currX:Number;    public var equation:String;    public function Equation(eq:String) {   this.equation = eq;  }  public function evaluate(x:Number = 0):Number {   this.currX = x;   var eq:String = this.equation.split(" ").join("");   while(Equation.FUNCTION_PATTERN.test(eq)) {    eq = eq.replace(Equation.FUNCTION_PATTERN, this.evaluateFunction);   }   eq = eq.replace(Equation.VARIABLE_PATTERN, this.evaluateVariable);   while(isNaN(Number(eq))) {    eq = eq.replace(Equation.PAREN_PATTERN, this.recursiveEvaluation(Equation.PAREN_PATTERN.exec(eq)[1]));   }   return Number(eq);  }  private function evaluateVariable(match:String, index:uint, original:String):String {   var r:Number;   switch(match) {    case "x" :     r = this.currX;     break;    case "pi" :     r = MathExt.PI;     break;    case "e" :     r = MathExt.E;     break;   }     return String(r);  }  private function evaluateFunction(match:String, f:String, a:String, index:uint, original:String):String {   var args:Array = a.split(",");        for(var i:Number = 0; i < args.length; i++) {    args[i] = new Equation(args[i]).evaluate(this.currX);   }   return String(MathExt[f].apply(null, args).toFixed(20));  }  private function evaluateOperation(match:String, a:String, o:String, b:String, index:uint, original:String):String {   var an:Number = Number(a);   var bn:Number = Number(b);   var r:Number;   switch(o) {    case "^" :     r = Math.pow(an, bn);     break;    case "*" :     r = an * bn;     break;    case "/" :      r = an / bn;     break;    case "%" :     r = an % bn;     break;    case "+" :     r = an + bn;     break    case "-" :     r = an - bn;     break;   }   return String(r.toFixed(20));  }  private function recursiveEvaluation(eq:String):String {   while(Equation.POWER_PATTERN.test(eq)) {    eq = eq.replace(Equation.POWER_PATTERN, this.evaluateOperation);   }   while(Equation.MUL_DIV_PATTERN.test(eq)) {    eq = eq.replace(Equation.MUL_DIV_PATTERN, this.evaluateOperation);   }   while(Equation.ADD_SUB_PATTERN.test(eq)) {        eq = eq.replace(Equation.ADD_SUB_PATTERN, this.evaluateOperation);   }   return eq;  } }}


Currently Supports:Simple arithmetic operations including addition, subtraction, multiplication and division
More complex operations including modulus
Powers written as a^b
Parenthetical grouping
X as a variable
Multi-argument mathematical functions from my MathExt class including sin, cos, tan, asin, acos, atan, csc, sec, cot, acsc, asec, acot, log, ln, sqrt, root, pow, exp, abs, round, ceil, floor, gcd, lcm, random, factorial, perm and comb
Mathematical constants including pi and e

To Do:Support for degree constant (pi/180)
Allow the use of pipes | to denote absolute value expressions
Support for factorials denoted by !

Examples:

Simple Arithmetic:

ActionScript Code:
var eq:Equation = new Equation("x+x*x-x/x");trace(eq.evaluate(2)); //5  

Parenthetical Grouping:

ActionScript Code:
var eq:Equation = new Equation("(x+x)*(x-x)/x");trace(eq.evaluate(2)); //0  

Powers:

ActionScript Code:
var eq:Equation = new Equation("x^(1/2)");trace(eq.evaluate(9)); //3  

Math Functions and Constants:

ActionScript Code:
var eq:Equation = new Equation("root(abs(cos(pi)-ln(e))*4,3)");trace(eq.evaluate()); //2  




If you have a questions, suggestions or errors please feel free to post. I hope this is useful to some people

Scrollbar Equation Help
hi everybody. i made a scrollbar to scroll a masked textbox, but can't seem to get the equation right. can anybody help??

i have an MC called textBg, and the MC to be scrolled, called textBox. i calculate the difference between the two, and scale the scrollbar (scrollHandle) appropriately on top of an MC called scrollBg. (scrollBg is the same height as textBox, if it makes any difference) the y position of textBox is relative to textBg, which is stationary.

so far i've declared some variables, and tried using them... not sure if they're useful though:


Code:
var textDiff = textBox.height - textBg.height; // size difference - text scroll amount
var maxScroll = textBg.y - textDiff; // maximum scroll distance
var scrollDiff = scrollBg.height - scrollHandle.height;
i've mucked around with different equations, involving scrollHandle.y, but can't seem to get it to work correctly. i really suck with numbers, so any help would be greatly appreciated! i hope i explained myself well enough. thanks!

AS Ease Equation 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?

String To Equation
Is there an easy way or some kind of function that can turn a string into an equation? Say I have:

var string = "4 + 5";

is there something that can get it so it will be counted as 9?

About The Ease Equation
I have some problems with the ease equation created by Robert Penner

Math.easeOutQuad=function(t,b,c,d){
return -c*(t/=d)*(t-2)+b;
};

I couldn't understand it,I need your help!!!

Simple Equation
Last edited by gioska : 2003-12-08 at 07:07.
























sorry for my english.

Who explains like applying it to me to an object? like enough simple equation.

// t: current time, b: beginning value, c: change in value, d: duration

Math.linearTween = function (t, b, c, d) {
return c*t/d + b;
};

Parsing An Equation?
hello everybody,

I'm just getting into actionscript and wanted to create a parser for mathematical functions like "x^2+5*3/10-5". the calculation of the nth power of x is no big deal, works all fine. the result is returned as a string (although it makes no difference if I export it as String or as Number).

When I feed the Math.abs() function with this result (in case of x=2 it should be 0.5) I get a NaN. Same result when I parse the f(x) function as Number instead of String.
If I put it in manually (i.e. Math.abs(2^2+5*3/10-5)) it works all fine...

So my guess is that I just need to convert the String into a Number, but the Number() function was of no help either. Could someone give me the vital hint how to do that? Think I'm looking in the wrong direction.

Thanks in advance,

tox

Math Equation Help, Please
"Math is hard."
-Barbie

I need help with a simple math equation. I am working on an actionscript routine that handles a ball bounces over words in a sentence as they are read aloud. The challenge is that I need the ball to bounce at specific beats in order to keep up with the words. The equation I need help with should be pretty simple for someone mathmatically inclined.

I have all of the physics worked out. The ball bounces and looks great. I just need to control the initial velocity. So, for simplicity's sake, let's take some shortcuts. 1) let's take all but the Y axis out of the equation. X-Velocity is fixed and is a solved problem. 2) gravity can be shorthanded as a decay rate applied each frame:

Vf = Vi * g

Where Vf is the final, or new, velocity for the current frame, Vi is the initial, or old, velocity from the previous frame, and g is the decay rate, or simplified gravity. This is pretty basic stuff.

The problem I'm having is applying this over time in reverse to calculate the very first frame's initial velocity. I'm looking for a seed, or initial, velocity that, when applied in frame 1, will produce a final velocity of zero at time-x. For instance, let's say we want the ball to reach its zenith at frame 30 (1 second). What is the formula to calculate the initial velocity?

Vi = [???]

Where [???] produces a velocity of 0 after 30 frames?

Any help would be most appreciated.

Many thanks,
Steve

Embed A Variable In An Equation
Hi, in flash 5 you can embed a variable in an equation.

Like this:
navframetimer="part";

_root["navframetimer"+ currentnavpartinsert]=_root["navframetimer"+ currentnavpartinsert];



I have been unable to do it in Flash 4.
I have tried the following (unsucessfully):

navpart="one";
tellTarget ("/textfields/["nav"+navpart]") {
gotoAndStop(_root.textfields.["nar"+navpart+"frame"]);
}

Can anyone help?

Cheers,

M@

Rounding Math Equation
Hi, I'm looking to round a math equation up to 6 decimal points.

I used Math.round (x) but it rounds to the nearist interger.
and gives you a solid number.

I need it to round to the 6th or 4rth decimal. Perferably 6th decimal.

I'm not sure how to do that.

Any suggestions?

Thank you

Equation Always Returning A Positive Value
This is a nice easy one for you:

I have a simple equation in my actionscript:

new value = this._x - endPos;

I want the equation to always give a positive result. e.g if it is 400-100 the result is 300, and 100-400 - the result is also 300 (rather than -300). I know it can be done but forgot the action required.

Anyone know it?

Thanks for your time
Neil

Calculating Equation Of A Path
Right.. hope this is in the right forum..

anybody know of a utility to calcutalte the equation of a curved line?

I want to move an object with script along a irregular sinosoidal type pathway.. now going back in my memory I could calculate the path, as it is comlpex wave, right? but from what i remember from that in math class i think i it is something i would rather avoid.. so what would be great is if i could draw a line and get the approximate equation defining that line (doesnt have to be accurate)..

anyone know of some software or an easy way to do it?

thanks in advance

Simplify This Equation Using Actionscript
There must be an easy way to write this!
code: _root.moneyleft = _root.depth0+_root.depth1 + _root.depth2 + _root.depth3+_root.depth4+_root.depth5+_root.depth 6+_root.depth7+_root.depth8+_root.depth9+_root.dep th10+_root.depth11+_root.depth12+_root.depth13+_ro ot.depth14+_root.depth15+_root.depth16+_root.depth 17+_root.depth18;

&#8730; Need For A Mathematical Equation
Hi

I need to calculate a variable and that math equation involves a √
how should i do it

thanks in advance

Change Var With Button Using Equation
Hi I hope you can help:
I have a dynamic textbox with the var set to "pres" and a text file named "bio.txt" which contains the following variables:

&pres=something
&page= test
&page1=something else
&page2=etc.

When i click the button called "next_btn" for the first time I want it to change the var 'pres' to 'page1', and then the second time to 'page2' and so on. So the textbox should display "something" when it loads and then after clickin the button it should display "something else".

here is the actionscript:

loadVariablesNum("bio.txt", 0);
n=1;
next_btn.onRelease = function() {
nextImage();
pres=page+n;
n++;
trace(pres);
};

When it loads the dynamic textbox displays "something" but when i click the button it should display the var 'page1' which is "something else" but instead it displays "test 1". Why won't "something else" come up when I click the button??? If you need a simple fla file to work with i will be happy to make one. Thanks...

Execute Equation Only AFTER Input
I'm hoping one of you could help me. I've got a simple form with a simple equation, but I want the function to only run when all three inputs have variables. I setup the code so that they start out as 0, but since the function divides, you get the Infinity for a total until you punch in decent numbers for all three. I went ahead and setup a Key.Listener so that it wouldn't start at "NaN", but I'm sure there's an easier way.


Code:
init();

var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
checkSum();
}
Key.addListener(keyListener);

function init() {
a = 0;
b = 0;
c = 0;
total = 0;
}

function checkSum() {
onEnterFrame = function() {
copay = parseFloat(a);
deductible = parseFloat(b);
interest = parseFloat(c);

total = (copay + deductible) / interest;

}
}

Math Equation Manupulator HELP..
Is there any way in actionscipt that i can manupuate a math equation...

for instance..

to begin with, the equation is...

ax + b = c

not numbers, just pure algebra.

and by manupulating, i mean, having buttons people can push say "add c to both sides"

it would result in ax + b + c = 2c

or "divide c by both does"
and would result in (ax + b)/c = 1

something like that? anyway to do that?

I have one that can solve basic NUMBER algebra equations...but for "pure algebra"...i am stumped.....

Dynamic Thumbnail Next Row Equation
Hi Guys,

Got a problem with my loop. I have the y values sorted out, but the x value is stumping me. I need it to return to the initial x value of the first thumbnail so i can have a stack of thumbnails. The code is as follows:

__________________________________________________ _____________
rowcount = 1
countup = 0
roww = 0
//setup thumbnails
for (tn=1 ; tn<50 ; tn++) {
duplicateMovieClip(thumbholder, "thumb"+tn, tn);
eval("thumb"+tn)._x = ((tn*35)+148) <<<< equation ??
eval("thumb"+tn)._y = (rowcount*30)+70
countup ++
trace(eval("thumb"+tn)._x)

if (countup>4) {
< to change x value to ??
rowcount ++
countup = 0
}

__________________________________________________ ____________

I know I have to put something in the if test to change the equation for the x value of the thumbnails..not sure what..and I also know that the equation in the for loop has to contain something that takes the if test into consideration...not sure what the equation is.

Any help is greatly appreciated.

Maths Equation Formatting
I'm currently working on a series of maths quizzes. Users answer questions, and get a 'yay, you're smart' if they get it right, or a popup explaining how to get the correct answer if they're wrong.

For example, the popup for Area of a Triangle reads as follows :


Quote:




The Correct answer for this question would have been :
Base = TheBaseValue
Height = TheHeightValue
Press Restart to attempt the exercise again. Good Luck!




You might be able to see my problem.
what would be the best way to format this text, so that the '=' signs are always aligned vertically down the page - *without* there being a massive gap between the '=' sign, and the text on either side.

Essentially I want the stuff on the left to be right justified, the stuff on the right to be left justified, and the equals signs to be aligned down the page.

I've gotta solve this now, because further down the road I'll be dealing with larger equations, and I'll need some form of formatting system in order to keep them organised.

I've tried using HTML formatting, but nothing seems to work correctly. Suggestions ?

Turning A String Into An Equation
Hey people,

I'm trying to make a graphing program in flash, and so i've decided to start with a simple x/y graph. I've set up the axis and that's all good. What comes next is my problem: turning a string (such as "y = x" or "x = 2y - y^2") into an equation which flash can then solve. Previously i made up a calculator which worked by splitting it down by each operation and then working it's way back up... but apart from being buggy, it didn't work with user variables either.

Once i've got flash recognising it as an equation, i intend to go from one x or y (depending on which isn't on it's own) value through another value which is set elsewhere, and plot and connect points generated through the equation (again, if the equation is y = x, flash would take the x and start at a number, eg 0, and increment it until another number doing the equation each time, giving at first y = 1, y = 2, y = 3 etc, and plotting a point at (1,1), (2,2) etc)

I'm a bit stumped, so any help is appreciated, but i'm especially interested in any theoroies on how to get brackets to work.

Equation Recognizer Thingy
Does anyone know if Flash has a built in equation recognizer? or somthing along that line

Turning A String Into An Equation
I while ago I asked how one would turn a string into an equation. I decided to just make something myself.

Here is the source code: http://www.steven-s.us/upload/store2...ToEquation.fla

And here is the swf: http://www.steven-s.us/upload/store2...ToEquation.swf

The only problem is, I was too lazy to include things like powers, sins, cosines, and perenthesis.

Maths Equation Question
I have a graph run from xml that could have anywhere from 1 to 31 points on the x axis. The problem relates to the labels on the graph, the dimensions are small so when theres only say 4 or 5 points it looks fine but when it gets past 20 it starts to look rubbish and the labels overlap. I want to work out an equation to only show 4 of the labels at any one time, but the maths is causing me headaches - my maths side of programming has always let me down so any advice/help would be fantastic.
anyone any pointers?
thanks

Equation Recognizer Thingy
Does anyone know if Flash has a built in equation recognizer? or somthing along that line

Turning A String Into An Equation
I while ago I asked how one would turn a string into an equation. I decided to just make something myself.

Here is the source code: http://www.steven-s.us/upload/store2...ToEquation.fla

And here is the swf: http://www.steven-s.us/upload/store2...ToEquation.swf

The only problem is, I was too lazy to include things like powers, sins, cosines, and perenthesis.

Need Equation For Dynamic _mc Scrollbar
I have built a simple scrollbar that scrolls a targeted _mc. It works fine.

But... I need to be able to have the scroller scroll the _mc completely from top to bottom based upon a varying height of the _mc. Sometimes the _mc will be taller sometimes shorter.

What would the actual tweening equation be to solve this problem?
This is what I have now.

Code:
scrollMc = function () {
_parent[mcToScroll]._y = -dragBar._y;
}
This function is ran via setInterval() whenever the dragBar is moved. Also the dragBar sits inside a holder _mc that is always 1000px tall.

Thanks a lot!

Need To Make An Equation Into A Variable
Hello,

I have several arrays that are like this...

ch1sounds['test1.mp3', 'test2.mp3'...]
ch2sounds['test1.mp3', 'test2.mp3'...]
ch3sounds['test1.mp3', 'test2.mp3'...]

and I have the following expression to get the correct sound file to play

soundToLoad = "ch" + chapter+ "sounds[" + i + "]";

but this is returning for ch1sounds[0], and I need it to return the value of ch1sounds[0], which is test1.mp3.  I tried the eval function and it's returning undefined.

What am I doing wrong?

Thanks in advance



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