First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing! | Flash Jobs
Search tutorials
Author: Jesse

Note: If you are reading this, you probably should have read my other tutorial, making a cool multi-level game. OK, first thing's first. Open a new Flash document and create a movie clip called character and draw a person on a scooter.(Don't put the clip on the stage, though.) Then, make another movie clip(not on the stage) and call it energy. Draw a red rectangle. Then make a movie clip called ready and make an animation saying "READY, SET, GO!" Then, type the following code in the last frame, and remove all of the graphics:

 _root.inPlay = true
stop()

Now make a movie clip called gameOver. Draw a rectangle and make a text field saying "GAME OVER! PLAY AGAIN?" Now make a text field saying "Type in password:" Then make an input text field with a variable name of passwordText. Finally, make a movie clip called wrongPassword and a movie clip called ok. In the ok movie clip, put in a red circle and a text field saying ok. Put a rectangle with a text field saying "WRONG PASSWORD" in the wrongPassword movie clip, and then put in the ok movie clip and in the actions panel, type in the following script:

on(press){
	_parent._visible = false
}

This code just makes the wrongPassword movie clip invisible when you press the ok button. Put these in the gameOver movie clip. Give the wrongPassword clip an instance name of wrongPassword. Go to the actions panel for the gameOver movie clip(The first frame) and type in the following script:

wrongPassword._visible = false

After you've done that, go to the actions panel for the ok movie clip and type in the following script:

on(press){
	for(a=1; a<=_root.passwords.length; ++a){
		if(_parent.passwordText!=undefined && _parent.passwordText!=””){
			if(_parent.passwordText==_root.passwords[a-1]){
				_root.level = a-1
				_root.loadLevel()
				_parent._visible = false
			} else {
				_parent.wrongPassword._visible = true
			}
		} else {
			_root.level = 0
			_root.loadLevel()
			_parent._visible = false
		}
	}
}
» Level Intermediate

Added: 2004-12-29
Rating: 6 Votes: 14
(10 being the highest)
» Author
I love making flash games but it's really annoying when Flash doesn't work!
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.