graphic_inc
08-18-2007, 02:40 PM
Hi - I'm trying to create a site whereby I have a 'base' swf that contains navigation buttons & a blank 'holder' movie clip in which external swf files will load when each button is clicked. The external swf files will be the main sections of the site & these also have sub navigation buttons, that I would like to also be able to load other external swf files into the 'holder' on the root timeline of the base swf.
The code I have used in my base swf is as follows, which is based on a Flash tutorial file by Lee Brimelow at http://www.gotoandlearn.com/download.php
stop();
var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();
mclL.onLoadProgress = function(target,loaded,total){
loader.percent.text = Math.round((loaded/total) * 100) + "% LOADED";
}
mclL.onLoadInit = function(){
loader._visible = false;
loader.percent.text = "";
}
mcl.addListener(mclL);
mcl.loadClip("intro.swf", holder);
intro_btn.onRelease = function(){
loader._visible = true;
mcl.loadClip("intro.swf",holder);
}
portfolio_btn.onRelease = function(){
loader._visible = true;
mcl.loadClip("portfolio.swf",holder);
}
contact_btn.onRelease = function(){
loader._visible = true;
mcl.loadClip("contact.swf",holder);
}
This all works fine & each of the buttons function correctly. However the buttons I have in my external swfs that load in, fail to work. An example of the code for these is:
stop();
print_btn.onRelease = function(){
_root.loader._visible = true;
_root.mcl.loadClip("rama_knight.swf",holder);
}
web_btn.onRelease = function(){
_root.loader._visible = true;
_root.mcl.loadClip("rama_knight.swf",holder);
}
identities_btn.onRelease = function(){
_root.loader._visible = true;
_root.mcl.loadClip("rama_knight.swf",holder);
}
I don't understand why & am pulling my hair out over this. Can anybody please help - any advice would be appreciated as my actionscript knowledge is very limited (as you can probably tell).
Thanks:)
The code I have used in my base swf is as follows, which is based on a Flash tutorial file by Lee Brimelow at http://www.gotoandlearn.com/download.php
stop();
var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();
mclL.onLoadProgress = function(target,loaded,total){
loader.percent.text = Math.round((loaded/total) * 100) + "% LOADED";
}
mclL.onLoadInit = function(){
loader._visible = false;
loader.percent.text = "";
}
mcl.addListener(mclL);
mcl.loadClip("intro.swf", holder);
intro_btn.onRelease = function(){
loader._visible = true;
mcl.loadClip("intro.swf",holder);
}
portfolio_btn.onRelease = function(){
loader._visible = true;
mcl.loadClip("portfolio.swf",holder);
}
contact_btn.onRelease = function(){
loader._visible = true;
mcl.loadClip("contact.swf",holder);
}
This all works fine & each of the buttons function correctly. However the buttons I have in my external swfs that load in, fail to work. An example of the code for these is:
stop();
print_btn.onRelease = function(){
_root.loader._visible = true;
_root.mcl.loadClip("rama_knight.swf",holder);
}
web_btn.onRelease = function(){
_root.loader._visible = true;
_root.mcl.loadClip("rama_knight.swf",holder);
}
identities_btn.onRelease = function(){
_root.loader._visible = true;
_root.mcl.loadClip("rama_knight.swf",holder);
}
I don't understand why & am pulling my hair out over this. Can anybody please help - any advice would be appreciated as my actionscript knowledge is very limited (as you can probably tell).
Thanks:)