ActionScript 2.0 :: Math Power Function - Where Both X And Z Are User Input Values
Oct 30, 2008I want to make a function like y= (1 - x^z), where both x and z are user input values. How is that possible?
View 1 RepliesI want to make a function like y= (1 - x^z), where both x and z are user input values. How is that possible?
View 1 RepliesHow can I make Flash calculate the value of the function y= (1 - x^2)^3 where x is the user input value?
View 3 RepliesHow can I change the speed of a moving car based on values input by user? Also, how can I make Flash calculate values of a function based on those input values?
View 1 RepliesI've created a form-like input to receive user input in the form of text in a frame. Now, I would like to pass that input into an external text file. I hope to get help to implement this. Let's assume that this app will be only used locally and not over the web.
View 0 RepliesI have a set of data (in ArrayCollection) and I need to fit a power function { f(x)= B + x^alpha } to it, before display in LineChart. As result I need the alpha and B paremeter.
View 1 RepliesI have an app (historical timeline) in which I am using one object (driver) to scroll another (driven) - like a scrollbox.There are limits on the movement of the driver, so I am using the % of the driver's movement to drive the % of the driven object's movement. It works fine on the ends of the driven, but I need to distribute the movement so that the driven object moves more at the end than at the beginning.Basically I need to multiply the % so that it moves from 0 - 1 non linearly.
View 2 RepliesI've gotten these sliders to work but can't get the output values to add up. For instance, depending on the values for slider 1, 2 and 3, I need the total to show up in a separate text box. I keep getting a NaN message in the text box.Here's the code I have so far:
//item 1
sliderOne.width = 600;
sliderOne.value = 0;[code].....
I was wandering if I can get values(numerical) from an xml files and multiply them. Need a tutorial Something like this.
[Code]...
is it possible in actionscript for the user to type in a box from a keyboard like a user input text box..
View 3 Repliesquick question, i have a loop playing where two MC holers have math.random script applied to them, allowing random images to be generated as it plays from a folder of images. i've gotten everything to work,initially i had about 60 images, i then added an additional 40, changed the coe to reflect this and had no problems.
today i added an additional 196 images, but when i test my movie the numbers generated never surpass #101
is there a limit to the ammount of numbers output by math.random script?
[Code]...
I am working on a simple math game for kids. It is nearly complete but the problem I have is that when the user enters their answer in the input textfield, the numbers are entered from left to right. Most people do math problems from right to left. Is there a way to make the numbers appear from right to left? I am thinking that I would have to use an eventlistener on the number keys and also use parse text or arrays somehow to manipulate the numbers.
View 4 RepliesWhat easiest way to place cursor (focus?) into an textfield input box for receiving user input after an event?
View 1 RepliesI have some text that says go to page with a input textfield box and a go button. This is a flash cs4 file.I want to have the user input the page number and have it go to that frame.I am using actionscript 3.0 and have bought 4 books and researched online and still can't find what I am looking for.I can make the go button go to whatever page I want I just don't know how to get the information the user put in the box.
View 2 RepliesHow to use math mod function in flex?
calculate like this 7 mod(%) 2 = 1
I wonder how to make a Math.random() function, or something similar where it chooses a number from 0-9. But as the program progresses, another random variable will appear. That random value is what I want removed from the 0-9 scale. (The other random variable is also from 0-9)
View 4 RepliesFor some reason my math.floor function is not working (trace yields "undefined")..[code]
View 2 RepliesI am new to Flash and Action Scripts. I am trying to put together some Mortgage Calculators for a client and am having issues getting the syntax for the formula correct. Below is my code could someone look it over and give some pointers on how to structure the formula. It is a standard mortgage payment calculator. num1 is Loan Amount num2 is interest rate and num3 is loan term they are the instance names of the unput text boxes.
equels_btn.addEventListener(MouseEvent.CLICK,equel sClick);
num1.border = true;
num2.border = true;[code]........
I get the folowing error when I click the equels_btn
TypeError: Error #1006: value is not a function. at LoanPayment_fla::MainTimeline/equelsClick()
I am generating random numbers between 1 and 90 how do I do it so I don't get any repeats. Here is the code I am using.
ActionScript Code:
var num:Number = Math.ceil(Math.random()*90);
I cant get this to work. I think its pretty self explanatory what I want to do, set _x to a random position (b1 - b6)
Code:
onClipEvent (load) {
stop();
b1 = 462;
b2 = -462;
b3 = -1388;
b4 = -2314;
b5 = -3240;
b6 = -4166;
} onClipEvent (load) {
RanNum = Math.ceil(Math.random() * 6);
_x = ["b" + RanNum];
}
I have problem about math. I want write function of laplace transform in flash.
X(s)=kd*s^2 +kp*s+Ki;
F(s)=s^3 +(10+kd)*s^2 +(20+Kp)*s+Ki;
Gc(s)=X(s)=/F(s);
How I write code(actionscript) in flash, when Kp Ki Pd is value of user input. And S is Laplace transform.
Here is the problem:
var p:int = 0;
var n:Number = 0;
n = 32.999999999999999;
p = Math.floor(n);
trace(p); // returns 33
n = 32.11111111111111;
p = Math.floor(n);
trace(p); // returns 32
I would expect both of these to return 32. I have searched, and it seems this is an unreported bug in AS3. Or ... am I doing something wrong?
How do you round a number to 2 decimal places using the Math.round function?
View 3 RepliesI'm new to Actionscript programming. I'm trying to figure out what is the best way to return multiple variables, each having a different data type, from a function. For example, if a function needs to return variable aa ( a string) and variable bb (a number).
The function I'm using just crunches a lot of math, and doesn't relate to an object in a GUI. One method I got from a Google search used an Object, but as (I think) this requires me to create a class, I wondered if there was a simpler way. Since an array can hold elements of different data types, perhaps this is a simpler approach (?). [code]...
Wat is the diffrence between these two?
View 2 RepliesI'm loading data values from an external XML file and I want to swap them with other ones in order to show the latter further on in the movie. As an example, I have the following data in the XML file:
Code:
<set label='Epson'>
<set label='Hitachi'>
<set label='Toshiba'>
[Code].....
They will appear in a random order but only once in each graph. In essence, I need something that takes the XML label attribute and swaps it with an other value before sending it further on to the rest of the movie for processing. It would be more practical to do the swapping in the server app that writes the xml file before it is written but that is not possible so I need to do that search and replace when I load the xml in Flash...
Edit: I could use even something like open the xml - search and replace values - save to new xml
I have the following scenario: I'm loading data values from an external XML file and I want to swap them with other ones in order to show the latter further on in the movie. As an example, I have the following data in the XML file:
Code:<set label='Epson'><set label='Hitachi'><set label='Toshiba'><set label='Mitsui'><set label='Panasonic'><set label='Canon'><set label='Lexmark'>and I want to swap the following data
[code]........
I'm trying to set up a calculator for a couple of formulas I need to use for some schoolwork. I thought it would be a lot easier if I could just put the numbers in there and hit enter.I can't figure out how to transfer the numbers from the input box to the dynamic box though =/. I figured I'd try to get going really easy, just do a input box, when you click on a button, a dynamic box displays whatever is in the input box. I cant get it to work though . I tried various variations of codes, Heres some of them:
[AS]
this.btn.onRelease = function(){
this.outp.getProperty(this.inp)
[code]....
I have the following scenario: I'm loading data values from an external XML file and I want to swap them with other ones in order to show the latter further on in the movie. As an example, I have the following data in the XML file:
Code:
<set label='Epson'>
<set label='Hitachi'>
<set label='Toshiba'>
<set label='Mitsui'>
<set label='Panasonic'>
[Code] .....
They will appear in a random order but only once in each graph. In essence, I need something that takes the XML label attribute and swaps it with an other value before sending it further on to the rest of the movie for processing. It would be more practical to do the swapping in the server app that writes the xml file before it is written but that is not possible so I need to do that search and replace when I load the xml in Flash... I could use even something like open the xml - search and replace values - save to new xml
wat's the difference between finding a angle using Math.atan2(y,x) function and by finding using the movie clip's rotation (mc._rotation*Math.PI/180);
View 9 RepliesI have a code in which I have to use Math.round if a certain value is for example 3.67 (67 is higher than 50) and Math.ceil if a value is for example 3.23 (23 is lower than 50). What can I do to make flash calculate if what after the dot �.� in 3.23 (for example) is higher than 50?
View 2 Replies