It all works great but I need this function written about 18 times, each time loading a different SWF file (SEE BOLD). Instead of writing this code that many times I gather by using parameters I can reference each file then call it when needed!?
[COLOR=black][/COLOR]
[COLOR=black]Is it as simple as defining each SWF as A = steve_biog.swf, B = danny_biog.swf, C, D etc? Not sure what goes where in order to call it correctly! Any help please[/COLOR]
[AS]swfArray = [“steve_biog.swf”, “danny_biog.swf”, “tanny.swf”][/AS]Defines all of the movieclip names.
[AS]
for(i=0;i<12;i++){
scrollItBackBiog(swfArray*);
}[/AS]calls the function, passing each string in swfArray. It would recieve steve_biog.swf, danny_bio.swf, etc.
[AS]
function scrollItBackBiog(swfName:String){[/AS]variable swfName is recieved as a String.[AS]
_root.container3._alpha = 100;
_root.container3.alphaTo(0, .4, “easeOutCubic”);
_root.container2.PAGE.SUB.tween("_x", 362, 1, “easeOutCubic”, 0.5);
_root.container2.PAGE.tween ("_x", 307, 1, “easeOutCubic”, 0.5);
_root.btns_container.alphaTo(100, 1, “easeOutCubic”, 1);
_root.biog_cntr._alpha = 0;
_root.biog_cntr.loadMovie(swfName);
_root.biog_cntr.alphaTo(100,2,“easeOutCubic”,1);
_root.container2.btns_mc.alphaTo(100,1,“easeOutCub ic”, 1);
_root.container2.back_btn._alpha = 0;
_root.container2.caption._alpha = 0;
}[AS]Everything remains the same except for [AS]_root.biog_cntr.loadMovie(swfName);[/AS]which loads the mc passed to the function.
Do you want to call it 18 times in a row, or have 18 buttons and each button calls that function once? The above comments are assuming you want to call it 18 consecutive times before the SWF does ANYTHING else. Please advice and we can give further advice.
Ahhh I C. Basically I have a page on my site that contains 18 staff members and when the user clicks on a picture the page slides in with their biography on it. So I dont want it called consecutively…just want the code to be written once and depending on whose clicked the code brings in the relevant swf.
Forgive me for being dense, but thank you so far, however…does this not still require me to have the function written 18 times each time referencing each person? Thats what I make of it! But as i’m new to Flash I could be misunderstanding what you are saying.
By (refName) am I meant to actually put ‘refName’ or reference the name of the file i’m calling? Perhaps that sounds stupid but i want to understand the code fully.