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








Detecting And Removing Number From String


I am trying to figure out a way to detect and remove a number from a string. The value of the string is entered from a input text field. I need to detect leading zeros and remove them from the string. I understand the logic but familiar enough with the AS syntax yet.

//Found this to detect the first digit in the string
check = myString .charAt( 0 )


Need help forming the if statement to detect if leading digit is '0' and if = 0 remove it from string.

Thanks for any help you might be able to provide....




ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 12-15-2002, 12:48 PM


View Complete Forum Thread with Replies

Sponsored Links:

Removing A Number Out Of Random String
ok I need it so that when a random number is drawn out of a pool of numbers
then it will take one out and the one taken out is removed from the pool
how would i do this?

View Replies !    View Related
Help Can't Convert String To Number With Number()
I'm pulling variables from an XML file and need to convert the strings from the XML to numbers. So, I have the following actionscript:


Code:
thisPC_Price = aPrice[0].stringValue();
trace(thisPC_Price);
trace(Number(thisPC_Price));
The first trace returns 100, which is the contents of the string (it's also treated like a string by the AS and if I try and do anything to it it will return NaN, as it should). The 2nd trace action returns NaN ..... and I have no idea why.

Anyone have any ideas?

View Replies !    View Related
Detecting If A Var Is An Odd Number?
Hi,

I need to check whether a varaible is an odd number, as I alternate which part of the movie I play.

something like....

if(i=oddNumb)
{
gotoAndPlay(...)
}
else
{
gotoAndPlay(...)
}


I was thinking if i could take the value of the variable divide it by 2, and then check whether the answer is a decimal and then I could tell if it was an odd number., But Im not sure how to do this, ive checked the AS dictionary and a searched the forums.

Your help greaty appreciated

View Replies !    View Related
Detecting If Number Is Odd Or Even
I thought I had a nice way to do this, but it's not always accurate for some reason. I was using (where myNumber is a number):

evenOrOdd = myNumber % 4; // 4 or any number

if (evenOrOdd == 0) {
// Number is even
}

Is there another way?

View Replies !    View Related
Detecting If Number Is Odd Or Even
I thought I had a nice way to do this, but it's not always accurate for some reason. I was using (where myNumber is a number):

evenOrOdd = myNumber % 4; // 4 or any number

if (evenOrOdd == 0) {
// Number is even
}

Is there another way?

View Replies !    View Related
How Can I Put A Number And A String Together So It Ends Up Being A String ?
How can I put a number and a string together so it ends up being a string ?


This doesn't work:
----------------------

somenumber=1;
somestring="File";

combination=somestring + somenumber;

----------------------

At the end i want to have this:

combination="File1";

Can anyone help ?

View Replies !    View Related
Removing Float Number
i have a function that outputs a floating number
rather than round it up or down i would like to remove the point whatever number, so
6.7 or 6.3 becomes simply 6
how can i do this?

View Replies !    View Related
Detecting Number Of Files In A Dir With AS
Hi all. Is there a way to make flash detect how many files are in a particular directory, and then use that number to define the range of a random number?

I've made a slideshow for a friend that loads random images, but I've had to specify the range manually. It's for his dad, and I want for him to be able to just plonk new images in whenever he likes and it will just work.

I'm using MX 2004.

Any help greatly appreciated, cheers!

View Replies !    View Related
Detecting IP Number Of User
Is it possible to detect the IP number via flash, java, php, whatever, and send the information to flash?

View Replies !    View Related
Detecting Frame Number?
Alright, I'm having a little issue...Currently, I have a navigation bar where when you roll over a button, a movieclip plays. On the roll out, the movie plays in reverse, making it appear to rescede to where it came from. If you roll out too quickly, it skips to the resceding part, and it makes it look like it skips.

Is there any way to tell what frame a movieclip is on? If I can get that, I can write an If Then statement that would ensure it would wait till it got to the finished frame, and THEN do the rescedeing.

View Replies !    View Related
Detecting IP Number Of User
Is it possible to detect the IP number via flash, java, php, whatever, and send the information to flash?

View Replies !    View Related
Detecting Frame Number?
Alright, I'm having a little issue...Currently, I have a navigation bar where when you roll over a button, a movieclip plays. On the roll out, the movie plays in reverse, making it appear to rescede to where it came from. If you roll out too quickly, it skips to the resceding part, and it makes it look like it skips.

Is there any way to tell what frame a movieclip is on? If I can get that, I can write an If Then statement that would ensure it would wait till it got to the finished frame, and THEN do the rescedeing.

View Replies !    View Related
Can't Run The Scoring And Removing The Number Of Lives...
I have struggled with AS3 for setting up the scoring that won't count the numbers of a rabbit catches stars. I already set up the maximum up to 15 stars to win and how can I make it to go to another frame of "gameover"? Moreover, I cannot figure out how to reduce the number of lives that the rabbit has when the rabbit was hit. If the rabbit runs out of its life number, how can I make it automatically go to "gameover" frame? You can try to play at http://tofufoto.tofudesign.com/test/


ActionScript Code:
var leftDown:Boolean = false;
var rightDown:Boolean = false;
var speed:int = 5;
var startTime:int = 0;
var timeLimit:int = 40;
var dropSpeed:int = 8;

//usagi's speed
var walkSpeed:Number = 7;
//usagi's jumping
var isJumping:Boolean = false;
//how quickly should the jump start off
var jumpSpeedLimit:int = 40;
//the current speed of the jump;
var jumpSpeed:Number = 0;

//Define variables for the key presses
var up:Boolean = false
var down:Boolean = false;
var right:Boolean = false;
var left:Boolean = false;

//a variable to display the user's score
var score:Number;
//a variable to maximum up to the number of stars needed to be caught to win
var winScore:Number = 15;
//a variable to display the number of lives the usagi has
var playerLives:Number;

//this listener will listen for down keystrokes
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkKeysDown);
function checkKeysDown(e:KeyboardEvent)
{
    //making the booleans true based on the keycode
    //arrow keys
    if(e.keyCode == 38 || e.keyCode == 87)
    {
        up = true;
    }
    if(e.keyCode == 40 || e.keyCode == 83)
    {
        down = true;
    }
    if(e.keyCode == 39 || e.keyCode == 68)
    {
        right = true;
    }
    if(e.keyCode == 37 || e.keyCode == 83)
    {
        left = true;
    }
}

