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


Advertisements:










ActionScript 3.0 :: Display Only Two Digits After The Decimal Point In The Textfield?


How can I display only two digits after the decimal point in the textfield?


View 5 Replies (Posted: Oct 9, 2011 9:28 AM)

Sponsored Links:

Related Forum Messages For Flash category:
ActionScript 3.0 :: Parsing XML Data To Display Digits
I have a what I thought was a fairly simple scrolling number list (like a lotto ticker) and am trying to parse the XML data to display the digits for some reason I am having some trouble. Perhaps I could play the mc of the spinning numbers and then stop it and just import a number into a text field?

private function loadXML() : void {
var loader : XMLLoader = new XMLLoader();
loader.addEventListener(XMLLoaderEvent.COMPLETE, onXMLComplete, false, 0, true);
loader.addEventListener(XMLLoaderEvent.ERROR, xmlErrorHandler, false, 0, true);
loader.load("testRBS.xml"); //userStandingsXML.asp
[Code] .....

Posted: 10-08-2010, 03:16 AM

View 2 Replies!   View Related
Css :: Flex - Flip Down Digits Display Like Retro Clock?
I want to display a number in my app so that the digits are styled like a retro-style clock, where each digit looks like a flippable tag [URL]. I don't actually require any animation or effects.

Posted: Jul 17 10 at 2:54

View 1 Replies!   View Related
ActionScript 3.0 :: String.replace Digits With Other Digits?
anyone knows how (if at all possible) to do

string = string.replace(/([d]+)/g, int('$1') + 1))?

replacing 0 with 1,
223 with 224
etc

without writing a complex loop?

modEdit: Merged threads.

is it possible to replace patterns in a string, after performing simple math over them, like increasing all the numbers in a string by 1

string = string.replace(/([d]+)/g, int('$1') + 1))?

without writing a complex loop?

Posted: July 12th, 2010

View 4 Replies!   View Related
ActionScript 3.0 :: Decimal Point Regular Expression
I've got this regular expression for decimal points:

var decimalPattern:RegExp = /(d+)(.)(d+)/gi
var result:Object = decimalPattern.exec(equation)
var i:Number = 0

[Code]....

Why is my output when i trace the number array this

3.2
3.2,3,.,2

Posted: Oct 17, 2011 2:17 PM

View 1 Replies!   View Related
ActionScript 1/2 :: Round Decimal Point To Two Places?
I have been tasked with creating a custom "calculator" for a client that uses a specific equation. The client inputs data into two Input Text fields and the result shows up in a dynamic text field. Is there any way I can limit the number of decimal places to two? Here is my code (which works, except for the decimal issue):i function onCalculate(){one = Number(number_one);two = Number(number_two);result_1 = ((one / 4) * (65 / (1 - 0.25))) + ((two / 0.5) * (65 / (1 - 0.25)));}

Posted: Dec 30, 2011 1:53 AM

View 3 Replies!   View Related
ActionScript 2.0 :: Rounding Number To 2 Decimal Point?
what actionscript do i need to round off a number to 2 decimal points? i have this script which brings me the number but consisting of 8 digits!

digital = _root.val[0].substr(0,_root.val[0].indexOf("<br>"));
digital = Math.abs(digital);
trace(digital);

[Code].....

Posted: January 12th, 2004

View 1 Replies!   View Related
ActionScript 2.0 :: Evaluate The Decimal Point Of An Integer?
I need to evaluate the decimal point of an interger (bet u wouldn't of guessed that from the title eh?!)

So, im reading in XML for a thumbnail viewer, the viewer displays 5 thumbs per "page" so, i divide the total number of thumbs by 5.

Then i need to evaluate the number if it dosn't have a decimal point (ie, the total divides by 5 exactly) then that is the number of pages i need.

Then if the number does have a decimal 12.2, for instance i need to strip the 2. leaving 12, and then add one so the 2 images left go onto a new page.

Posted: September 30th, 2005

View 1 Replies!   View Related
Professional :: Restricting Decimal Point Positioning - Using Whole Pixel Numbers?
I've frequently come across the issue when placing a movieclip or bitmap, the resting position of said object will land on a decimal value, not a nice, full pixel value. For instance, I drag a movie clip into a scene and it lands on a position of: X: 27.2, Y: 56.9, when I'd like it to be X: 27, Y: 57.

Now, this wouldn't bother me as much if I were dealing only in vector shapes. I currently work as a developer in the videogame industry and often times, for optimization purposes, I need to use both bitmaps and vectors. Plus, as a UI designer, text is very important to use throughout a game's UI. If you notice, when a font gets placed in an in-between position related to pixels, the text becomes blurry looking in appearance (graphical elements around the text can also appear blurry when in between pixel values as well). This can make UI pages or HUDs look sloppy and unprofessional.

I've tried enabling snapping (including enabling the grid, setting the grid to 1x1 pixel, then enabling both pixel snapping and grid snapping), but nothing seems to help in getting objects to place on whole pixels. Yes, I can manually change pixel values to whole numbers (which I'm currently doing). But when you have to manually position 100 keys on a keyboard, it gets old pretty quick!

Posted: Mar 2, 2010 3:29 PM

View 5 Replies!   View Related
Actionscript 3 :: Round Some Numbers In Two Decimal Point And Run Into A Bizare Behavior
I am trying to round some numbers in two decimal point and I run into a bizare behavior.

[Code]...

Posted: Mar 27 at 10:13

View 1 Replies!   View Related
ActionScript 3.0 :: Converting Number To String - Searching Decimal Point
I am converting a number to string
var myResult : Number = 12.6789345
var myString : String ;
myString = String (myResult);
I am trying to search . (decimal point)
if ( myString.search("."){
}
But I am unable to get Result or unable to find " DOT ".

Posted: December 31st, 2011

View 3 Replies!   View Related
ActionScript 2.0 :: Display Last Zero In Decimal?
I want to display the last zero in my deciaml number for example 6.10 Actionscript rounds it off and displays 6.1

Posted: 02-12-2012, 06:57 PM

View 1 Replies!   View Related
ActionScript 3.0 :: Display Only Four Decimal Places?
How can I tell flash to use only four decimal places when a number is display in a textField?Something like this:2.2356 , 0.2538, 0.2968, 0.0001 etc. Instead of infinitenumbers:.23565985 , 0.2538486

Posted: February 15th, 2010

View 4 Replies!   View Related
ActionScript 3.0 :: Restrict TextField To 2 Numbers And 1 Decimal Place?
I am trying to restrict a TextField to 2 numbers and 1 decimal place, so something like: 3.5, 22, and 33.5 is acceptable.

Posted: 12-02-2010, 12:52 AM

View 5 Replies!   View Related
ActionScript 2.0 :: Display Number To 2 Decimal Places?
I am totally confused about this one. I am trying to display a number as x.xx, but I'm having problems! The number has 0, 1 or 2 decimal places, so I have an if else to add '0' or '.00' on the end if there are 1 or 0 decimal places respectively.[code]...

Posted: 09-13-2008, 12:54 PM

View 3 Replies!   View Related
IDE :: Timer To Display Only Whole Numbers - No Decimal Places
How 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...

Posted: August 31st, 2002

View 6 Replies!   View Related
ActionScript 3.0 :: Decimal Values For X And Y Properties Of Display Object
As far as I know, a pixel is a pixel. You can hardly move a DisplayObject half a pixel, can you? Still the x and y properties of a DisplayObject allow values with two decimals.

A small test..
PHP Code:
addEventListener(Event.ENTER_FRAME,enterFrameHandler);
functionenterFrameHandler(e:Event):void{
myDisplayObject.y=Number(myInputBox.text);
trace(myDisplayObject.y);
}

Shows that this happens in steps of five (0, 0.05, 0.1, 0.15, etc.).
Values like for example 0.16 get converted to 0.15.
Also, the object moves 1 pixel as soon as it's x/y value is .2
You would expect the x and y properties to convert the given numbers to integers, no?

Posted: February 13th, 2010

View 3 Replies!   View Related
ActionScript 2.0 :: Format Datagrid To Display Correct Decimal Value?
I am trying to format my datagrid column to display the decimal value of the price of the item they have chosen to (2) decimal places. Currently the datagrid is displaying $10 instead of $10.00 & $10.4 for $10.40?

Code:
import mx.controls.*;
import fl.controls.dataGridClasses.*;

[code].....

Posted: May 17th, 2010

View 8 Replies!   View Related
Actionscript 3 :: Display Html Format Text To Dynamic Textfield Work In Loacal , But Online Don't Display Text?
found that code to display html format text to dynamic textfield in as3:

var url:String = "http://edeejay.dyndns.org:8000/currentsong?sid=1";
var loadit:URLLoader = new URLLoader();
loadit.addEventListener(Event.COMPLETE, completeHandler);

[code].....

Posted: Feb 18 at 1:08

View 1 Replies!   View Related
Actionscript 3.0 :: How To Add Pictures To Caret Point In Textfield
I am trying to make a textfield that I can add a picture to the caret point -- the problem is that I don't know what the caret point is in the HTML text -- my technecue for dealing with it is to search out a string that is next to my caret point -- as you can imagine this has problems. Like if the caret point is next to a bold tag or if there is two of the strings -- so I was trying to see if anyone new a better way to add pictures to a textfield

index is the caret number
[flash=]
var mytextpic:DisplayObject
editor.do_btn.addEventListener(MouseEvent.CLICK, ADDPICK)
function ADDPICK(event:MouseEvent):void {
var inString:String
[Code] .....

Posted: Tue Jan 19, 2010 5:30 am

View 1 Replies!   View Related
FLV: Display Graphic/movieclip At Cue Point?
I have a FLV playing (via FLVPlayback component), and I'd like to have a graphic/movieclip display on top of the video at one of the cue points.

The video is a person speaking, and I'd like to have his name and title fade in when he says it.

Posted: 08-03-2009, 12:19 PM

View 1 Replies!   View Related
Display Graphic/movieclip At Cue Point
I have a FLV playing (via FLVPlayback component), and I'd like to have a graphic/movieclip display on top of the video at one of the cue points.

The video is a person speaking, and I'd like to have his name and title fade in when he says it.

Posted: August 3rd, 2009, 11:18 AM

View 3 Replies!   View Related
Actionscript 3 :: Point For Display Object X, Y?
Right now I have a point that I have to update with the x and y of a display object to use with the hitTestPoint object; is there any way I can get a point from a display object without having to make a new point var and continually update its x and y?

Posted: Mar 28 10 at 20:03

View 1 Replies!   View Related
Actionscript 3 :: Scale A Dynamic Textfield In Flash From The Center Point?
I'm trying to make a text effect where on every frame the textfield increases in size and decreases in opacity. I'm using the scaleX and scaleY properties of my dynamic textfield to enlarge, but it's doing so keeping the left registration point fixed. I want to make it scale up radially outward, or with the center point fixed.

Posted: Feb 16 10 at 21:19

View 4 Replies!   View Related
ActionScript 3.0 :: Change Caret Insertion Point In Input Textfield
Is there a way to reset the insertion point of the caret to any position within an input textfield. I would like to reset it to position 0. The only thing I can find is caretIndex prop but that is read-only. I tried setSelection(0,1) but that didn't work either.

Posted: 04-30-2011, 11:01 PM

View 5 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved