macromedia flash sitedesign:
Hello all, I have this loader that starts playing the content, before the content has loaded entirely. Now this is a problem because my content still sits there and does nothing until it's all loaded anyhow. Any thoughts. Thanks \\C var requestObj:URLRequest = new URLRequest("kitoShell.swf"); var loaderObj:Loader = new Loader(); addChild(loaderObj); loaderObj.load(requestObj); loaderObj.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, preloadProgress); function preloadProgress(event:ProgressEvent):void { var loadedPercent:int = event.bytesLoaded / event.bytesTotal * 100; preloader_mc.loadingBar_mc.loaderText_txt.text = loadedPercent + "%"; } loaderObj.contentLoaderInfo.addEventListener(Event.COMPLETE, preloadComplete); function preloadComplete(event:Event):void { preloader_mc.visible = false; }
You can hide the file that is downloading until its fully loaded and/or until you want to actually use it. 1. Put a blank frame at the start of the .swf that you are loading. Tell the clip to play when you want to use it. 2. Have the content in the loaded swf contained in a movieClip and set that clip's visible property to false. Set it to true when you want to use the loaded clip. 3. Give the loader object a position off the visible area of the stage. Move the loader to the correct position on the stage once the file has loaded. 4. Set the loader object's alpha property to false, and change the value to true when the file has loaded. Mix and match and add animation as needed.
Don't see what you're looking for? Try a search.
|