Math: Significant Digits
hey folks, I am trying to get the two significant digits of a value. Anyone know how to do this?
for example, 23900 =>24000
I was trying to write it out as
Math.round(Math.log(Math.abs(value))/Math.LOG10E);
I don't think it's right.
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 07-24-2007, 01:13 PM
View Complete Forum Thread with Replies
Sponsored Links:
Significant Digits
i'm trying to get a dynamic text box to display a price, ie "$ 3.50"
the variable is added to or subtracted from, so sometimes its a whole number, in which case i need it to show the zero cents. I tried the C way of dividing by 1.00 or multiplying by 1.00, but no dice. Math.round didn't help either, so I'm always stuck with integers or only the ".5"
is there any way to set the variable or the text box to 2 decimal precision?
View Replies !
View Related
Significant Figures
I am doing a simple flash exercise for my job which involves learning about "significant figures" in Maths. For the first box I want the user to input a number which always has a range of 2 decimal places minimum. Then the user chooses how many decimal places the end result is. For example entering 2.759, a user then puts 2 decimal places and the final result is 2.76. Is there any way of doing this as I am struggling to compose one with teh Maths functions available.
Thanks in advance
View Replies !
View Related
Significant Figures
Hi there,
I'm having a little problem with significant figures.
I have a variable which is '1.00'
this will only display as '1' in a dynamic text box.
If the value is '1.25', obviously '1.25' appears in the text box.
Is there a way that I can get the text box to always show to 2 significant figures, therefore it will show '1.00'?
(The variable is a string taken in from an external file and then converted using parsefloat)
Cheers!
View Replies !
View Related
Rounding To Significant Figures
Hi,
I'm writing a Flash thingie that is based on an Excel spreadsheet (geez, loadsa maths) but there's a problem with rounding.
Excel, by default or otherwise, is rounding all values to ten significant figures. Does anyone have an actionscript function for doing this?
Thanks much in advance
Keith
View Replies !
View Related
Rounding To 4 Significant Figures
can anyone tell me how to round a variable to 4 significant figures? its for a timer im making where i only want 4 digits on screen, so ill start as 0.000 and as it increases get to 12.32 and then 233.2 and then 1234 (for example, not those numbers, those amounts of digits)
so how?
View Replies !
View Related
Significant Slow Down When Published?
hello every1 I was just wondering if anyone else has experienced this, because my transitions are in ae , and whwn I publish it and play it through html the frame rate slows down drastically but not the performance it self , just the frame rate, and I have to jack up my frame rate to 50 just to get a decent output in the html version, so that means bigger file size and alot more keyframing, could u please help me.
View Replies !
View Related
Significant Figures In Flash MX 2004
I am using Flash MX 2004. I have created a program that caluclates unknown values based on 4 known values. I am wanting to round these numbers to 5 significant figures. For example:
133.949404 would equal 133.95
20000101 would equal 20000000
How is the best way to accomplish this? I am totally at a loss for what I need to do on this.
Thanks in advance,
Jon
View Replies !
View Related
Significant Performance Gain Through Optimisation
Hi all, I've been creating a flash presentation over the last couple of days which basically shows 200+ slides as mini thumbnails which all move, resize etc.
Unsurprisingly this was a little laggy, but was improved with some cacheAsBitmap, less alphaing and less drop shadow & bluring.
However, the thing that has saved the project from slow, impending doom, was to never set any property of a MovieClip unless it had to change.
For instance:
ActionScript Code:
thumb.onEnterFrame = function(){
//The following causes unnecessary idle cpu load
this._x = 100;
//This removes (most of) this unnecessary idle cpu load
if( this._x != 100 ) this._x = 100;
}
I've ended up replacing every single property assignment in the project with a function that takes the a MovieClip, a property and a new value and only changes it if necessary. This has radically improved performance!
For example:
ActionScript Code:
//No more:
thumb._x = 100;
//Instead i have:
pSet(thumb,'_x',100);
}
This is something that I will end up implementing on all my future flash projects, but it's not exactly graceful... I could prototype a function to do this on the MovieClip object, but really I want to overload the setter function for all _ properties in the MovieClip class. Sadly I don't believe this is possible.
Has anyone else been down this road before and found any elegant solutions?
Cheers, James
View Replies !
View Related
Progressbar Does Not Work In Significant Long For Loop
I have a long for loop which takes significant amout to load everything in my flash application. the for loop takes around 5 seconds...
I want to show a progress bar during that time. I used onEnterFrame... but it wont update the progress bar MC during that for loop execution... It starts after for loop finishes.. . . Also I tried to put updation of progress bar in for loop along with updateAfterEvent ... but nothing work....
Does anybody have any idea ?
View Replies !
View Related
Progressbar Does Not Work In Significant Long For Loop
I have a long for loop which takes significant amout to load everything in my flash application. the for loop takes around 5 seconds...
I want to show a progress bar during that time. I used onEnterFrame... but it wont update the progress bar MC during that for loop execution... It starts after for loop finishes.. . . Also I tried to put updation of progress bar in for loop along with updateAfterEvent ... but nothing work....
Does anybody have any idea ?
View Replies !
View Related
Two Digits
This gives the remaining time in a song. I want the seconds to display as two digits 09 for example instead of 9 what is the easiest way to do that.
thanks alot
nbstot = (_level1._totalframes)/12;
nbseco = (_level1._currentframe)/12;
nbsleft = nbstot-nbseco;
time_left = int(nbsleft/60)+":"+int(nbsleft-(int(nbsleft/60))*60);
View Replies !
View Related
First Two Digits...
Hi there!
I manage a directory of former students of my school.
Users who want to register must indicate in the form the year they entered the school.
Alas, some of them enter bad years, like "0972" instead of "1972" or "0674" instead of "1974" !!!
Inside a general Validation function, I already have an Array using different validating functions (one for each Field) into which I use "push" to enumerate different mistakes and prevent them with warnings and disabling of the Register Button. Like this one:
validatePromo = function () {
if (_root.promoField.length<1) {
errors.push("- You MUST indicate the year you entered the school.");
}
if (_root. promoField.length<4) {
errors.push("- Year must be four digits long.");
}
if (promotion<1925) {
errors.push("- Enter 1925 as promotion year.");
}
}
What I don't know is how to write the if statement to force user to begin the year string with 19 or 20.
Could you please tell me ?
Many thanks in advance,
Regards
View Replies !
View Related
Two Digits Behind Point
Hi all,
I made a calculator where customers can can see how much a product is gonna cost. the totalprice can be 899.92378234 euro.
Is it possible to make this 899.92 euro or 900 euro?
You can see an example (in dutch) on http://www.jungleworld.nl/calculator.swf
thnx and sorry for bad english
asjbak
View Replies !
View Related
Last Two Digits Of A Variable
Hey!
I have a question, let's say I have a Variable, Variable A. Variable A is probably over 100. I want to take the last 2 digits of it (so it if was 117 it would be 17, 3415315 = 15 etc.) and make those last 2 digits into a new variable, variable B.
Is there a way to do this?
Thanks!
View Replies !
View Related
Getting Digits Of A Number
Hi, I do not have much experience with actionscripting but I have a quick question. All I want to do is have a number (which can be any number between 0 and 20 with one decimal place) and get the ones, tens and the tenth digit of the number separately.
so for example, if a number is 14.5:
ones = 4
tens = 1
tenth = 5
thanks for the help.
View Replies !
View Related
Getting Rid Of A Few Digits On An Integer
Hey guys, my flash skills are pretty limited, but i finally was succesful in displaying the elapsed time of a mp3 file that is playing in my flash mvie;;;
Unfortunately, flash is returnong not only the seconds(ie, when 3 seconds of a file is played, it will display 3000; when 60 seconds have been played, i will see 60000);
I am trying to get rid of the 3 last digits of this number .
i Don't know how to achieve this; in other programming language that i've used, i was able to transform the number in a string & then get rid of a few characters???
Can someone help please?? Thank's alot!!
View Replies !
View Related
Animating Digits
Hi All,
how is everyone doing? Fantastic over here. AND even better if one of you could help me with the following. When looking at the attached, what I`m``trying to do is, animate some digits, which are randomly entering the screen from the left (maybe I can define an are with a mask), then in step two form a large digit (square quadrat) and after some time leave the srceen randomly again to the right. But when I mean randomly, it mustn`t necessarilly be random, important is that the digits come in consequently.
thanks for any advice in advance.
Best,
m.
View Replies !
View Related
Animating Digits
Hi All,
how is everyone doing? Fantastic over here. AND even better if one of you could help me with the following. When looking at the attached, what I`m``trying to do is, animate some digits, which are randomly entering the screen from the left (maybe I can define an are with a mask), then in step two form a large digit (square quadrat) and after some time leave the srceen randomly again to the right. But when I mean randomly, it mustn`t necessarilly be random, important is that the digits come in consequently.
thanks for any advice in advance.
Best,
m.
View Replies !
View Related
Truncate Output Digits
Hi all,
Here's my little problem. I'm doing some calculations in Action Script and output the results to the screen.
Now the results look like this:
23.263636453737383838383838
Where I would like only four digits behind the decimal point, so:
23.2636
Can anybody help me?
View Replies !
View Related
Three Digits For Text Preloader...
Hi, I have a small question. In my preloader, I would like to have three digits (eg. 001, 002,...035,036,...099,100). How would I go about doing this? Right now my script contains:
code: bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
Percent_Loaded = bytes_loaded/bytes_total;
this.load_text = Math.round(Percent_Loaded*100);
if (Percent_Loaded >= 1) {
gotoAndPlay(37);
}
TIA
View Replies !
View Related
Show Score With 6 Digits?
I have a dynamic text box that updates with the player's score. Currently it starts at 0. I would like it to show as 000000 instead. Adding 110 points would show as 000110. How can this be done?
Thanks.
View Replies !
View Related
Extract Date With 2 Digits:
I've used a time stamp to get my date and then extracted it with the following:
var timeStamp = new Date().toString();
var today = new Date();
var timeNow = (today.getMonth() + 1) + "/" + today.getDate() + "/" + today.getFullYear();
this works but it gives me one digit results for the month and day such as:
2/2/2006
My customer needs 02/02/2006.
What the heck can I do?
View Replies !
View Related
[CS3] Round Numbers To 2 Digits
hi there... i have a dynamic textbox that is populated by the user selecting an item from a combobox... everything works fine except i would like my numbers to have 2 decimal places (like: 4.00, instead of just 4)
i see there's lots of stuff online concerning this and Actionscript 3, but i've coded the entire work in Actionscript 2 and can't change it...
the closest thing i have now that makes any sense to me (even though it doesn't work) is something like this:
Code:
_root.MC1.DynamicField = 9;
var num = _root.MC1.DynamicField;
var str = num.toFixed(2);
any thoughts?
View Replies !
View Related
Limit The Digits. 1.392846 To 1.392
I want to limit a numbers length without rounding cieling or flooring it. I want to cut off the last digits.
For example:
1.83251931
I want as:
1.83251
It's for a simple math game. The user must input an answer, and I will frustrate them if is I round the solution.
Math.round(number*1000)/1000;
is the closest I have to limiting the values, but round is bad.
View Replies !
View Related
Split Digits Of Array
Hi guys,
i got a serious problem here.
Tomorrow i got to deliver my project for school, but i got into a problem.
I have this array :
a[0] = _root.spelen22
a[1] = _root.boom49
a[2] = _root.huis6
etc
I want to split the digits off from this array. It can be 1 or 2 digits. so that i keep an array like this :
b[0] = _root.spelen
b[1] = _root.boom
b[2] = _root.huis
Hope that you can give me some help soon , im desperate
Thanx for the help !
Madthijs
View Replies !
View Related
Adding Two Numbers(digits)
Hello. I have to input text fields and third - dynamic. Also I have a button. I want that on button press in the dynamic field would be displayed the sum of two numbers entered in those input fields. First field: var1 Second: var2
and dynamic text: answer.
I wrote scipt but look what happens. For example I input to numbers: 5 and 6 I need to get answer 11 but the sum is shown: 56 . Any help? Thanks.
View Replies !
View Related
Adding Two Numbers(digits)
Hello. I have to input text fields and third - dynamic. Also I have a button. I want that on button press in the dynamic field would be displayed the sum of two numbers entered in those input fields. First field: var1 Second: var2
and dynamic text: answer.
I wrote scipt but look what happens. For example I input to numbers: 5 and 6 I need to get answer 11 but the sum is shown: 56 . Any help? Thanks.
View Replies !
View Related
Displaying Value Of Variable As 7 Digits
I have made a simple counter in flash that updates live via a php-file that writes to a txt-file. The variable "count" is used to import the number from the txt-file into a dynamic textfield in flash with:
this.loadVariables("count.txt?num="+random(999));
The counter works fine but I want the counter to always display 7 digits, for example 0000025 instead of just 25. This should be fairly simple but I don't know how or if it should be done in flash or php as I am fairly new to both. I am working in flash 8 btw.
Can anyone lend a hand?
View Replies !
View Related
Checking Whether An Object Has Two Or Three Digits
hi forum...i have a question..
i duplicated a movieclip many times, and now i need to know how many digits are set at the end, because i use the endings of each movieclip to an array.
with two digits it works fine, i did it this way, but i wont work of course with three digits.
this is what i put on a button:
ActionScript Code:
_root.point1=this._name.substr(["box"+y+x]._name.length-2,1)
_root.point2=this._name.substr(["box"+y+x]._name.length-1)
_root.control.myArray[_root.point1][_root.point2]=0;
can anyone tellme how to do this?
the boxes are numbered from "box00" to "box063"
thanks
sinai
View Replies !
View Related
Seperating Digits Using Flash Substrings
Hello All.
I am trying to retrieve data from a server and display it in a font that does not space dynamically the way that my boss, the art director wants it to look. The server will send me 2 and three digit numbers thaty need to be displayed, but because of graphical issues, each digit (first, second, or third) needs to be placed in different dynamic text boxes. I asked the programmer to break up the number in asp and send it as three different variables for me to rearrange in flash but this is a no go. SO i need someone to show me how to "seperate the digits using substings" any takers?
any help would be appreciated.
thanks.
View Replies !
View Related
[MX] Detecting 5 Digits In Input Field
Hi all,
I've been noticing users are submitting my form without entering information.
With my limited action scripting knowledge I've been unable to script in a way to check input fields before activating the submit button.
I searched all over google for tutorials and couldn’t find any that has answers to my problems.
If someone with a lot of time wants to help for free, thats always welcome
Edit by admin: no contact info permitted on the forum, thank you. If you want to hire someone, we will move to the freelance forum
View Replies !
View Related
MP3 Player, Trouble Displaying 2 Digits
Hi,
I'm new here so please go easy on me
I looked you up for a question regarding a Mp3 jukebox type thingie. It's going quite well (I'm redesigning it for educational purposes). But.. I'm having difficulties displaying two digits. You know, when Flash goes below 9 it's not 09 anymore..
I've tried other scripts and tutorials out there to fix it, but without luck. Any help would be appreciated.
The time related coding appears in three places:
ActionScript Code:
nbstot = (_level1._totalframes)/12;
nbseco = (_level1._currentframe)/12;
nbsleft = nbstot-nbseco;
time_left = int(nbsleft/60)+" : "+int(nbsleft-(int(nbsleft/60))*60)+" ";
ActionScript Code:
if (nbsleft == none) {
} else {
nbstot = (_level1._totalframes)/12;
nbseco = (_level1._currentframe)/12;
nbsleft = nbstot-nbseco;
time_left = int(nbsleft/60)+" : "+int(nbsleft-(int(nbsleft/60))*60)+" ";
}
ActionScript Code:
nbstot = (_level1._totalframes)/12;
nbseco = (_level1._currentframe)/12;
nbsleft = nbstot-nbseco;
time_left = int(nbsleft/60)+" : "+int(nbsleft-(int(nbsleft/60))*60)+" ";
if (cge == 1) {
if (loop == 0) {
unloadMovieNum(1);
loadMovieNum("./movie" + i +".swf", 1);
titre_chanson = eval ("titre" + i);
}
if (loop < 3) {
loop = loop + 1;
gotoAndPlay(21);
} else {
cge = 0;
loop = 0;
gotoAndPlay(20);
}
} else {
gotoAndPlay(20);
}
Best regards,
Marius.
View Replies !
View Related
Checking User Input To Limit To Certain Digits
I'm doing a simple binary converter where I want only the digits 1 and 0 input into a box.
Everything works great except I need to check the string (from the input text box) to make sure it's only 1's and 0's. The check is performed when they click on the convert button.
I can do this in other languages using regular expressions, which ActionScript doesn't seem to have, so what's the best way to check user input to limit it to specific characters?
Keep in mind the string can be up to 40 characters long, so manually checking each digit would probably be inefficient.
Do I need to use substring for this?
Thanks.
John
View Replies !
View Related
Controlling The Odds Of Math.floor(Math.random()
Hey,
Is there a way to set a random number in a array to showup maybe once a day. Or every 5000 views or loops, or something like that. I would love to be able to control the odds of a array. Cheers!
ActionScript Code:
var pic_array = new Array();
pic_array[0] = "images/1";
pic_array[1] = "images/2";
pic_array[2] = "images/3";
pic_array[3] = "images/4";
pic_array[4] = "images/5";
pic_array[5] = "images/6";
pic_array[6] = "images/7";
pic_array[7] = "images/8";
pic_array[8] = "images/9";
pic_array[9] = "images/10";
pic_array[10] = "images/11";
pic_array[11] = "images/12";
pic_array[12] = "images/13";
pic_array[13] = "images/14";
ranNum = Math.floor(Math.random()*pic_array.length);
holder_mc.loadMovie(pic_array[ranNum]+".jpg");
View Replies !
View Related
Setting Dynamic Number To 3 Digits? Hard To Explain...
Howdy howdy!
Quick and hopefully simple question. I've got a dynamic text box named "course" and this box is set at a certain number at the start of my movie. As the user hits buttons, this number increases or decreases.
I have on my buttons that if course > 359, it goes back to 0. (Can't have more than 360 degrees right?) This works fine.
Anyway, just found out this number can't go back to 0, it has to go to 000, and count up 001, 002, 003,... etc.
Is there a simple way to do this? I can't figure it out. I can't get it to display the three 0's at all.
Thanks so much in advance. Hope someone can help!
View Replies !
View Related
Index Xml Target.name.length And Double-digits Issue
I have an issue, I have about 25 mc's that are named carBtn1 through carBtn25 - the problem is when I index my array - its only taking the first number from the end of the carBtn, so carBtn1 is seen as the same as carBtn10. I tried taking the last 2 digits off which works for 2 digit numbers - but everything below 10 isnt working anymore. Im not sure what to do to get it working....
Here is my code:
Code:
// variables
var popInfo:popMc;
// load xml
var xml:XML = new XML();
var loader:URLLoader = new URLLoader();
loader.load(new URLRequest("data/cities.xml"));
loader.addEventListener(Event.COMPLETE,
function(evt:Event):void {
xml = XML(evt.target.data);
//trace(xml.city[0].@weburl.toString());
var url:URLRequest = new URLRequest(xml.city[0].@weburl.toString());
}
);
// event listeners
stage.addEventListener(MouseEvent.CLICK, onClickStageRemove);
for (var j:int = 0; j < 11; j++)
{
getChildByName("carBtn" + j).addEventListener(MouseEvent.CLICK, onClickLoadData);
getChildByName("carBtn" + j).addEventListener(MouseEvent.MOUSE_OVER, onCarHover);
getChildByName("carBtn" + j).addEventListener(MouseEvent.MOUSE_OUT, onCarOut);
}
// button mode
buttonMode = true;
// functions
function onCarHover(event:MouseEvent):void
{
event.target.gotoAndPlay(11);
}
function onCarOut(event:MouseEvent):void
{
event.target.gotoAndPlay(10);
}
function onClickLoadData(event:MouseEvent):void
{
popInfo = new popMc();
popInfo.x = 100;
popInfo.y = 50;
addChild(popInfo);
popInfo.closeBtn.addEventListener(MouseEvent.CLICK , onClickRemove);
popInfo.nyopBtn.addEventListener(MouseEvent.CLICK, onClickNYOP);
//better approach would be add separate classFile to haldle some popInfo's events
//such removing on stageClick in that file u could add those functions:
var index:Number=event.target.name.slice(event.target.name.length-1);
popInfo.carsizeText.text = xml.city[index].bidlist.carsize.descendants().toXMLString();
popInfo.priceText.text = xml.city[index].bidlist.price.descendants().toXMLString();
popInfo.savingsText.text = xml.city[index].bidlist.savings.descendants().toXMLString();
popInfo.stateText.text = xml.city[index].@name.toString();
addChild(popInfo);
}
function onClickRemove(event:MouseEvent):void
{
popInfo.closeBtn.removeEventListener(MouseEvent.CLICK, onClickRemove);
popInfo.nyopBtn.removeEventListener(MouseEvent.CLICK, onClickNYOP);
removeChild(popInfo);
}
function onClickStageRemove(event:MouseEvent):void
{
if(event.eventPhase == EventPhase.AT_TARGET) {
removeChild(popInfo);
}
}
function onClickNYOP(event:MouseEvent):void
{
//navigateToURL(url, "_blank");
// navigateToURL(urlNY, "_blank"); //trying to get this variable to work
ExternalInterface.call("selectNY");
}
// set button mode here
View Replies !
View Related
Index Xml Target.name.length And Double-digits Issue
I have an issue, I have about 25 mc's that are named carBtn1 through carBtn25 - the problem is when I index my array - its only taking the first number from the end of the carBtn, so carBtn1 is seen as the same as carBtn10. I tried taking the last 2 digits off which works for 2 digit numbers - but everything below 10 isnt working anymore. Im not sure what to do to get it working....
Here is my code:
Code:
// variables
var popInfo:popMc;
// load xml
var xml:XML = new XML();
var loader:URLLoader = new URLLoader();
loader.load(new URLRequest("data/cities.xml"));
loader.addEventListener(Event.COMPLETE,
function(evt:Event):void {
xml = XML(evt.target.data);
//trace(xml.city[0].@weburl.toString());
var url:URLRequest = new URLRequest(xml.city[0].@weburl.toString());
}
);
// event listeners
stage.addEventListener(MouseEvent.CLICK, onClickStageRemove);
for (var j:int = 0; j < 11; j++)
{
getChildByName("carBtn" + j).addEventListener(MouseEvent.CLICK, onClickLoadData);
getChildByName("carBtn" + j).addEventListener(MouseEvent.MOUSE_OVER, onCarHover);
getChildByName("carBtn" + j).addEventListener(MouseEvent.MOUSE_OUT, onCarOut);
}
// button mode
buttonMode = true;
// functions
function onCarHover(event:MouseEvent):void
{
event.target.gotoAndPlay(11);
}
function onCarOut(event:MouseEvent):void
{
event.target.gotoAndPlay(10);
}
function onClickLoadData(event:MouseEvent):void
{
popInfo = new popMc();
popInfo.x = 100;
popInfo.y = 50;
addChild(popInfo);
popInfo.closeBtn.addEventListener(MouseEvent.CLICK , onClickRemove);
popInfo.nyopBtn.addEventListener(MouseEvent.CLICK, onClickNYOP);
//better approach would be add separate classFile to haldle some popInfo's events
//such removing on stageClick in that file u could add those functions:
var index:Number=event.target.name.slice(event.target.name.length-1);
popInfo.carsizeText.text = xml.city[index].bidlist.carsize.descendants().toXMLString();
popInfo.priceText.text = xml.city[index].bidlist.price.descendants().toXMLString();
popInfo.savingsText.text = xml.city[index].bidlist.savings.descendants().toXMLString();
popInfo.stateText.text = xml.city[index].@name.toString();
addChild(popInfo);
}
function onClickRemove(event:MouseEvent):void
{
popInfo.closeBtn.removeEventListener(MouseEvent.CLICK, onClickRemove);
popInfo.nyopBtn.removeEventListener(MouseEvent.CLICK, onClickNYOP);
removeChild(popInfo);
}
function onClickStageRemove(event:MouseEvent):void
{
if(event.eventPhase == EventPhase.AT_TARGET) {
removeChild(popInfo);
}
}
function onClickNYOP(event:MouseEvent):void
{
//navigateToURL(url, "_blank");
// navigateToURL(urlNY, "_blank"); //trying to get this variable to work
ExternalInterface.call("selectNY");
}
// set button mode here
View Replies !
View Related
Adding 3 Months To The Date Object (and GetFullYear Displaying Last Two Digits)
I'm currently working on a simple project displaying a date and I've got this so far:
myDate = new Date();
dd = myDate.getDate();
mm = myDate.getMonth() + 1;
yyyy = myDate.getFullYear();
textdate = (mm+"/"+dd+"/"+yyyy);
Works great. Displays proper date like 6/20/2006.
However, here's where things get interesting. Clients wants date to display 3 months into the future. Now sure, I could just use myDate.getMonth() + 4 and it'll work. Sort of. Of course, what if it's 3/31 and since there's no 6/31, that'll look kind of stupid. So what's the workaround for this? Got to be something.
Also, any idea how I can just make the year display as '06' instead of '2006'?
View Replies !
View Related
MATH: General Math Ratio Formula?
So I have these sets of values that correspond with other values. But the manufacturer only gave me sets by 5. I need to break it out for every integer. Here's what I got ...
Code:
20=35
25=54
30=78
35=106
40=138
45=175
50=216
55=261
60=310
My question is how do I develop a formula in Flash that can give me values for numbers not divisible by 5? Accuracy to the nth power, figuratively speaking, isn't crucial.
Big thanks,
Layne
View Replies !
View Related
Math.ceil Ll Math.floor
Hi there,
I have code to dynamictween my mc's.Works great.I only need the if statement to work so when my square reaches it's new size and position I can load in my content using a holder.Can someone help me out on this if statement.
and instead off scaling the holder,etc I want to control it's xy position when hitting but0,...
but0.onRelease = function()
{
_root.square.dynTween({duration:6, _y:[350, "In", 60], _yscale:[200, "out", 5], callback:"_root.action1"});
if (Math.ceil(this._dynTween) == Math.ceil(_root.square) || Math.floor(this._dynTween) == Math.floor(_root.square)) {
if (_root.squareTrigger == 1) {
if (_root.squareLoaded == undefined)
_root.square.squareHolder.loadMovie("content0.swf" );
_root.square.squareHolder._xscale = 33;
_root.square.squareHolder._yscale = 33;
_root.square.squareHolder._x += 35;
_root.square.squareHolder._y += 35;
_root.squareLoaded = 1;
}
_root.square.squareHolder._visible = true;
_root.squareTrigger = 1;
}
}
}
Grtz,
View Replies !
View Related
|