SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Character Generation problem

    Hi there I have a question for my Character Generator I'm making for a Tabletop game I'm developing, and I've uploaded the problem file here twistedpancreas.com/test/strongProblem.fla

    You get to type in your Str value and then later on could choose a Trait like Strong (ie type in a value next to Strong then click Strong), problem is I have the Str input value in a onEnterFrame (so that you get instant feedback on how much the Str value costs), and so when the Strong trait value gets added to the Str value it appears for a millisecond then reverts to what was originally typed.

    How do I get the Strong value to remain added to the Str value?

    Because i would have thought the Strong button code inside "traits_mc" would have this:

    gStrCost = Number(gStrCost) + (Number(myStrongTxt.text));

    but that doesnt seem to work

    Any help would be appreciated.

    Thanks in advance.

  2. #2
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok someone on another forum suggested I put a trace in "traits_mc" at frame 21 AS and I got

    gStrCost = 0 : myStrongTxt.text = 0

    which seems fine and then they said to replace Number() with parseInt() but that didn't seem to work, see my updated file here: twistedpancreas.com/test/strongProblem1.fla

    can anyone help?

  3. #3
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well it looks like

    strongStr = (Number(_root.myStrTxt.text)) + (Number(myStrongTxt.text))

    _root.myStrTxt.text = strongStr;

    does the trick to adjust the Str Lvl stat, see twistedpancreas.com/test/costProblem.swf

    but it shouldn't adjust the Str Lvl cost beside it, anybody got any ideas on how I could avoid that? Updated file is here twistedpancreas.com/test/strongProblem.fla


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •