Game Development Reference
In-Depth Information
protected function securityError(e:SecurityErrorEvent):
void {
protected function asyncError(e:AsyncErrorEvent):void {
Using the CutsceneManager
At this point we
ve written less than 100 lines of code, and they will
allow us to easily call in a video for use as a cutscene in less than five.
Open up a new FLA file in Flash and save it next to the Cutscene-
Manager class. Set the FLA dimensions to 710
386, the original size
of the video we
Encoder example mentioned earlier in this chapter, copy the Cuts-
same file in the Chapter 9 examples folder. Then, on the first frame of
the FLA, add the following lines:
var cm:CutsceneManager = new CutsceneManager(stage.stageWidth,
cm.playCutscene( " Cutscene.f4v " );
You should see the video starts to play, filling up the whole
Stage. Since we haven
t specified another key, press the space bar
before the video finishes and you will see it go away quickly and
cleanly. If we want to get information about when the video
finishes playing, all we need is a few more lines:
cm.addEventListener(Event.COMPLETE, cutsceneFinished, false, 0,
function cutsceneFinished(e:Event) {
s it. This class will work with any format of Flash-compatible
video and will save a lot of time when you
re in a crunch. This
class could also be modified pretty easily to work with a menu
background loop as well. Instead of clearing itself when the
video reached the end, it would simply need to loop back to the
beginning. You would also probably want to remove the skip
Search Nedrilad ::

Custom Search