A game (remember Half-Life) can be a sequence of many maps/levels, like a labyrinth. The player needs to win some challenges at each map and go to the "right" next map. He can have many doors to go and, if he goes to the "wrong" new room it will need to come back etc. etc.
At this lesson we will learn how to go to a next level (no challenges here). It's easy. The character needs to cross over a "shadow-to-another-map". This is a trigger to the Flash main film to go to another frame where we have the other map.

If the new map is at the frame 25, by example, the "shadow-to-another-map" can have a program like:
onClipEvent(load){
this._visible = false;
}
onClipEvent(enterFrame){
if (hitTest(_root.base._x, _root.base._y, true)){
_root.goToAndStop(25);
}
}
We need to create the possibility to the player come back to previous maps.
You can also call another film using:
loadMovie("map2.swf", _root)
Look to our sample. Click in the figure to activate.Use the arrow keys to walk. Try to go to the next room and come back.
PREVIOUS LESSON NEXT LESSON T. CONTENTS HOMEPAGE