Flash movies with multiple external assets can cause the browser to lock up if external Flash assets (videos, images, voice-overs, etc, that are not stored within the SWF) are unmanaged or managed improperly. I’ll use a Scorm-compliant course as an example; the example course navigates from screen using inline Back and Next buttons, and each screen loads unique external animation and voice-over to deliver the lesson topic.
When a user navigates from Screen #1 to Screen #2, any outstanding, incomplete asset downloads from Screen #1 should be stopped before beginning Screen #2 asset downloads. Failure to do so may cause the browser’s request queue to overflow, and freeze the browser window.
Such is the case when assets are not properly managed: when a user navigates from Screen #1 to Screen #2, the Screen #1 assets continue to download with the #2 assets. Likewise, when the user navigates from Screen #2 to Screen #3, assets from Screens #1, #2, and #3 are all downloading. When Flash is downloading enough concurrent assets, a request queue overflows, freezing the browser.
IMPORTANT: Users clicking Next rapidly is not the only cause of this issue. Rapid Next is just the easiest way to recreate it. The important point is that users are clicking next faster than Flash can download the other assets. In other words, navigation is adding assets to the download queue faster than Flash can download them, and the queue is filling up.
Example Code that causes the problem: narrator = createClassObject(MediaDisplay, “My_VoiceOver”); narrator.setMedia(”/Assets/MyVoiceOver.mp3″, “MP3″); // … code omitted … // … do some stuff … // … do some stuff … // … code omitted … // commented out code // destroyObject(”My_VoiceOver”);
Example Code that causes the problem: narrator = createClassObject(MediaDisplay, “My_VoiceOver”); narrator.setMedia(”/Assets/MyVoiceOver.mp3″, “MP3″);
// … code omitted … // … do some stuff … // … do some stuff … // … code omitted …
// commented out code // destroyObject(”My_VoiceOver”);
The code above creates a new object that loads and plays an MP3. However, (because the line of code is commented out) the object is never destroyed and continues to download. If this function is called repeatedly, each time against a different voice-over file, the queue will overflow and the browser will freeze. The same will occur wherever destroyObject (or similar command) is not called. To fix the code in the above scenario, destroyObject must be uncommented, allowing the object to be destroyed, thus stopping the MP3 download.
Note: This is not the only code scenario that would create this browser-freezing problem. There are many possible commands and variations.
Remember Me