It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Flash Forum

setting a minimum value for dynamic text

Moderator: Phate

setting a minimum value for dynamic text

Postby Solar42693 on Wed Jul 26, 2006 8:14 pm

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: Select all
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
User avatar
Solar42693
 
Posts: 35
Joined: Tue Jul 11, 2006 12:56 am

Postby stewball on Sun Aug 06, 2006 9:18 pm

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: Select all
//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: Select all
//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*/
}
User avatar
stewball
100+ Club
 
Posts: 116
Joined: Sun Oct 30, 2005 6:30 pm
Location: London, UK

Postby Solar42693 on Mon Aug 07, 2006 12:35 am

That clears things up a lot, i'll have to go try that, thanks.
User avatar
Solar42693
 
Posts: 35
Joined: Tue Jul 11, 2006 12:56 am

Postby stewball on Mon Aug 07, 2006 9:30 pm

If you need any help add me on MSN.
User avatar
stewball
100+ Club
 
Posts: 116
Joined: Sun Oct 30, 2005 6:30 pm
Location: London, UK


Who is online

Users browsing this forum: No registered users and 0 guests