Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-07-2007, 06:13 PM   #1
Registered User
Join Date: Apr 2005
Posts: 13
Send a message via MSN to ecptavares
Question How to load a swf file into an empty MC and preload it?


I got this code here at Kirupa.com and I use it to load the main page when a user first enters my web site.What if I wanted to use a preloader to preload each external swf File?How would I do it?How would I load a swf file into another empty movie clip?

can I make a class with this preload code so I can use it for any swf file or main movie?How?

The Code:


var request:URLRequest = new URLRequest("content.swf");
var loader:Loader = new Loader();

loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);

function loadProgress(event:ProgressEvent):void {
    var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
    percentLoaded = Math.round(percentLoaded * 100);
    trace("Loading: "+percentLoaded+"%");
function loadComplete(event:Event):void {

ecptavares is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 06:45 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.