A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Using preloaded variable from a txt file

  1. #1
    Banned
    Join Date
    Dec 2003
    Location
    Denmark, Europe
    Posts
    53

    Using preloaded variable from a txt file

    I know how to load these variables from a txt file and show them as text in a text field. But how do I use them for calculating? They dont seem to be like if I created a variable manually??

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Location
    Houston TX
    Posts
    563
    That is because they are still in text format.

    Use the convert to number functions and you can use them as real numbers.


    www.e4net.com
    www.tobymack.com
    Best regards
    Toby Mack

    For the best and funniest Audio Blog on the Internet come visit:

    http://feeds.feedburner.com/Fla****UpBlog

  3. #3
    Banned
    Join Date
    Dec 2003
    Location
    Denmark, Europe
    Posts
    53
    Will you PLEASE explain the use if the function you talk about? Never heard of it

  4. #4
    Senior Member
    Join Date
    Nov 2001
    Location
    Houston TX
    Posts
    563
    Number (function)

    Syntax

    Number(expression);
    Arguments

    expression The string, Boolean, or other expression to convert to a number.

    Description

    Function; converts the argument x to a number and returns a value as follows:

    If x is a number, the return value is x.

    If x is a Boolean, the return value is 1 if x is true, 0 if x is false.

    If x is a string, the function attempts to parse x as a decimal number with an optional trailing exponent, that is, 1.57505e-3.

    If x is undefined, the return value is 0.

    This function is used to convert Flash 4 files containing deprecated operators that are imported into the Flash 5 authoring environment. See the & operator for more information.

    Player

    Flash 4 or later.

    See also

    Number (object)
    Best regards
    Toby Mack

    For the best and funniest Audio Blog on the Internet come visit:

    http://feeds.feedburner.com/Fla****UpBlog

  5. #5
    Banned
    Join Date
    Dec 2003
    Location
    Denmark, Europe
    Posts
    53
    Im totally newbie. WIll you pls talk to me like I was a 12 yr old boy?
    Will you pls gimme an example of the code in use? please.

  6. #6
    Senior Member
    Join Date
    Nov 2001
    Location
    Houston TX
    Posts
    563
    Sorry but it will take way to much time to write you a tutorial on this but do a search here on Flashkit for a calculator. That will show you how variables are used entered as text and converted to numbers.
    Best regards
    Toby Mack

    For the best and funniest Audio Blog on the Internet come visit:

    http://feeds.feedburner.com/Fla****UpBlog

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