ActionScript 2.0 :: Negative Numbers - Counting Down From 9999 Instead Of Beginning At -0001?

Jan 30, 2011

I am currently taking a value from another source and splitting it into Thousands / Hundreds / Tens / Ones to drive MC's containing images of numbers. Originally I was using this external value to drive a dynamic text box and that was absolutely fine. When the external value went below zero the dynamic text box reflected this and started counting downwards ie 0 -1, -2, -3 ......-100 etc etc. However with the system I am now trying to implement when the external value goes below zero my counters show 9999 and count down towards zero.

For example the actual value of the external value = -32 but my counter system is showing 968. Always the sum of the actual value and my counter value = 1000. So again maybe actual value is -160 but my counter shows 840.Below is the section of the script splitting the external value (roundelevation) into 1000/100/10/1's

Code:
roundelevation = Math.round(scaledelevationMils);
EliThous = Math.floor(roundelevation / 1000);
EliHund = Math.floor(roundelevation / 100) - 10 * EliThous;
EliTen = Math.floor(roundelevation / 10) - 100 * EliThous - 10 * EliHund;
EliOne = Math.floor(roundelevation) - 1000 * EliThous - 100 * EliHund - 10 * EliTen;

I am using these variables (EliThous / Elihund) etc to move to different frames of mc's inside the Mc's each frame is an image of a number.It works absolutely perfectly when the external value is above zero and my counter is counting upwards / downwards. However as soon as it begins having to deal with the external value being a negative number it begins counting down from 9999 instead of beginning at -0001 and counting -0002.how to make this work when dealing with a negative input value and I really don't want to have to go back to using the font and dynamic text box approach.

View 4 Replies


Similar Posts:


Flash - Fastest Way To Get Negative Numbers?

Jun 10, 2011

Is there any Fastest way for this line?
ballAngelRadianVector = -ballAngelRadianVector;
And also this:
ballDegree = fee - ballDegree ;

View 1 Replies

ActionScript 2.0 :: Positive To Negative Numbers?

Jan 19, 2007

Whats the best way to flip variable:Number polarity from + to - and back.Is there an actual method, or do you just assign the var to itself...eg...

speed = 5;
speed = -speed

View 2 Replies

ActionScript 3.0 :: Test For Negative Or Positive Numbers?

Nov 9, 2009

Is there a way to test if a number is negative or positive.I have some clips that position themselves on and off the stage. IF one moves in the other moves out the same direction the other is moving in. This also works the same in reverse. I'm trying to do this by checking the current clips position and see if its a negative or positive number. If its a positive then I can move it onto the stage and move the other off in the same direction. Maybe there is another way of doing this but I thought if I could check its value and see if its negative or positive it would be a start.

View 5 Replies

ActionScript 1/2 :: Rotation Positive And Negative Numbers?

May 12, 2009

I am creating a roulette type game that calculates the winning number based on the rotation of the main wheel. I am using if/else statements to determine the winning number based on the rotation. I am tracing the rotation in the output panel. I would like my rotation to go from 0-360, but the output panel traces 0-180 then it starts counting from "-180-0"
 
The wheel can spin multiple times. how to keep the numbers positive from 0-360 and not have to write my if else to accomodate the negative numbers?

View 5 Replies

ActionScript 3.0 :: Random Negative And Positive Numbers?

Feb 10, 2009

How can I create random numbers (negative and positive) ?Math.random() only produces numbers between 0 and 1.

View 2 Replies

ActionScript 2.0 :: Reversing Negative And Positive Numbers

Jul 9, 2009

I have a function set up to determine the speed of the mouse, if the mouse is moved to the left it is returned as a variable in a negative number. I also have a function to make a movie clip scroll along, at the moment if you set the speed to 3 it will move to the left. So a positive number will move the movieclip to the left So you can see my predicament because the numbers are opposite, is there way of reversing one of them?
Here it is in short

[Code]....

View 1 Replies

ActionScript 3.0 :: Finding An Angle - Get Rid Of The Negative Numbers?

Jun 2, 2009

I have an object that moves to wherever the mouse is clicked, I need to be able to determine the angle at which it is moving like so

[Code]....

View 2 Replies

ActionScript 3.0 :: Negative Numbers As Target-value Of A Tween

