ActionScript 3.0 :: Limit Numbers On Display For Flash Calculator?
Mar 16, 2012done
View 4 Repliesdone
View 4 Repliesim making a flash calculator and ive nearly finished ive got one last thing i need to do and thats limit the amount of numbers i can enter to 10
[Code]...
Limit amount of numbers in display?
View 9 RepliesI have a BMI calculator that is currently working well, however when calculated, gives a VERY precise result of:Your BMI is: 24.343121332458201.I'd like it to round up/down so it just displays:[code]
View 2 RepliesI am working a calculator with a textfield. It can calculate a if a enter only one number, but when I try to enter two or three doesnt work. I have test several codes but they are not working at all.
var numeroEntrado = "";
var campoUno:int = 125;var campoDos:int = 20;var elResultado1 = 0;var elResultado2 = 0;
proteinas.text = "125 grs.";colesterol.text = "20 mml.";colesterol.backgroundColor = 0x9999FF;textoColesterol.backgroundColor = 0x9999FF;
numeroPorciones.maxChars = 3;numeroPorciones.restrict = "0-9";
btn.addEventListener(MouseEvent.MOUSE_UP, suma);
[Code] .....
I have a BMI calculator that is currently working well, however when calculated, gives a VERY precise result of:Your BMI is: 24.343121332458201I'd like it to round up/down so it just displays:Your BMI is: 24.3
Code:
var totalHeight:Number;
var totalHeightx2:Number;
[code].....
I have a flash movie in which I've created something that functions similarly to a calculator. When the user clicks a button, depending which button was pressed and in which order, a series of movie clips is displayed from left to right in specific positions, using addChild. I have a button on the calculator which I would like to have function similarly to a 'clear' button on a real calculator. When clicked, it would remove only the movie clips that were displayed by clicking the calculator buttons. how I can remove only the movieclips that are part of the calculator display? Here are some
code samples.
var mcSelection:MovieClip = new MovieClip();
//check to see how many times a calculator button was clicked
function checkTime()
{
[Code].....
I've tried different variations of removeChild and removeChildAt, but either parts of the calculator are getting removed, or I remove the parts of the display one clip at a time instead of all together, or I get out of range errors. How do I target a certain range of movieclips to remove? Do I need to assign a specific range of levels when the new movieclips are added and then remove that range? It will be different number of clips and combination of clips every time.
I have an external swf I am loading. It is a text scroller, and part of the way it works is that it moves the text up or down off the top or bottom of the stage when it scrolls.Unfortunately when I load it in a master swf, the guts of the thing are showing through, spilling outside of the intended boundaries of the included swf. (i.e. outside the included swf's stage height).
View 1 RepliesI recently wrote a small script to display an endless scroll for 360 degree images. The image is loaded dinamically so I can use it as a viewer for all the 360 degree images in the site's gallery. It works fine, but I found one image that appears truncated even though everything else works as expected. I found this [URL] that says: The maximum image size of a Flash 2 movie is 2880 x 2880 pixels The image that is giving me this problem is larger than that and it seems to be cut at 2880px widht. Can anyone confirm this? And if so, is there any way to override it since I'm using pure as? Despite the years working with flash, I keep finding these nasty surprises. Last time I learned about the 16,000 frame limit when working on a cd presentation... I wonder what's next.
View 2 RepliesI have a text field that displays a number from a variable. How can I make it so this number is always formatted to 2 decimal places?
For example, 1 would be changed to 1.00 and 1.5 would be 1.50, etc.
My question is how to make 2 input text fileds(numbers) and one dynamic text field which will display result of sum of that 2 input textfields(numbers)?"FirstInputTextField+SecondInputTextField = display Sum in dynamic text field"
View 6 RepliesI have drawn a textfield (instance name - my_Text) onto the stage. In my actions I have a variable (called 'myFrame') which is an 'int' and the value is a number drawn from an xml feed. Now when I trace the variable 'trace(myFrame)' the correct number displays into the output window. However, when I try to display this variable, using 'myText.text = myFrame', an error occurs. How do I display this integer into a textfield?
View 2 RepliesI have a textfield (the one that shows ammo) that doesent display all numbers. U have uploaded the swf. The code that I used to make the textfiled display some text is:
ActionScript Code:
function checkAmmo(e:Event){
var percentAmmo:Number = curAmmoInClipFirst/clipSizeWep1*100;
if (curAmmoInClipFirst >= 0){
trace(curAmmoInClipFirst);
ammoLeftBar.bar.scaleY = percentAmmo/100
} else {
Char.reloadGun();
} ammoLeftBar.ammoLeftNumber.text = curAmmoInClipFirst.toString() + " / " + clipSizeWep1.toString();
}}}
Which is triggered onEnterFrame.
I am working on a maths game which involves generating some large numbers in AS3. When I pass these numbers into a textbox they appear as e.g. 300000, I would like them to appear as 300,000.Is it possible to format a text box to do this?
View 1 RepliesI am trying to take and XML string and then display the numbers individually. Below is my Actionscript followed by my XML.
import fl.controls.*;
var digit01_xml:XML;
var xmlReq:URLRequest = new URLRequest("testRBS.xml");
var xmlLoader:URLLoader = new URLLoader();
function xmlLoaded(event:Event):void{
[Code] .....
I want to use a dynamic text field to display the numbers, but have a few buttons that go with them.I want to be able to press the button, and a set time is generated in the dynamic txt field, i.e. 10 minutes, 15 minutes & 30 minutes. the user will press 30 minutes, then start, then the countdown will commence, and same for the other time increments.
View 1 RepliesHow do I make it so that my timer does not display the decimal places when it increments by .10? I only want to see whole numbers...
View 6 RepliesI just need to display Numbers as well as in Words also in the Text field.
For example
99999 - NINETY NINE THOUSAND NINE HUNDRED AND NINETY NINE
for this i plan to use Array
like seperate the given numbers to array ([9][9][9][9][9])
then convert these number in words
I'm working on a flash thing that just has three boxes, each with a different # in it. By clicking the box it will turn red or green, and below it will display the sum of all the green boxes. This is really just a test kind of for a bigger project that I have to do for work. Basically it all works except for the summing part, which I believe has something to do with the fact that it is in a function, but I could be way off.
[Code]....
Here is my code to create a string like this:1-xxxxxxxxxx (where x is a random number)I'd like to display this number on subsequent frames using the same dynamic test field (feedback_txt).How would I create a variable which would hold the random number? How would I display the code on the subsequent frame so the string would display?
var myNum1:Number = Math.round(Math.random()*9);
var myNum2:Number = Math.round(Math.random()*9);
var myNum3:Number = Math.round(Math.random()*9);
[code].....
I have recently had the idea to create a lottery draw, the code below will create 7 randomly selected numbers and place these in the output window.My problem is how to use the 7 random numbers to display the corresponding lottoball on the stage.Should I create a movie for each lootoball or place all the lottoballs in 1 movie on seperate frames and have code goto each frame?
pickfrom = new Array();
winlist = new Array();
all = 49;//49 lottoballs the choose from[code].....
We are developing a dynamic image slide show which display images dynamically from XML data. We need display the numbers like (1 2 3 4 5 ) from the xml file as per the number of records for images with hyperlinks to their corresponding images. (We also need to display 10 numbers at a time )
View 1 RepliesThe preloader works perfect but I would like it to display text instead of numbers as it loads. So it would be like "one, two, three, four,...." What do I need to do?Code is below
onClipEvent (enterFrame) {
total = Math.round(_root.getBytesTotal()+_root.holder_mc.g etBytesTotal())/1024;
loaded = Math.round(_root.getBytesLoaded()+_root.holder_mc. getBytesLoaded())/1024;[code]......
I've been asked to make a flash countdown timer. I want to use a dynamic text field to display the numbers, but have a few buttons that go with them. I want to be able to press the button, and a set time is generated in the dynamic txt field, i.e. 10 minutes, 15 minutes & 30 minutes. The idea is that the user will press 30 minutes, then start, then the countdown will commence, and same for the other time increments.
View 3 RepliesI ran in to a problem I could not solve for a very long time While I was using Actionscript 3 in order to change the text of a classic text object in my .fla flash file, I did not see any change in my text field, and noticed that it doesn't display any numbers and some other characters (just some specific letters DID work).
View 1 RepliesLooking for a readymade flash calculator.I need that as a movie clip.
View 1 RepliesLooking for a readymade flash calculator. Any body has done before or willing to do a simple flash calculator.I need that as a movie clip.
View 6 RepliesI need to know to create a calculator. By the way I'm using Flash 8 pro.
View 9 RepliesIs there a simple way of pressing a button on a flash calculator to calculate the square root (sqrt)? I cant find anything about it. for example
Code:
// Tangent of the angle in degree
function Dotan () {
if (display == 90) {
display = "Infinity";
[code]....
I'm in a Web Design class and atm, I'm working on chapter 8 of Flash CS5 case problem.I have to make a calculator. Can I just say that AS3 makes me frusterated? D:Anyway, after I finished what the book told me to do whilst getting confused in some areas, I got many compiler errors. I managed to get rid of them but in the end, my calculator isn't working, haha.
Here's the whole code:
import flash.events.MouseEvent;
calcTotal_btn.addEventListener(MouseEvent.CLICK, calculateTourCost);
function calculateTourCost(event:MouseEvent):void {
[code]....