A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: evaluate the result of an equation in string format

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    8
    I need to evaluate the result of an equation in flash. However, the equation is a string (e.g. "5+6+1-3")

    Could anyone know how to do it?

  2. #2
    try using the string functions, like the slice() function to cut up the string and then convert the strings to numbers. You will need to slice the string four times for the four + - / and *.

    It is a bit time consuming but this is what I know.

    Check the Flash help to see how the string functions work.

    Hope that helps

  3. #3
    Junior Member
    Join Date
    Jan 2001
    Posts
    8

    Still not understand

    Thanks for your reply!

    However, I would like to ask how to convert the +, - , * and / to be operator rather than string?


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