1

I would like to know how a flash file plays/loads in the users PC. For instance, if my code is as below -

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"     codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="970" height="490" id="PRE" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="cmck_rhp_pre.swf" /><param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />    
<embed src="PRE.swf" quality="high" bgcolor="#ffffff" width="970" height="490" name="PRE" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

The PRE.swf file is about 413KB. When the user launches this page, how does the file actually play, as in, does the 413KB download to the user's PC and then starts to play or ...? Basically, I would like to know how flash files, be it swf or flv, play on a user's PC. This is in order to understand the impact before deploying.

UPDATE 1: If I open the swf file by typing in \\\PRE.swf, in the IE, the flash file plays. However, I do not see anything in the Temporary Internet Files folder.

Kanini
  • 1,092

4 Answers4

4

In fact, Flash movies (animation) start playing as soon as the first frame is downloaded completely, while the rest of the SWF file downloads in the background. You know those "this many percent" displays that long Flash animations put up? We Flash developers call them "preloaders", and they're there to prevent the movie from starting before it's largely or completely downloaded, so you don't get stuttering and pauses if the player tries to play frames that aren't downloaded yet

The entire SWF does get downloaded, but play starts before that.

CarlF
  • 8,872
2

Just to be sure you don't confuse things: some people refer to SWF files as "Flash movies". Others use that term only for FLV (Flash video) files.

On websites, SWF is played in the Flash player, while FLV files are played by a (small, re-usable) SWF file that shows the screen and its controls (play, pause, forward, full screen, ...) and which itself is played in the Flash player.

As far as I understand, SWF file often (or always?) are downloaded all the way before playing really starts, but Flash allows for displaying a custom animated splash screen while downloading is in progress. FLV files do not need to be downloaded all the way before playing starts, and the SWF player often also allows for skipping parts of the FLV without ever downloading it (if the server supports that too).

The Flash player uses its own cache, shared (for the current user) with all browsers on your machine.

(Also note that the <object> and <embed> thing in your example are different ways to get the same thing done in different browsers.)

Arjan
  • 31,511
1

The full flash file is downloaded prior to executing. You won't see anything in your cache when viewing it like that because you're running it locally, it doesn't need to make another copy on the hard disk.

1

It's not caching locally because it's already local! You're not using your browser to HTTP request the flash file from a remote server > therefor no need to copy to cache.

Use one of two methods to ensure SWF files are downloaded each time:

Using the 'Expires' header. The Expires header of an HTML document tells a Web browser when a cached document should expire from the cache. Using a date in the past ensures the document will always be expired.

 <!-- BEGIN INSERT --><META HTTP-EQUIV="Expires" CONTENT="Mon, 04 Dec 1999 21:29:02 GMT"><!-- END INSERT --> 

Each and every time this document is requested the browser will notice that the cached version has expired and will download the file from it's server of origin. Using the Pragma: No-Cache header. This code directs the browser to not cache the document at all.

<!-- BEGIN INSERT --><HEAD><META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"></HEAD><!-- END INSERT --> 
Charlls
  • 1,385