A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: loading from a txt file

  1. #1
    Junior Member
    Join Date
    Sep 2004
    Posts
    12

    loading from a txt file

    I'm loading some variables in from a text file and everything loads ok, but flash thinks my numbers are strings. How can I get flash to realized a variable is a number and not a string.

  2. #2
    Who, What, Why ... ? Fraggs's Avatar
    Join Date
    Jul 2003
    Location
    Flashland .. where else ?
    Posts
    786
    Don't pute quotes around it.

    Regards,

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Fraggs is out on this one!
    Loading variables from a text file will allways be considered by Flash as strings... You have to convert them back to integers once they're loaded!

  4. #4
    Who, What, Why ... ? Fraggs's Avatar
    Join Date
    Jul 2003
    Location
    Flashland .. where else ?
    Posts
    786
    awwww, dang !

    "Another one bites the dust"

  5. #5
    Junior Member
    Join Date
    Sep 2004
    Posts
    12
    ok, so how do I convert a variable to an integer

  6. #6
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    using Number():
    code:

    myNumber = Number(myString);


  7. #7
    Junior Member
    Join Date
    Sep 2004
    Posts
    12
    hey thanks! the code works now

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