//this listener will listen for keys being released
stage.addEventListener(KeyboardEvent.KEY_UP, checkKeysUp);
function checkKeysUp(e:KeyboardEvent)
{
    //making the booleans false based on the keycode
    if(e.keyCode == 38 || e.keyCode == 87)
    {
        up = false;
    }
    if(e.keyCode == 38 || e.keyCode == 83)
    {
        down = false;
    }
    if(e.keyCode == 39 || e.keyCode == 68)
    {
        right = false;
    }
    if(e.keyCode == 37 || e.keyCode == 83)
    {
        left = false;
    }
}

//add an event listener to usagi movie clip to make it move based on keypresses
mc_usagi.addEventListener(Event.ENTER_FRAME, moveUsagi);

//event handler tht moves Usagi on the Stage
function moveUsagi(e:Event)
{
    //if certain keys are down then move Usagi
    if(left && e.target.x > 280)
    {
        //change usagi's horizontal position to move left
        e.target.x -= walkSpeed;
        e.target.scaleX = 1;
    }
    if(right && e.target.x < 420)
    {
        //change usagi's horizontal position to move right
        e.target.x += walkSpeed;
        e.target.scaleX = -1;
    }
    if(up || isJumping)
    {
        //call a function to create the jump animation
        usagiJump();
    }
}

