AddThis Social Bookmark Button
Tutorial (part 3)
Go back into Control > Test Movie and in the View menu be sure that Streaming Graph is selected. If you look at our streaming you will notice a peak reaching nearly 64KB on the first frame (fig11). This peak is created by the combo box component that is exported on the first frame and the classes associated with it.

streaming graph
fig11

In the library right click on the component and select
Linkage then in the window unselect Export on first frame. Then go in File > Publish Settings, select the flash tab and next to Actionscript version click on Settings, in the window that pops up enter 2 in the field export frame for classes. (fig12)

export frame for classes
fig12

Go back into Control > Test Movie and look at the Streaming Graph (fig13). You will notice that the amount of data to load on the first frame is under 200 Bytes, this data is actually the preloader itself, Now if you Simulate Download you will see that the preloader appears straight away.

streaming graph
fig13

Now let's have a look at the code ...

stop();

var initX:Number = _root.preloader.mask._x;

myInterval = setInterval(checkLoading, 50, this);

function checkLoading(path) {
var amount:Number = (path.getBytesLoaded()*100)/path.getBytesTotal();
path.preloader.mask._x = initX+(amount*_root.preloader.mask._width)/100;
path.percentageLoaded.text = Math.floor(amount);
updateAfterEvent();
if (amount == 100) {
clearInterval(myInterval);
path.gotoAndStop(2);
}
}

Continue to next page...
AddThis Social Bookmark Button
If you think this page is providing useful information, don't hesitate to leave a comment.
flashvalley
 
Copyright ©2006-2008 flashvalley.com - All rights reserved