A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Variable adds when going to frame??

  1. #1
    Senior Member
    Join Date
    Jan 2004
    Location
    Canada
    Posts
    309

    Variable adds when going to frame??

    Hey I am making an rpg and I want it so that when it enters a frame on the clock (the last one) it adds 1 to the number of days. I have

    _parent.day += _parent.day*1

    Butit does crazy stuff when i try to add it on like everything but just add 1 number. Can someone please help me? thanks alot.




    Matt

  2. #2
    Allan Jardine
    Join Date
    Dec 2000
    Location
    Turtle hunting
    Posts
    192
    _parent.day++; will do it

    At the moment you are adding the current value to itself, so if you start at 1 you'll get:

    1 2 4 8 16 32 64 etc...
    Just use the ++ increment.

    A

  3. #3
    Senior Member
    Join Date
    Jan 2004
    Location
    Canada
    Posts
    309
    Ok thanks... if I wanted to subtract 1 would it be

    _parent.day --= _parent.day*1
    ? thanks.







    matt

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