• Keep in touch:
  • Linked In
  • Twitter
  • RSS

What is a frame?

Flash files are animations which are built out of a series of frames just like a video or feature film. The animation itself is a series of instructions to the Flash Player to define shapes, add things to the display list, etc. A frame is simply the set of instructions executed by the Flash Player the results of which are then displayed on the screen. The Show Frame instruction tells the Flash Player to take the contents of the display list and render it on the screen. So a frame is any sequence of instructions between successive Show Frame instructions.

     movie.add(ShowFrame.getInstance());
     
     movie.add(...)
     ...
     movie.add(...)
     
     movie.add(ShowFrame.getInstance());

This means that you can execute as few or as many instructions in a frame and you will only see the final result when the frame is rendered.

While updating the display list is a cumulative operation, with shapes added and removed by successive Place Object and Remove Object instructions not all instructions operate this way, some instructions are successive where a previous instruction is replaced or overridden by a new one. Defining the set of actions to execute when a frame is displayed, using DoAction, is one example:

     movie.add(ShowFrame.getInstance());
     
     movie.add(new DoAction(first));
     movie.add(new DoAction(second));
     
     movie.add(ShowFrame.getInstance());

Only the second set of actions will be executed by the Flash Player when the frame has finished being rendered. The first set is ignored. Setting the label for a frame using FrameLabel is another example of a successive instruction.