Be a Supporter!

Actionscript

  • 177 Views
  • 4 Replies
New Topic Respond to this Topic
C-Doodlez-Man
C-Doodlez-Man
  • Member since: Apr. 9, 2006
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Actionscript 2008-10-04 15:03:42 Reply

what code do i use so a certain variable has limits. like sleep cant go over 100 or money cant go below 0. thanks


Check out the flaming atom forums! A growing community of youtubers, with interesting discussions and a minecraft server. http://forum.flamingatom.com/index/

BBS Signature
uyersuyer
uyersuyer
  • Member since: May. 15, 2002
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to Actionscript 2008-10-04 15:06:18 Reply

if(money<=0){
money=0;
}

"Whoever said 'winners never quit' obviously never considered addicts." - Hoeloe

BBS Signature
C-Doodlez-Man
C-Doodlez-Man
  • Member since: Apr. 9, 2006
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Actionscript 2008-10-04 15:16:23 Reply

didnt work. i put that in the timeline, right?


Check out the flaming atom forums! A growing community of youtubers, with interesting discussions and a minecraft server. http://forum.flamingatom.com/index/

BBS Signature
uyersuyer
uyersuyer
  • Member since: May. 15, 2002
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to Actionscript 2008-10-04 15:19:27 Reply

Try figuring out what it does instead of mindlessly copy and pasting.


"Whoever said 'winners never quit' obviously never considered addicts." - Hoeloe

BBS Signature
TheGoldenMonk
TheGoldenMonk
  • Member since: Jan. 31, 2008
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to Actionscript 2008-10-04 19:06:11 Reply

At 10/4/08 03:16 PM, C-Doodlez-Man wrote: didnt work. i put that in the timeline, right?

"If" statements have to be within an onClipEvent handler, or a basic function handler. so something like this for a frame:

onLoad = function () {
money = 0;
};
onEnterFrame = function () {
if (money<=0) {
money = 0;
}
};


BBS Signature