ActionScript 2.0 :: Restrict A Variable To 0.1 Decimal?
Apr 4, 2010
I have made a setInterval(countdown,100); for time and in countdown it is like
function countdown() {
time = time-0.1;
}
When I trace it after some seconds it shows seconds like "50.9999999999" I am just reducing it to 0.1 then why it is showing upto that much decimals?
How can I reduce it to 0.1 decimal so that it calculates "50.9" instead of "50.9999999999" ?
View 3 Replies
Similar Posts:
Jun 9, 2011
Is there some easy way to restrict TextInput to accept decimal numbers in range -99.999999 to +99.999999 ?
it is Spark TextInput.
View 1 Replies
Dec 2, 2010
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.
View 5 Replies
Feb 15, 2011
I want to make an Integer variable in my AS3 script to be rounded up to the nearest 0.5 decimal. For example 3.35 should be 3.5 and 3.87 should be 4.0.
View 4 Replies
Feb 28, 2003
I need to check whether a variable is an odd number, as I alternate which part of the movie I play.[code]...
View 3 Replies
May 6, 2010
I have a program that adds values together. I need the variable to display with 2 decimal places. Right now $1.50 would look like: 1.5
How do I make Flash display the zero automatically?
View 2 Replies
Oct 6, 2009
If I have a variable interestRate and the value is 6.5 What would be the simpest way to display it as 6.50 also if it was just 6 how to display as 6.00
View 3 Replies
Aug 9, 2011
I have need to restrict user input. TextInput should restrict all special characters and punctuation. Any other characters are allowed. In java there is a regex patter:
replaceAll("\p{Punct}", "_")
Is there something similar in actionscript?
View 2 Replies
Mar 27, 2009
to be loaded by just one .html ??I have one book which was converted page to swf. Each swf will be inside one .html, pag1.html contains pag1.swf, I'd like to avoid the direct url reference to pag1.swf.Any way of detecting the URL of html the swf file is embedded in?
View 3 Replies
May 8, 2009
I'm having trouble with the new keyframing model in Flash CS4.Say I have a symbol that starts here, then moves over there, then waits, then moves back over there again, etc. etc.Using the new model, all of these movements seem to be considered the same and single tween.If I apply easing, the easing affects the entire range of keyframes. This doesn't make sense? I may want the symbol to slow down when it gets "there" and have different easing for different movements. Does this make sense?
View 1 Replies
Feb 14, 2006
how can I restrict an input box to only accept the numbers 1,2,3,4 or 5 but nothing else.
View 2 Replies
Mar 21, 2011
How do I restrict a mc to a certain area of the stage? I am going to have some buildings on the top of my stage and I don't want my character to be able to walk past the street level.So basically I don't want him to be able to go off the stage or up some to be determined height.
View 6 Replies
Jul 28, 2009
[URL]
If you drag the map, it moves even beyond the edge of the map so the map eventually gets dragged off the screen. Is there any possible way to stop the map moving any furthur than its boundry?
The source is here - [URL]
View 3 Replies
Aug 13, 2009
I know how to use .restrict() to restrict or allow characters in a textfield, but how to I restrict just a double quote? "I tried with the two backslashes but that does not work.My only option seems to be to ALLOW a whole lot of character sets but leave out the double quotes. Is that truly the ONLY way?
View 2 Replies
Sep 27, 2010
Hey, can I restrict a certain string within a textfield?
if(textfield.text == *"****"*)
{
}
type of thing?....
View 6 Replies
Aug 5, 2009
is it possible to make a Flex-application to only run from my domain? So a user can't copy the .swf and start it locally.
View 3 Replies
Nov 5, 2009
I need to restrict the user and allow only first character as + or - or 0-9 and other character as 0-9..how can i do this in regular expression validator the below expression works but i need in restrict field.
<mx:TextInput id="txtTop" restrict="[0-9+-][0-9]*$" />
[Code]...
View 1 Replies
Jun 19, 2010
this is my code ..
import RegExp;
var userEmail:String;
var userName:String;
var userPhone:String;
how to restrict my userPhone:String; to take only numbers?
i tried the restrict property. the compiler gives me error.
View 1 Replies
May 26, 2011
i want to restrict the input to numbers only, but do have a problem for an empty entry:
now accessing like this:
var newValue:Number = event.itemRenderer.data[event.dataField]
newValue is now for an empty entry not null, but 0...
View 1 Replies
Sep 26, 2011
I use a TextInput component of Flex 4.5 to enter some text in English. I use the restrict attribute to ... restrict the keyboard input to characters a-zA-Z only. The problem is that if i copy/paste a word in another language, i can then paste it into the TextInput component. Is there a way to avoid that? If no, how can i validate the input against a specified language?I found out that the unicode set of Chinese+ language symbols is u4E00 to u9FFF. So i write the following:
var chRE:RegExp = new RegExp("[u4E00-u9FFF]", "g");
if (inputTI.text.match(chRE)) {
trace("chinese");[code].........
View 1 Replies
Oct 31, 2011
How can I use restrict option of the TextField class with other languages?[code]...
How can I use it to enable to add just basic punctuation characters for example for hebrew or for so cyrilic languages taht use UTF-8 encoding?
View 1 Replies
Dec 26, 2009
I have a graphic of a computer with a mouse that is a movieclip and I am wondering if it is possible to be able to move the movie click about by clicking and dragging on it but I want to restrict the mouse to a certain space so it doesn't float off the table.
View 1 Replies
Mar 1, 2010
ive made an object which can be moved by the user with the arrow keys but you can make it go off screen
View 5 Replies
Aug 21, 2010
I want to have a webcam site where a user can broadcast their webcam and people can view it.
ActionScript Code:
netstream.publish("broadcast");
This was pretty easy to do.
The problem seems to be that anyone can broadcast over any netstream.
would someone be able to hijack a users broadcasting netstream?
could you publish through a php file to confirm sercurity?
ActionScript Code:
netstream.publish("http://example.com/netstreampublish.php?room=broadcast");
PHP Code:
<?php//perform security check is the real broadcaster//redirect to stratus?>
If I had my own stratus server, would I be able to do security checks before allowing broadcasting?
View 9 Replies
Oct 25, 2011
I'm using flash cs5.5 and usually when i make a text field, the text is cut off by the width of the text field unless i autosize it, but with TLFTextField, it just resizes itself without me telling it to. How do i set the TLFTextField so that the text stays within a certain width and crops everything past that width?
View 2 Replies
Aug 3, 2006
How I can include the . in the restricted text field. I know how to restrict to only allow for numbers, letters etc... but what I need is to only allow numbers and the dot.
View 4 Replies
May 10, 2003
i've got a mask following the mouse and was wondering how i could restrict the code so the mask would only follow the mouse when it was in a certain portion of the scene.basically i've got it following the mouse for a menu navigation and want to know how to not have the mask following the mouse when it moves outside of that menu area.
View 14 Replies
Sep 17, 2006
How would I restrict this variable:
Code:
this.mousePercent = _root.portfolio._xmouse/500;
so that it can't get below 0 or greater than 1?
View 2 Replies
Jul 25, 2007
How I can restrict actions to the stage? I have objects that float dynamically when I move the mouse over the stage. If I publish my file as html and click on the area surrounding the stage the objects move...
View 2 Replies
Dec 2, 2008
I am trying to have the falling snow in this script [URL] appear behind a mask layer.
View 2 Replies