# ActionScript Preloader/Advanced Question

**URL:** <https://forum.kirupa.com/t/actionscript-preloader-advanced-question/215870>\
**Category:** flash\
**Created:** [February 11, 2007, 3:38pm UTC](https://forum.kirupa.com/t/actionscript-preloader-advanced-question/215870 "2007-02-11T15:38:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JayFranchize](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@JayFranchize](https://forum.kirupa.com/u/JayFranchize)\
**Post date:** [February 11, 2007, 3:38pm UTC](https://forum.kirupa.com/t/actionscript-preloader-advanced-question/215870/1 "2007-02-11T15:38:58Z")

</div>

Here’s my actionscript:

//-----------------------------------------------------------------------------------

// state variables

var total = getBytesTotal();  
var loaded =getBytesLoaded();

// Create the Load Bar

var loadBar:MovieClip = createEmptyMovieClip(“loadBar”, getNextHighestDepth());  
loadBar.\_x = 200.0;  
loadBar.\_y = 370.0;  
loadBar.lineStyle(2, 0x000000, 100);

// create housing clip

var container:MovieClip = createEmptyMovieClip(“container”, getNextHighestDepth());  
var con:MovieClipLoader = new MovieClipLoader();  
var conL:Object = new Object();

//create the onLoad progress

conL.onLoadProgress = function(target, loaded, total) {  
percent.text = Math.round((loaded/total)\*100)+"%";  
loadBar.lineTo((int((loaded/total)\*100)),0);  
};

//call these actions once loaded

conL.onLoadInit = function() {  
loader.visible = false;  
loadBar.visible=false;  
percent.text = “”;  
};

con.addListener(conL);  
con.loadClip(“3.jpg”, container);  
//---------------------------------

Everything works the way I want it to, except for the loadbar; it doesn’t scale or move when an image is loading. So, I need it to scale to show the load progress in addition to the text percentage…so that’s my issue…the loadbar showng the download progress…and once the image has fully downloaded, I need the loadbar to be invisible, removed, or deleted …any assistance would be grand…
