FREEINTERACTIVEPROOFING.COM

proof of delivery system - www.freeinteractiveproofing.com

Menu


Choose Control > Test Movie to preview the movie. In the preview window, choose View > Simulate Download to see the animated


preloader. As the movie loads, the glass fills and the percentage changes on the screen. Changing the Visibility of Movie Clips The preloader does its job now: you can tell how much of the movie is loaded, and it's entertaining. However, if you watch the movie long enough, you'll see that the preloader appears whenever the movie fades. To correct that problem, you'll change the visibility of the preloader instance so that it no longer appears once the movie has loaded. 1. In the Actions panel, add an event listener to determine when the file has loaded: loaderObj.contentLoaderInfo.addEventListener(Event.COMPLETE,preloadComplete); As before, you're adding an event listener to access the Loaderinfo object for the loaderObj loader you created. This time, however, you aren't listening for progress. The event listener only dispatches when the file has completely loaded. Then it calls the function called preloadComplete. [View full size image] 2. Define the preloadComplete function by adding these lines in the Actions panel: function preloadComplete(event:Event):void { preloader_mc.visible = false; } In this function, which is called when the movie has loaded, the visible property of the preloader_mc instance is set to false, meaning that it is no longer visible. [View full size image]   Caching Bitmaps Flash includes a bitmap caching feature, which enables you to play back complex animated vector graphics without sacrificing the quality of the movie's performance. You can specify that an object be cached as a bitmap at the time the movie is run, preventing Flash from having to continually redraw the symbol. Bitmap caching is ideal for complex movie clips where the position of the objects changes, but the shape or content does not change. 1. Close the Actions panel. 2. Select the Preloader layer, and then select the preloader_mc instance on the Stage. 3. In the Property inspector, select Use Runtime Bitmap Caching. [View full size image] Note You can apply bitmap caching in the Property inspector, or you can simply add a line of ActionScript. To apply bitmap caching through ActionScript for this project, you would add this line of script: preloader_mc.cacheAsBitmap = true; The fizzy drink lets the viewer know that the main site is loading, and keeps the viewer entertained at the same time. You can use this basic process to activate a preloader for a wide range of websites.   Review Review Questions 1 What is a preloader 2 What is the advantage of caching a bitmap 3