Dec 13, 2010

I'm not sure if if this has occurred to anyone before.... I'm using the built in tween-class of flash (cs4). In my script I try to display a notification-box using a slide-in effect: var slideIn = new Tween(this.warningBox, "width", Regular.easeOut, 0, 150, 0.5, true); This works. The box is invisible at start and then builds up like a flag unrolling from left to right. However, what I really want to do is sliding it in from right to left. So I tried to do this: var slideIn = new Tween(this.warningBox, "width", Regular.easeOut, 0, -150, 0.5, true); Obviously, I modified the warningbox so the pivot point is to the top right, but it still won't work. It seems the endvalue must not be a negative number. Can anyone confirm this, or have I missed something?

View 3 Replies

ActionScript 2.0 :: Sort Array Correctly With Negative Numbers?

Jan 17, 2010

I'm Trying to sort an array firstly with QUANTITY then STOCK LEVEL using the code below. This is fine, the Quantity sorts perfectly but the negative numbers are reversed??

[Code]...

View 0 Replies

ActionScript 3.0 :: Generate Random Negative And Positive Numbers?

Mar 11, 2009

How can I generate random negative and positive numbers?

math.random generates only positive ones.

View 3 Replies

ActionScript 2.0 :: [F8] Adding Numbers To The Beginning Of A Variable

Feb 18, 2009

Basically, I have an input box on a widget that sends information via PHP.

One of the input boxes is phone number. Everyone inputs number as normal, but without the country code.

Is there a way of me taking their normal number from the input box, removing the '0' and adding the country code before sending it (i.e. within a calculation/function/formula).

View 1 Replies

ActionScript 2.0 :: Counting Numbers [MX] In A Dynamic Text Box

Mar 12, 2004

I have a counting movie which displays numbers from 1 to 1000 (action scripts) in a dynamic text box. First 1 and then 2 and so on. It works very well. I convert this movie to a movie clip and drag this new movie clip to the main stage on frame 1, but anything happens now.

View 14 Replies

ActionScript 2.0 :: Find The Frame Numbers Of Beginning And End Of A Layer?

Sep 17, 2009

How can I find out the frame numbers of the beginning and end of a layer (with content) without actually going there? It would be a lot of work if I manually enter them and have to revise again when frames are different due to content change. Can I get a list of all the frame numbers of the first frames of all the labels in a movie?

View 0 Replies

ActionScript 2.0 :: Counting Movie Which Displays Numbers From 1 To 1000?

Mar 12, 2004

I have a counting movie which displays numbers from 1 to 1000 (action scripts) in a dynamic text box. First 1 and then 2 and so on. It works very well. I convert this movie to a movie clip and drag this new movie clip to the main stage on frame 1, but anything happens now.

View 14 Replies

ActionScript 2.0 :: Script That Show Numbers Counting To A Certain Number

Apr 22, 2005

Im trying to make a script that show numbers counting to a certain number. Need some help. I want to start at 0 and then counting up to for example 52.

View 3 Replies

ActionScript 2.0 :: Make A Script That Show Numbers Counting To A Certain Number?

Apr 22, 2005

Im trying to make a script that show numbers counting to a certain number.I want to start at 0 and then counting up to for example 52.

View 4 Replies

ActionScript 3.0 :: Check If A Negative Number Is Less Than Another Negative Number?

Jul 17, 2011

check if a negative number is less than another negative number. The if condition logic seems to be in order as far as i can tell but it doesent work for some reason :

