| View previous topic :: View next topic |
| Author |
Message |
Solar42693

Joined: 11 Jul 2006 Posts: 35
|
Posted: Wed Jul 26, 2006 9:14 pm Post subject: setting a minimum value for dynamic text |
|
|
could anyone please tell me how you would do this? it's for a game and i'm trying to make it where you buy stuff, and my gold just goes in the negatives. i tried a goldneeded>=goldrequired but it's not working. could someone plz help, thanks. also for dynamic text is it possible to do like... oh say a
| Code: |
if health <= 0
_root.... |
ok you get the point, but is it possible to have a movieclip go to a different frame when health is less than or equal to 0. because i couldn't get that to work either. thanks again |
|
| Back to top |
|
 |
|
|
Samuel Rounce 100+ Club

Joined: 30 Oct 2005 Posts: 116 Location: London, UK
|
Posted: Sun Aug 06, 2006 10:18 pm Post subject: Re: setting a minimum value for dynamic text |
|
|
Hmm well as I don't know the variable for the dynamic text field I'll have to assume a load of stuff but just post back and I'll be happy to straighten things out if you have any problems with the code.
| Code: |
//The health code
if(health <= 0) {
health == 0;
_root.healthpic_mc.gotoAndStop(0);
//assuming the health empty picture is on frame 0 of it's movieclip
} |
| Code: |
//The money code
if(goldamount - goldneeded <= 0) {
textbox_var = "not enough gold";
} else {
buyitem(itemname); /*I assume you've written a buy item function that has an argument that is set, so the correct item is added to your inventory*/
} |
|
|
| Back to top |
|
 |
Solar42693

Joined: 11 Jul 2006 Posts: 35
|
Posted: Mon Aug 07, 2006 1:35 am Post subject: Re: setting a minimum value for dynamic text |
|
|
| That clears things up a lot, i'll have to go try that, thanks. |
|
| Back to top |
|
 |
Samuel Rounce 100+ Club

Joined: 30 Oct 2005 Posts: 116 Location: London, UK
|
Posted: Mon Aug 07, 2006 10:30 pm Post subject: Re: setting a minimum value for dynamic text |
|
|
| If you need any help add me on MSN. |
|
| Back to top |
|
 |
|