.

Page 1

In this tutorial you will learn how to make a 3d preloader with Swift 3d and Flash. I am using Swift 3d version 4.50, but you can use any version. I am using Flash 8 for the flash part but you can use flash MX 2004 as well. You might be able to use previous version but I’m not sure.

Here is an example of what we will be making.

First of all open swift 3d and make a 100 frame animation for your preloader. Make sure the frame rate is the same as you will be using in flash, otherwise this won’t work. Once you have your animation export it as a .swft file so we can import it into flash.

Now open flash and click File>Import>Import to Library and find the .swft and open it. Drag it onto the stage and give it an instance name of loader. Make a dynamic text box somewhere on the stage and give it a instance and variable name of ‘ploaded’ (without the quotation marks). Now enter this code onto the frame:
_root.stop();
onEnterFrame = function () {
    ploaded = Math.round(loaded)+"%";
    loaded = _root.getBytesLoaded()/_root.getBytesTotal()*100;
    if (loaded != 100) {
        loader.gotoAndStop(Math.round(loaded));
    } else {
        _root.gotoAndStop(2);
    }
};
Line 1: Makes the movie stop on that frame.
Line 2: Means ‘When this frame is entered. So that would be 12 times a second if your frame rate is 12.
Line 3: Makes the dynamic text display the variable loaded which will be rounded off using the Math.round() function. It will also have ‘%’ displayed after the number.
Line 4: Declares a variable called loaded which is equal to the percentage of the bytes loaded. (Bytes Loaded/Total Bytes*100).
Lines 5-9: An if statement. If loaded is not equal to 100, then the MC of the loading animation goes to the frame number equal to loaded. Else the movie will go to the second frame, where you can have a stop button or something.




nice Posted on 09/09/2008

i did it, well done, works, thnx for this lil sample