//jumping function
function usagiJump()
{
    //if usagi isn't already jumping
    if(!isJumping)
    {
        //then start jumping
        isJumping = true;
        //set the value of jump speed to negatie value of jumpSpeedLimit
        jumpSpeed = - jumpSpeedLimit;
        //move usagi's vertical position up
        mc_usagi.y += jumpSpeed;
    }
    else
    {
        //then continue jumping if already in the air
        if(jumpSpeed < 0)
        {
            //as the usagi moves up in the jump,
            //slowly diminish the value of jumpSpeed to ease out of the jump
            jumpSpeed *= 1 - jumpSpeedLimit/250;
            //when usagi reaches the top of his jump
            if(jumpSpeed > -jumpSpeedLimit/30)
            {
                //multiply the jumpSpeed value by -1 to start bringing usagi backdown
                //jumpSpeed was initially set to a negative number
                //this will change its value back to positive to move the usagi down
                jumpSpeed *= -11;
            }
        }
        //create an ease in motion as usagi moves back down
        if(jumpSpeed > 0 && jumpSpeed <= jumpSpeedLimit)
        {
            jumpSpeed *= 2 + jumpSpeedLimit/70;
        }
        //change the vertical position of the usagi
        mc_usagi.y += jumpSpeed;
        //if character hits the moon, then stop jumping
        if(mc_usagi.y >= stage.stageHeight - mc_usagi.height)
        {
            isJumping = false;
            mc_usagi.y = stage.stageHeight - mc_usagi.height;
        }
    }
}

//this listener will listen for runGame
stage.addEventListener(Event.ENTER_FRAME, runGame);

function runGame(e:Event)
{
    createStars();
    createRocks();
    score = 0;
    checkScore();
    playerLives = 5;
    showLives();
}

function createStars()
{
    if(startTime < timeLimit)
    {
        startTime++;
    }
    else
    {
        //defining a variable which will hold the new star
        var newStar:Star = new Star();
        //horizontally position the rock offstage when it is created
        newStar.y = Math.random() *stage.stageHeight/2;
        newStar.x = 0 - newStar.width
        newStar.addEventListener(Event.ENTER_FRAME, movingStar);
        //then add the star to stage
        addChild(newStar);
        //and reset the startTime to create a delay in creating the next star
        startTime = 0;
    }
}

function movingStar(e:Event)
{
    //check to see if the star goes off stage / if so, remove it
    if(e.target.x > stage.stageWidth)
    {
        e.target.removeEventListener(Event.ENTER_FRAME, movingStar);
        removeChild(MovieClip(e.target));
    }
    //check to see if bunny net hits a star
    if(e.target.hitTestObject(mc_usagi.mc_hotspotstar))
    {
        e.target.removeEventListener(Event.ENTER_FRAME, movingStar);
        removeChild(MovieClip(e.target));
        //increment the user's score
        score++;
        //check to see if the user win
        checkScore();
    }
    //move the star horizontal
    e.target.x += speed;
}

//create a function to check the score every time a star is caught
function checkScore()
{
    displayScore.text = String(score);
}

function createRocks()
{
    if(startTime < timeLimit)
    {
        startTime++;
    }
    else
    {
        //defining a variable which will hold the new rock
        var newRock:Rock = new Rock();
        //horizontally position the rock offstage when it is created
        newRock.y = Math.random() *stage.stageHeight/2;
        newRock.x = 0 - newRock.width
        newRock.addEventListener(Event.ENTER_FRAME, movingRock);
        //then add the rock to stage
        addChild(newRock);
        //and reset the startTime to create a delay in creating the next rock
        startTime = 0;
    }
}

function movingRock(e:Event)
{
    //check to see if the rock goes off stage / if so, remove it
    if(e.target.x > stage.stageWidth)
    {
        e.target.removeEventListener(Event.ENTER_FRAME, movingRock);
        removeChild(MovieClip(e.target));
    }
    //check to see if bunny net hits a rock
    if(e.target.hitTestObject(mc_usagi.mc_hotspotrock))
    {
        e.target.removeEventListener(Event.ENTER_FRAME, movingRock);
        e.target.gotoAndPlay("explode");
        //increment the user's score
        score++;
        //check to see if the user win
        showLives();
    }
    //move the rock horizontal
    e.target.x += speed;
}

function showLives()
{
    displayLife.text = String(playerLives);
   
}

Please let me know what did I miss anything in AS3 for this parts?

