yes i KNOW i have a lot of questions... but heres another one

Started by: doc | Replies: 4 | Views: 547

doc

Posts: 1,127
Joined: Jan 2009
Rep: 10

View Profile
Jan 28, 2009 1:24 AM #346930
ive got this game that i made. im trying to include a scoring system. so ive got the actual game on frame 2 and the "you lose" frame on frame 3. there is a score box (dynamic text box) on both frames with the same instance name (sb). im trying to make it so that on frame 2, the score in the box will constantly go up, but it will stop for frame 3 and display it in "sb". im still a noob at as2, so im probly just missin somethin stupid, but any ideas?
Slayer
2

Posts: 2,088
Joined: May 2006
Rep: 10

View Profile
Jan 28, 2009 6:45 AM #347065
Protip: with a setup like that, they'll right click > next and then they can win.
Bonk
2

Posts: 2,778
Joined: Mar 2008
Rep: 10

View Profile
Jan 28, 2009 7:40 AM #347073
Actually Slayer that can be fixed.

Put this in the first frame of your movie:


MENU = new ContextMenu();
MENU.hideBuiltInItems();
_root.menu = MENU;



Anyway, on to the question. It shouldn't be too difficult, all you have to do is get the losing if to send you to the third frame, set the score from your sb variable into the textbox, and declare that you've lost using a variable.

To stop it continuing to go up, add an if statement into the little bit of code that makes sure you haven't lose the game yet, and only adds to the score if you haven't.


if (_root.lose == false) {
_root.sb++;
}


and in your losing if just put


_root.lose = true;


As long as you declare the lose variable to be false in the second frame on the main timeline, it should work.
doc

Posts: 1,127
Joined: Jan 2009
Rep: 10

View Profile
Jan 28, 2009 12:25 PM #347111
Slayer, the object of the game is to NOT go to the next frame, so doing that would just make u lose :D
and Bonk u r AMAZING! or im just terrible, one or the other. tx ill post the "game" on the forums in a min.
sticky505

Posts: 34
Joined: Sep 2008
Rep: 10

View Profile
Feb 1, 2009 5:19 PM #350069

MENU = new ContextMenu();
MENU.hideBuiltInItems();
_root.menu = MENU;


Bonk if you put in this would it be easier:
Stage.showMenu= false;