Design storytelling web experiences in Flash CS3
19 Reusing elements
19 Reusing elements

Copy and paste the frames from the animation in the main scene for the instructions (include the mask). A warning window will show – click Don’t Replace. In the instructions Movie Clip, change the descriptive text to something associated with the scene, and get rid of the character.
20 Loading the next scene
In the main timeline on the Action layer, insert a Keyframe on the last frame. For this, write code ‘a’. Insert two Keyframes after that. In the first one, write code ‘b’. For the second one, copy and paste the same code. If we have had another movie, we would have replaced the name scene1_a. swf to that.
(a)
stop();
btn1.onPress = function () {
gotoAndPlay(“content1”);
}
btn2.onPress = function () {
gotoAndPlay(“content2”);
}
(b)
stop();
loadMovie (“scene1_a.swf”, “_root.content”);
21 Creating the labels

On the labels layer, insert two Keyframes on the last two frames of the animation. Give the first one the frame label ‘content1’, and for the next ‘content2’. Now you can test your movie to make sure it’s working. Try the main.swf to see if everything connects, as it should.
22 Next and last scenes

For the next scenes, repeat steps 17-22. Change the file names to load as in step 21. For the last scene, the structure is a bit different. Copy and paste the start button on the main scene and give it the instance name ‘btn’. Make a layer for the action, insert a Keyframe on the last frame and add the code below:
stop();
btn.onPress = function () {
_level0.gotoAndPlay(“start”);
}
23 Final comments

For scene1_a and for the last scenes, you can use the scenes from the ‘final’ folder on the CD. This game contains only three scenes, but you can make it as long as you want; just add new ones and link them together. Remember, the idea is to create a nonlinear story.


Thank you for this, it’s just what I need. MY students are doing storytelling and Gamemaking this term.
Thanks Dave!
Indeed I’m working on a similar project, and the loading of external .swf on my flash is giving me a headache.
Just 2 things that I’d like to clarify,
- I notice the ActionScript is written in AS2, is it possible to load external .swf in AS3?
- What would the codes be, if they’re written in AS3?
is there live versions of these tutorials on this site? I have looked through most of them and most do not.