These are the Instructions for the Eleventh module of this course:


This week we are going discover the power of Movie-clip symbols.
We will use movieclips to organize the content of our project, this means that animation, and the typical stacks of layers will not longer be present on the main Timeline.

Animation, series of images, slideshows, sounds... will be all organized INSIDE movieclips. You will doubleclick them on Stage to see how they look together with other elements, and you will test them by exporting the movie (space bar_shift is the shortcut to test a movie).

We can place frame-actions and frame-labels INSIDE a Movie-clip-Timeline, just place them in an upper layer called ACTIONS.
You can also place active buttons inside a Movie-clip symbol.
They will be able to make the the movieclip's timeline move using actionscripting, OR they can "talk to a different Timeline" (most often the main project's timeline, called root)*.

 

Scripting with Movie-clip symbols.

We are going to discover how a button in the main Timeline can “TALK” to a Movie-clip also present in the main timeline.

For a button to be able to call a movieclip, also present on the main Timeline, you need to Name the movie-clip on Stage (by selecting it and entering the name on the Properties panel).
Once you name your movie-clip symbol on Stage and create the script for your your button, the action will be able to pass the command to the Movie-clip’s timeline.

Like in:” Call Rose and tell her to invite her friends”, or "call rose_mc and tell it to play from frame 2", we identify the movie we are referring to, and then give the intended message to that movie.

A button on the main Timeline calling a movieclip named rose_mc when the button gets pressed:
AtionScripting 3.0

function callRose (event:Mouse Event){
rose_mc.gotoAnd Play(2);
}

phone_btn. addEventListener (Mouse Event.CLICK, callRose)


*When you want a button placed INSIDE the movieclip to "talk" to the main timeline,
you will have to refer somehow to the main Timeline in the dot syntax.
ActionScripting 3.0

The main Timeline in Action Scripting should be refered through a formula called "a MovieClip constructor" that calls the root or main timeline.

function callHome (event:Mouse Event){
MovieClip(root).gotoAnd Play(2);
}

phone_btn. addEventListener (Mouse Event.CLICK, callHome)


Using non interactive Sound in projects.

Sound-files playing as a soundtrack tend to be bigger files, please see how the sync mode is set to “Streaming” when you are trying to play a longer sound ALONG THE TIMELINE OF a movieclip symbol.

This way the movie will play meanwhile is still loading the rest of the sound instead of getting stuck until the complete file has got loaded.
(Event and Start syncing modes don't begging playing the sound until the whole file is loaded on cache!).

Streaming sounds play in sync with the timeline, so if you have an animation that has to play exactly in sync with the sound (like a talking head to a piece of dialogue), place the animation together with the sound inside the the sound movieclip.

In your assignment, streaming sounds will be placed INSIDE a movieclip, called on Stage so und_mc.

The first frame of the sound movieclip should be left empty of content.
If you don't want the sound to play straight ahead (to stay paused until the user clicks the play button),you should place a stop action on frame 1 .
The sound-file should be attached to a keyframe on frame 2 and set to Streaming mode.


If you want the sound to loop through the project, place an ACTION at the end of the sound file, in the last frame (in the ACTIONS layer, at that corresponding place in the Timeline) and type this code:
gotoAndPlay(2);
This way, the playhead will not touch again frame 1. where the stop is placed.

On the main timeline you will place a Play and Stop buttons so the user can control the soundtrack of the project..
Those buttons will have an action talking to the movieclip so und_mc.

 

The Script for the PLAY button will look like:
ActionScripting 3.0
If you want it to play from the very beginning

function soundPlay (event:Mouse Event){
sound_mc.gotoAndPlay(2);
}

play_btn. addEventListener (Mouse Event.CLICK, soundPlay)

 
If you want it to play from the last point it was paused

function soundkeepPlaying (event:Mouse Event){
sound_mc.Play();
}

play_btn. addEventListener (Mouse Event.CLICK, soundkeepPlaying)


The Script for the STOP button will look like:
ActionScripting 3.0
If you want it to Stop,

function soundStop (event:Mouse Event){
sound_mc.gotoAndStop(1);
}

stop_btn. addEventListener (Mouse Event.CLICK, soundStop)

 
If you want it to pause at that point, and be able to play from there,

function soundStop (event:Mouse Event){
sound_mc.Stop();
}

stop_btn. addEventListener (Mouse Event.CLICK, soundStop)

 


Preparing for streaming your files over the web.

I want you to notice that you are testing your flash movies in your local computer: there is NOT loading waiting time because your files are living in and playing from the same CPU.


When your swf-file is embedded in an html page and living on a Server, it is going to be a totally different story.
Then the speed of the server, the bandwidth of the connection the user has at the time, are all going to be factors.
The most delicate time is the waiting for the first content of the page to load, until then the user will only see the background color of the project.
If a big piece of media is placed on a certain frame, Flash might bet a bit stuck on the previous frame, waiting for that big chunk to be loaded into memory.

If you want to get a taste for what is to see a flash-movie streaming in different case-scenarios, you can set the downloading settings in the flash Player when you test the movie, and then choose View> simulate download.
You should set the download settings first, to whatever type of connection you want to test.

By now you might understand why I have been so insistent on file-size and file-compression: every bit of your file size needs to be loaded, and that means waiting time.

Under that same VIEW menu in the FLASH PLAYER (not in the Flash program-menu!), you will find an option called bandwidth profiler.
When the bandwidth profiler is turned ON in the Flash Player, you can access very interesting information, like the swf file-size, duration, and size of each frame.
It will also show you what percentage of the file has been loaded when you later on select the "simulate download" feature.

 

 

Complete this week's assignment with an Interactive piece using a movieclip to organize the content.

I am sending you 3 sample files. They are slightly different projects.
Please review them all and use them as inspiration for your own little project.
Analyze the advantages of using movieclips for your content.
Review the Action Scripting syntax for: how to "call" a movieclip" from a button placed on the main Timeline. Also on how to call the main Timeline from a button contained inside a movieclip (see "tell_movie.fla").

Post your comments or problems you think the rest of the group can share, advice ideas and more on the “discussion group n 11 ”.