First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: Troy Limacher | Website: http://www.geocities.com/helenandtroyuk

Creating new rooms

This might seem a bit long or complex to start with, but it is very easy.  It is all cutting and pasting.
To create a new room you just need to copy & paste the section of script in the 2nd keyframe that reads -

if (_root.Place == 0) { //First room
	_root.texty = "You have no idea where this place is.  Bright light illuminates the room from a strange pyramid shaped bulb overhead.  You squint at it but realize that this is unnecessary as the light is quite comfortable to look at directly.  The room is quite bare, there is a door to the right.";
	_root.image1._visible = true;
	if (Key.isDown(Key.ENTER)) {
		if ((_root.inputy == "open door") or (_root.inputy == "go right") or (_root.inputy == "right")) {
			_root.Place += 1; //Go to Second Room
			ResetAll(); // Go to function in keyframe 1

The Place variable is a scene or room in the game.  Change this to another number, describe the new room in 
texty which then copies over to the textbox. The inputy line defines how to get to the new scene, you can write
anything in here, 'north', 'south', 'open door' etc.
If you have an image for this scene set it to visible here but make sure to set it to visible = false in the ResetAll function, keyframe 1.

Creating new objects

To create a new object first specify which room or Place it will be found in.  Copy this line of script you can
see in the first few lines of keyframe 1.  Change the name to Object2Position = (Place to be found);

_root.Object1Position = 0; 

Also copy and change this variable to object2.

_root.Object1 = 0; // Ensure First Object actions only occur once.

In the AddObjects function, copy and paste the following code, then change the variable for object1Position to 
object2position and change the "box" description.

if (_root.Object1Position == "bag") {
		_root.listbox1.addItemAt(0, "box"); //Update items held box

Then copy the following script found in the OBJECTS section of script, keyframe 2 -

if ((_root.Object1Position == _root.Place) and (_root.Object1 == 0)) {
	_root.objecty = _root.objecty+"There is a SMALL BOX SHAPED OBJECT on the floor";
	_root.Object1 = 1; //the purpose of object1 is just to ensure that this line is added only once.

Add a number to the variables (object1Position will be object2Position, etc.).  Add a description for the object in
objecty. Then copy the sections below this and just change the variables & descriptions to suit the new object.  This 
will define how to get, drop and use the object.  Obviously you can create any commands you want, throw object, move
object, push object, etc.  There are 2 responses for the 'use object' input, if you are not in the right room when
you use the object you need a response to say 'The object doesn't work here.'

» Level Intermediate

Added: 2003-10-20
Rating: 7 Votes: 39
(10 being the highest)
» Author
I write Flashscript for a plasma screen in the CTRL Project in London.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • 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: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
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: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.