Results 1 to 3 of 3
  1. #1

    Action script 2 help

    Edit: I figured it out finally. I don't know if this topic can be deleted or not. Sorry.

    Hello. Wasn't sure if I was allowed to ask this here so I apologize in advance. It's in off topic so I assumed it may be alright. Sorry about the long message too, I'm trying to be as specific as I can.

    I've been messing with some action script in Flash Mx 2004 for about the past 3 or so hours and I can't quite get it to work the way I want it to. Really hoping someone could help me out here. Would really appreciate it.


    if (exp == 0) {
    hp -= 10;
    }else if(hp < 10) {
    gotoAndStop("no hp left",1);
    }else if(exp == 10) {
    hp -= 10;
    }else if(hp < 10) {
    gotoAndStop("no hp left",1);

    This actionscript is inside a "talk" button. From there are good or bad choices. Each time you click talk costs you "hp". A good choice gives you "10 exp". A bad choice gives you no exp. And the more exp the more different choices and conversations. But when you have no more "hp" you switch to a scene notifying you "No more hp".
    Now, as it is currently, when you have 10 exp the situation plays out perfectly. The Hp doesn't go into the negatives and when you click talk and you reach 0 Hp you are taken to the scene that says "No more Hp to talk". But this is the opposite for having only 0exp. The Hp goes into the negative and you never see the "No more Hp to talk." You just keep going further into negative Hp.

    I plan to add in later a variable for random messages but I need this to work first. And I don't understand why the same actionscript condition that's working for 10exp is not working for 0exp.

    Really sorry for posting this here, this script is old and when I tried searching on Google and Youtube, I couldn't find my answers or anyone with a similar question. Please let me know if I need to clarify anything.
    Last edited by Sakura; 19-May-17 at 10:07.
    - I'm a newb to Blender.
    - I have Photoshop. If you have an image that needs tweaking or something I can do to help feel free to ask. I'll see what I can do.

  2. #2
    BA Crew Fweeb's Avatar
    Join Date
    Sep 2003
    Atlanta, GA, USA
    Moved from "Misc: > Off-topic Chat" to "Support > Other Software"

  3. #3
    Member arifoxs's Avatar
    Join Date
    Oct 2016
    Kudus, Indonesia
    Sorry if I'm late, I've expert for flash 8 and as2, I also still have flash mx Setup on my old hard drive, maybe when you upload your file, I can help,

    I think you are not wrong, just maybe your wrong location of code , because if your code in movieclip, there may be the same variable, because every movieclip, code can also come from External Script, that is Class File (file * .as If I am not mistaken)
    Before I knew unity, unreal and blender, I used to learn to make games for mobile phones symbian with Flash Lite(at that time my phone is Nokia 2700 classic hahahahah), I use flash MX, flash MX pro then change flash 8 pro. But there was no Google Play in 2008, sorry just remembered my high school years
    Last edited by arifoxs; 14-Jun-17 at 23:38.

Posting Permissions

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