I am kind of new to AS and I want to load and external SWF file when I click a button and give a progress of the download.
I followed a tutorial in order to get this done.
Everything works great except it’s loading the movie immediatly instead of when you click the button.
As its loading I can click the button and it starts reloading. So I believe it is working.
I don’t want it start loading until you click the button.
Can someone tell me how to rearrange the code in order to do that.
Here is the code:
var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();
mclL.onLoadProgress = function(target,loaded,total) {
loader.percent.text = Math.round((loaded/total) * 100) + “%”;
}
mclL.onLoadInit = function() {
loader._visible = false;
loader.percent.text = “”;
}
mcl.addListener(mclL);
mcl.loadClip(“benelli2.swf”,holder);
b1.onRelease = function() {
loader._visible = true;
mcl.loadClip(“benelli2.swf”,holder);
}