View Replies !    View Related
Detecting Number Of Frames In Timeline Of SWF
hi there,
is there an AS or function that can detect the number of frames in the timeline of an externally loaded SWF?
please advise. thank you.

View Replies !    View Related
Input Text - Detecting ODD Number.
Hi people,

I've got a few input text fields and a submit button on an order form I've designed. Trouble is you can only order in multiples of 2. Naturally I have a warning stating that orders must be multiples of that number but there is always room for idiocy!

Lets say my order input text box is called "order" and the button used to proceed to payment is called "submit". How do I detect an ODD number entry and have it run an mc called "warning"?

Does that make sense to anyone because I'm confusing even myself - which admittedly isn't hard for me today.

Thanks.

View Replies !    View Related
Detecting Number Of Attributes In ChildNode
Hi there everyone,

im trying to write a handfull of XML functions in AS2.0
and im trying to find a way of getting flash to detect
the number of attributes in a childNode.

<item name="aaron" location="sydney" sex="male"/>
as in finding out how many of these ^ there are in each item.

any ideas as to how I would do this? I've tried for...in... statements
and even trying to access them as objects i.e. ...ode[0].attributes["name"]
but it never works - I always have to hard code...ode[0].attributes.name
to get the value.

im sure theres a way to do this, there has to be a way.
please show me the way

Thanks in advance !!!

View Replies !    View Related
Detecting Current Frame Number?
I have a movieclip placed in the main timeline. Inside that movieclip, there is another movieclip.
I need to know the current frame number of the inner movieclip when the animation is playing.
And report that current frame number back to the actionscript in the main timeline.
Anyone know how to achieve that? Thank you!

View Replies !    View Related
Input Text - Detecting ODD Number.
Hi people,

I've got a few input text fields and a submit button on an order form I've designed. Trouble is you can only order in multiples of 2. Naturally I have a warning stating that orders must be multiples of that number but there is always room for idiocy!

Lets say my order input text box is called "order" and the button used to proceed to payment is called "submit". How do I detect an ODD number entry and have it run an mc called "warning"?

Does that make sense to anyone because I'm confusing even myself - which admittedly isn't hard for me today.

Thanks.

View Replies !    View Related
Detecting Number Of Attributes In ChildNode
Hi there everyone,

im trying to write a handfull of XML functions in AS2.0
and im trying to find a way of getting flash to detect
the number of attributes in a childNode.

<item name="aaron" location="sydney" sex="male"/>
as in finding out how many of these ^ there are in each item.

any ideas as to how I would do this? I've tried for...in... statements
and even trying to access them as objects i.e. ...ode[0].attributes["name"]
but it never works - I always have to hard code...ode[0].attributes.name
to get the value.

im sure theres a way to do this, there has to be a way.
please show me the way

Thanks in advance !!!

View Replies !    View Related
Removing Characters From A String?
I thought I could find this somewhere and then I thought I could do this... but I'm just not sure where to start?! I want to look though a string and when I find a "<" I want to remove it, AND ever character after it untill I find a ">"

So If I have a string that looks like this:
Hi my name is <JOE>. You must be <Jen>

I want to create a new string that looks like this:
Hi my name is . You must be

Thanks in advance for any help you can give

View Replies !    View Related
[F8] Removing Whitespaces In From Of String
I have a small chat app. When I send data to and from the chat server I have to end each sentence with either a return carriage (
) or a newline carriage (
) so that the socket buffer flushes and the data is sent. The problem is that now when I send and receive data I keep getting two empty lines showing up in the textarea. I know this is because of the return/newline carriages. Is there any efficient way to remove these empty lines with each String being received?
Thanks in advance.

View Replies !    View Related
Removing Characters From String
Hi! How can i make sure that people wont be able to type decimal character. For exapmle 10,5. I am making a calculation and i dont want the users to be able to type decimals.

Any suggestions?

View Replies !    View Related
Removing Text From A String
Hi ive got a small problem here i have a string value called _root.videoplayer which returns the name of the video player loaded (i have 3 of them) so it usualy gives _root.player1

I need a way of snipping off the _root. part , ive trid alternitives but theyres just no way around this ive tried "_root" - videoplayer but im getting nothing

Is theyre any way of doing this ? it would help me a lot here and in the future .

Thanks for the help.

View Replies !    View Related
Removing The Last Character Of A String
Is it possible to remove the last character of a string? I am trying to simulate an on screen keyboard and it would be nice to have a backspace button rather than deleting everything.

Thanks!!

View Replies !    View Related
Removing Last 4 Characters Of A String
Is there a function to remove the last 4characters of a string?

that is to say, I have strings of variable length, like
"CdromPortfolio.txt", "MotionPortfolio.txt" , "WebPortfolio.txt" that I want to strip off the .txt prefix of dynamically.
I looked into substring and so on but it requires to know how many characters there are in total.

Thanks for any input

View Replies !    View Related
String: Removing Codes 10 & 13 (LF & CR)?
When I am loading external UTF-8 text files (or texts from an mySQL DB) with Flash, if those files contains enters (by the user that create them) I noticed that those enters are replaced by two char codes: 10 and 13 (new line feed + carriage return). If I put the loaded string to a TextField.htmlText I get 2 enters pressed, and thus instead of having 1 line change I got 1 paragraph change.

Thus if someone write:
Hello
I need some
help here.

and save it to a file (or mySQL database), when I will try to reproduce it by loading that text to a string and placing it to an htmlText, i will get:
Hello

I need some

help here.

Is there any official (and fast way) to overcome that problem?...

Or should I create a function that will take the string and search one by one the charCodes and deleting the charCode 10 or 13 (slow method). In that case, is it possible to create an array of the charCodes and then the whole array to convert it to String?

Below I give the code I create for that Job - but is there anything build-in for that reason? .. Or at least any other faster way to do this (without the for loop)?...







Attach Code

function xvp_RemoveCharCode10(Str):String {
var i,rSTR="";
for (i=0; i < Str.length; i++) {
if (STR.charCodeAt(i) == 10) continue;
rSTR+=Str.charAt(i);
}
return rSTR;
}

























Edited: 11/12/2008 at 08:23:46 AM by terablade2001

View Replies !    View Related
Removing Spaces From A String
How can I remove spaces from a string taken from an input text box. I am guessing I will have to use a for loop of some kind as I don't know where the spaces will be until the user has filled in the text box.

View Replies !    View Related
AS2::Removing Text From A String
I have a time format like so: 00:00:00.00 (hours, minutes, seconds, millieseconds). This is stored into a string called adminTime.

But I need to make it so that the string takes what ever the time is and changes it to 00:00 (hours and minutes)

So basically a way of looping though the string and removing the seonds and milleseconds.

Thanks for any help.

View Replies !    View Related
Removing Spaces From A String
How can I remove spaces from a string taken from an input text box. I am guessing I will have to use a for loop of some kind as I don't know where the spaces will be until the user has filled in the text box.

View Replies !    View Related
Detecting A Character And Number In Input Text
I'm working on a delivery costing system for my company using postcode input from users and I've got an idea I needs some help with...

For you non Brits out there UK postcodes work on two blocks of 2-4 characters each.

L2 2HH - Liverpool central
M24 2TN - suburb of Manchester
IV56 7NQ - outter Inverness

You get the idea. So the first part of a UK postcode, wether it be 2 characters or 4 characters MUST have atleast one numeric and one non-numeric character in it. How do I detect this?

At the moment I've just got my CHECK POSTCODE button to run a few functions only if my POSTCODE (input text) field length it greater or equal to 2 characters. So how do I easily detect an input of numeric and non-numerical characters without having to resort to indexOf ...a...b...c...1...2...3...?

View Replies !    View Related
Detecting A Character And Number In Input Text
I'm working on a delivery costing system for my company using postcode input from users and I've got an idea I needs some help with...

For you non Brits out there UK postcodes work on two blocks of 2-4 characters each.

L2 2HH - Liverpool central
M24 2TN - suburb of Manchester
IV56 7NQ - outter Inverness

You get the idea. So the first part of a UK postcode, wether it be 2 characters or 4 characters MUST have atleast one numeric and one non-numeric character in it. How do I detect this?

At the moment I've just got my CHECK POSTCODE button to run a few functions only if my POSTCODE (input text) field length it greater or equal to 2 characters. So how do I easily detect an input of numeric and non-numerical characters without having to resort to indexOf ...a...b...c...1...2...3...?

View Replies !    View Related
Detecting Frame Number On Stop Action
Is there a way to detect what frame number the timeline is on when a stop AS has been called?

example movie plays and stops at frame 11, i want to then capture that frame number and add it to a variable in a button

View Replies !    View Related
Removing Undesired Chars From A String
I want to take a string and strip out specified characters. In the case of this sample, I'm removing "(", ")", and ";".

I'm taking the string, and placing each character in an array if is ISN'T one of my no-no characters, but then I can't get it back to a string. I'm using toString() but unfortunately it includes the commas, which I don't want.

Can someone help me figure out how to turn this back into a regular string?

OR is there a simpler way to accomplish my objective?

Thanks so much in advance,

Mike

code:
var testName = "()hello();;";
trace("testName = " + testName);
testNameArray = new Array();
for(i=0;i<testName.length;i++){
newChar = testName.charAt(i);
trace("char " + i + " = " + newChar);
if((newChar != "(") && (newChar != ")") && (newChar != ";")){
testNameArray.push(newChar);
}
}
trace("testNameArray = " + testNameArray);
testName = testNameArray.toString();
trace("testName = " + testName);

View Replies !    View Related
[F8] Removing All Instances Of A String From An Array?
Hey is there an easy way of removing all instances of a string from an array?

Say i had, [0] forward, [1] forward, [2] right, [3] crash, [4] crash, [5] crash
(this structure will change)

How would i remove all "crash" instances? the splice method just doesn't cut it =/

View Replies !    View Related
Detecting Frame Number And Loading External Movies
i am trying to load a movie by trying to traget a specific frame but to no avail. i read some time ago here on the board that you could use the _currentframe property to do this sort of thing and its doing my head in !!

here's the specifics
i have 2 movie clips called 'pic1' and 'imagebox'
'pic1' acts as a thumbnail with an image inside, and an empty button in it which when you click on it prompts a box to open (imagebox), and then once that is fully open it loads the larger version (as an external swf file) of the image so as to minimise download time.

the actionscripting i've used is as follws:
Button inside pic1:

on (release) {
with (_root.imagebox) {
gotoAndPlay (2);
}
if (_root.imagebox._currentframe==25) {
loadMovie ("externalmov.swf", "externalmov");
}
}


'Imagebox' has a tween inside it which makes the box bigger to accommodate the larger image, with a stop action on frame 1 and on frame 25. Inside this mc is an empty mc called 'externalmov' which acts as a target for the external swf file to load into.


try as i may the _currentframe property does not seem to work. all i want it to do is the following:
if it is at such a frame please please please load external moviw externalmov.swf

is there another way of doing this??am i no where near?

thanx for you help!

View Replies !    View Related
String Manipulation Removing Words Between Delimiters
I am trying to remove words that occur between delimiters in a string.(this can also be an array if it helps any..)

These words have to be saved to different variables:
ie:
"This is the /string/that/has/to have the words 'string' 'that' and 'has' copied out"
var1 = "string"
var2 = "that"
and
var3 ="has"


I am not sure if this is possible but any ideas are welcome.
any body help?

Thx
Shaf

View Replies !    View Related
Detecting A Group Of Selected Words In A String
I have a text field with about 5 lines of text. Is it possible to have the user select any given word on any given line and change the font color of just that word?

Or does anybody know how to detect the first and last character of a selection? Example:

"The quick brown fox jumped over the lazy dog"

Suppose the user selects the words "quick brown".
The first character position of the selection would be 4 and the last would be 14. If I could get that I would know where to place my html tags.

Any suggestions?

View Replies !    View Related
[PHP] Class For Detecting Dead URLs In A Given String ...
Hey there!

I just wrote a neat little class that can do the following:

- Scan a string for URLs to 'ping' (lulz)
- Add your own patterns for URL matching
- Recursively ping URLs with 3xx redirect responses
- Returns an an associative array with URL => Reponse Code pairs
- Returns codes for ALL known HTTP responses
- Uses both cURL and fsockets for opening connections

This can come in handy for CMSs with older content that may or may not have dead URLs. Great way to do some clean up!

All the other link checking scripts I've found are a bit dated and / or messy, so I wrote my own.

I just need some people to go ahead and hammer away at it to make sure everything works as it should. If you have any suggestions, don't hesitate to throw them my way.

Yes, I also accept constructive criticism.

View Replies !    View Related
[F8] Number + Number = String?
Hi, I wonder if anyone can help me with this.
This code gives me the result 100100.


PHP Code:



var one:Number = 100;
var two:Number = 100;
var result:Number = one + two;




result then prints as 100100.
I don't understand why.

View Replies !    View Related
How Can I Add A Number To A String? Like As In 2+1=3 Not As In 2+1=21
How can I add a Number to a string? Like as in 2+1=3 not as in 2+1=21

I am making it so that after someone crosses a frame each time it adds a number and when it gets to 8 it does some other action. Would it be something like this? 'tracksplayed= +1;' Thanx in advance.

View Replies !    View Related
String To Number
I have a string which is "7". But i need it to be the number 7.
What shall i do?
Thanks in advance!
bye

View Replies !    View Related
String To Number
I have a string which is "7". But i need it to be the number 7.
What shall i do?
Thanks in advance!
bye

View Replies !    View Related
String To Number
How do I convert a string variable to a number variable?

View Replies !    View Related
String To Number Bug?
Hi,
I have the following code:

a="013";
b=Number(a);//returns 11

Is there a way that the string a can be converted to the right '13'?

greetings
Patrick

View Replies !    View Related
Number Or String
I am passing variables into flash through the param and embed tags (which use asp to get them from the URL query string)

When i pass in a variable named hole1=6, the 6 doesnt seem to be a number value. it acts like a string because when i perform functions on it (like + or -) this is the result:

6+5 = 65 instead of 6+5 = 11

any thoughts?

View Replies !    View Related
From String To Number
hi everyone:

from visual basic i send my swf a number formated like this, "100,000,00.56".
i use a dynamic text to show it, and i works fine.

the problem is that i need that number for another code (a graph), and it doesn't work because, i think, flash is taking it as a string, with the "," and ".".

so what i need is to format the string "100,000,00.56" into the corresponding number. and i need to do that in flash not visual basic.

help please.

thanks, take care.

View Replies !    View Related
Number To String?
Hi,

I have a number im trying to covert to a string so it can be displayed in a text field.

Can any one tell me how?

I have tryed.

holder = holder.toString();

but still get the same problem.

View Replies !    View Related
String To A Number
Hi All

So it looks as though my threshold idea is impossible. I have another idea though. Only one thing is holding me back. I need to convert a hex string to a number variable. I looked at parseInt but this appears to be a method of gaining a decimal number ie 0x44D391 would become 68208152 (I think). I need the variable to retain its original 0x.... so I can use it in the threshold method.

Cheers

Jim

View Replies !    View Related
String To Number
i am loading in a number from a text file. In the code below how can I change MyPercent to a Numberr variable so I can add it to other numbers?



// create a loadVars object to get the txt data
var myLoadVars:LoadVars = new LoadVars();

// wait for download of imageInfo.txt file
myLoadVars.onLoad = function(){
loadFactor();
}

function loadFactor(){
myPercent.text = myLoadVars.myFactor;
}

myLoadVars.load("factor/factor.txt");


thanks,

Urig

View Replies !    View Related
String To Number
hi every1,

Ive been struggling with this for a while now, and I'm sure that this is pretty simple thing to do but I just cant reach it :P

How do I convert a String to number?
code:

Code:
var n:String = "123";
var t:Number = n;

trace(n); //1067: Implicit coercion of a value of type String to an unrelated type Number.


THKX

::edit:: pretty dumb example (duh) :P

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