Timelines in Flash?

Timelines in Flash

First thing we need to understand about Flash is that Flash sees all scenes in a movie as one continuous timeline. If you have for a first scene in a Flash movie, a scene called intro occupying 20 frames on the timeline, then the first frame of the next scene would be (as far as Flash was concerned) frame 21. This is yet another reason why hard-coding frame numbers is a bad idea (avoiding confusion) and why we should always use labels. We should also avoid using the syntax gotoAndStop(“scene2”,10) where we are instructing Flash to gotoAndStop at a particular frame number in a named scene. This will cause problems when trying to target frames in the main timeline when e.g. using a button inside a movieclip.If we always use labels - these problems will simply go away.

The main timeline

is referenced by the term _root – if Macromedia had simply called it main timeline in the first place it would have been easier to understand as _root is not a very human friendly term but if you simply remember that it always means the same thing when you are targeting it from inside a movieclip inside the same Flash Movie then you won’t go far
wrong.

What do you mean ‘from inside the same movie’?

Well it is possible to load one movie into another and this is where the method of targeting the main timeline becomes slightly different and can initially seem a little confusing.

Why would we want to do that anyway?

OK we’ll come back to the _root timeline targeting issue shortly – let’s first consider the reasons why we would want to do this.Well there are a couple of reasons why we would consider this to be a good idea and they are as follows:

Efficiency – When we load a Flash movie on the web we of course would like it to load as quickly as possible, now if you think about it let’s say you had a movie that contained 50 jpg images – that’s a lot of loading before we get to see anything and if for example I only wanted to see one particular image it doesn’t make sense for me to have to wait until the other 49 load before I get a chance to see the one that want.

So how does keeping them outside of the main movie help?

By keeping them outside of the main movie it is possible to drastically reduce the file-size of the interface e.g. instead of having to load 10megs worth of jpgs we could now simply load a small interface (maybe 100k )and then load the jpgs in ‘on demand’ i.e. as we needed them . So consequently if I only wanted to see a single jpg I would now only have to load the interface (100k) and then select the jpg that I require. And as 100k is only one percent of 10 megabytes, that represents a saving of 99% - good eh!

Is that the only reason?

No, there’s more! Another major reason is to keep things modular i.e. separating content into separate movies e.g. you may have a portfolio movie called portfolio.swf – now if this was a separate movie and for example something was not working in this section it would be much easier tracking down the fault.

We could look at it like this:

In a car we have many pieces that work together to hopefully enable us to have a good motoring experience. Now some of these bits are situated inside the car with us e.g. CD player, steering wheel even the seats and this makes perfect sense. OK what doesn’t live inside the car? Well for a start, we don’t keep the engine in there, or the exhaust, they sit outside in their own Flash movies happily doing what they are meant to do (like a long sound-file playing in a different level). We don’t ever need to bring these inside the main movie they just work in parallel with our interior (main movie).Anything else?Yes on occasions we may want to get something out of the boot and bring it into the interior – this is the equivalent of loading it into a movieclip – like the jpgs I mentioned before ‘on demand’. We may even want to stop and get something from the garage and bring it in e.g. some sweets/magazines from the garage (this is the equivalent of loading things from elsewhere on the web).We may even want to get something that we have been storing in the garage maybe to transport it so that we can use it somewhere else (things stored in a database). Now if we think back to reasons why keeping things more modular is a good idea, if for example the car doesn’t start we don’t think ‘right lets take the seats out and see if that fixes it!’ We have a pretty good idea that the problem probably lies in the external engine.swf so we check there first. Similarly if we have a flat tyre we also don’t think ‘I know we’ll pullsome of these shiny things out of the engine and see if we can find a spare tyre in here, because we remember that our spare tyre is actually a movieclip that is included inside the boot.swf external movie.

more


Module specific sites

Personal Portfolio Website Module - Graphics Students

Second Year Online Radio Part 1 DE786

Second Year Innovation 3

Third Year Investigating Change part 1 DE687

 


Second Year Tutor Questions

 

Feedback Forms - please fill in
thanks

Trev

 

Feedback Form Investigating Change DE687

 

Feedback Form Innovation 3 DE787

 

Feedback Form Radio Module DE786