Code:
public function minuscheck(testnumber:int):void
{
if (testnumber < -1)

[code]....

View 6 Replies

Actionscript 3.0 :: Counting Down Instead Of Counting Up

Jan 15, 2009

I created a timer with found tutorials and the Flash help files and everything works fine. My timer counts up from 000.000,0 to 999.000,0. Now I would like to also be able to do the same, but counting down from 999.000,0 to 000.000,0
Easy enough I thought, but now . how to make some modifications in my code to count down.

My code for counting up is the follow:

Code: Select allvar hours:Number = 0;
var seconds:Number = 0;
var minutes:Number = 0;
var pauseTime:Number = 0;

[Code].....

View 2 Replies

ActionScript 2.0 :: Generate A Variable Number Of Random Numbers Less Than 16 With No Duplicate Numbers

Nov 2, 2004

how to do this and not found much, so here goes:

I want to generate a variable number of random numbers less than 16 with no duplicate numbers

Ive posted the fla, and what i'm doing is generating a random number and putting it into an array then using a for loop to cycle through the array for each new random number to check if its already there. if it is, then i want to regenerate that number.

if you test the fla you'll see that all i get in my array is some lovely zero's and i sort of know why this is, but don't know how to stop it.

View 3 Replies

ActionScript 3.0 :: AIR Handling Large Numbers - Convert A String Having Numbers To An Integer

Feb 18, 2010

I am trying to convert a string having numbers to an integer.

//15 9's are there
var str:String="999999999999999"
var res:Number = new Number(str);

But it is not able to convert correctly as the the var res now has the value 100000000000000000. I know that the number has 52 bits of memory, then why is it not able to do the conversion?

View 6 Replies

ActionScript 3.0 :: Generate Four Random Numbers With Total Of 4 Numbers Equal To 100?

Feb 19, 2011

Generate four random numbers with the total of the four numbers equal to100?[code]...

View 8 Replies

ActionScript 3.0 :: Creating Function To Pick Out Numbers From A Set Of Numbers?

Nov 18, 2009

create a function that picks out X amount of numbers from a set of numbers? So if X=3, then i need this function to pick out 3 different numbers from say a set of numbers (1, 2, 3, 4, 5, 6, 7, 8) and then stored it into X number of variables.

In saying that, X will only =2, and =5. So in the first instance, i'll need 2 random numbers from the set above that are not the same numbers, and second instance 5 random numbers from the set above (also no repeats of numbers). Then i need to be able to store those 2 or 5 different random numbers from the set into variables to call them with other functions.

View 2 Replies

ActionScript 2.0 :: Pick 6 Random Numbers From 49 Numbers?

Aug 18, 2010

what is the syntax to pick how can i pick 6 random numbers from 49 numbers

View 9 Replies

ActionScript 3.0 :: Generating Random Numbers Between Two Numbers?

Apr 1, 2011

I am generating random numbers between two numbers by the code bellow:

ActionScript Code:
public function randomRange(max:Number, min:Number = 0):Number
{
return Math.round(Math.random() * (1+max - min) + min);
}
trace(randomRange(3,-31));

But I need a code which will return some times '3' and some times '-31'. Not the number between them.

View 2 Replies

ActionScript 3.0 :: Adding Up Odd Numbers From An Array Of Numbers?

Mar 7, 2012

I have been using Actionscript 3.0 in Adobe Flash Builder for a few weeks,and I really like it! Bare with me because I'm not really good at it, yet. Anyway, I was wondering how would I go by adding up odd numbers from an array of numbers? I know how to make all of the numbers add up, but adding only the odd numbers I'm not so sure how to do it.

View 5 Replies

ActionScript 3.0 :: If Object.x < Negative Value

Dec 29, 2011

Im using swipe on my android app and would like to define the boundary. But the container is a LOT bigger then the stage and will reach a negative value. How would I setup my if statement for this?

View 13 Replies

ActionScript 2.0 :: Change Number To Negative?

Jan 25, 2009

how to turn a variable number from positive to negetive using AS2? eg:

Code:
myVar1 = 40;
//use code to change to negetive number
myVar1 = -40;

View 4 Replies

ActionScript 3.0 :: How To Get (or Compute) The Negative Color

Aug 23, 2009

i have a label object.The background is in a color (set by user)The background color is in the format HTML (#FF4466 by example)I want to change automatic the color of the text inside, but i want the color make the text visible ! don't want a red font on red background!so i thought about the negative filter we have in picture program like photoshop, paintshop..etc. This effect return the opposite color

View 2 Replies

Html :: Is There A Negative For Courier New Font

Apr 11, 2010

I want to make a text highlight in flex textArea but its htmlText doesn't support <font bgcolor='#FFFF00'> part of my text </font> so I'm searching for a font witch is the opposite of Courier new, when I embed it in flash, and write with that color I get highlight effect for that part of my text , as I type <font family="negativeOfCourier" color='#FFFF00'> part of my text </font>

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved