A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Convert string to integer

  1. #1
    Senior Member
    Join Date
    Aug 2001
    Posts
    128

    Convert string to integer

    Is there a way (function) to convert a string to an integer?

    Thanks!
    [swf width="300" height="40" background="#000000"]http://www.zizunetwork.com/zizunetworkcouk.swf[/swf]

  2. #2
    FK's Giant Steve_w_V's Avatar
    Join Date
    Mar 2003
    Location
    San Jose, California
    Posts
    2,113
    What is the string? If the string is a number, ie:
    code:

    number="1000"
    numberInt=eval(number)


    numberInt can now be treated as a number, math functions, etc.
    The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...

  3. #3
    Senior Member
    Join Date
    Aug 2001
    Posts
    128
    Not working

    If i have _root.cepisode it returns 13
    If i have eval(_root.cepisode) it returns nothing

    _root.cepisode+1 returns 131

    ideas?

    (I want to return 14)

    Thanks!
    [swf width="300" height="40" background="#000000"]http://www.zizunetwork.com/zizunetworkcouk.swf[/swf]

  4. #4
    Senile member! :)
    Join Date
    Dec 2001
    Location
    Saunaswamp (transl)
    Posts
    2,296
    Number(_root.cepisode) + 1

    /Mirandir

  5. #5
    Senior Member
    Join Date
    Aug 2001
    Posts
    128
    Thats the one!

    Thanks
    [swf width="300" height="40" background="#000000"]http://www.zizunetwork.com/zizunetworkcouk.swf[/swf]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center