A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Error in Script that Works for Flash5

  1. #1
    Hello, I asked for help before when I was using flash, but when I got MX, some little things changed.

    on(release){

    ac = dexbonus + acbase;

    }


    Why does that not work correctly?

    ac base is 10, and for the sake of argument, dexbonus is 4, when using that script above, ac comes up as 410, and not 14, why is that?

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Location
    Planet Earth
    Posts
    298
    Convert the values to numbers.


    Use this:
    Code:
    on(release){ 
    
    ac = parseInt(dexbonus) + parseInt(acbase); 
    
    }
    or this:

    Code:
    on(release){ 
    
    ac = Number(dexbonus) + Number(acbase); 
    
    }
    For all intents and purposes they do the same thing.

  3. #3
    I thank you very much, it works well.

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