Featured FLA
» Author: Bugra Ozden
» Title: Skatalog v9 - product catalog
» Description: Create your product catalog easly and publish on your website or Create your image gallery, documents list, portfolio. Fully XML Driven
» More by Bugra Ozden
Featured Site
» Posted in the Flash Kit Links section
» Title: Creative DW Image Show PRO
» Description: Creative DW Image Show PRO is a Dreamweaver extension which enables the user to create multimedia presentations. It combines the features of the popular Creative DW Image Show with the ability to add professional text effects to slides (similar to After Effects). The product is very customizable: the user can choose the duration of the transition effects, the slide motion start and end position, zoom and panning type for both images and texts.
The Fla file: Actionscript for buttons, uploading the XML file
Now open the actions panel and have a look at the scripts. At the top of the page is the preload script. Check the script attached to modelHolder_1 to learn more about tracing the loading event. Any way, we first create a general function with two arguments, which will be for the individual name buttons. We call the function ´showModel(modelName,fileName)´. The var modelName is the actual name of the model such as Kim for example. The var fileName is any XML file we want to upload.
//function to preload pics
function loadAll(firstPic,lastPic,picName){
for (j=firstPic;j<=lastPic;j++) {
duplicateMovieClip (_root.modelHolder_1,"pic_"+j, j);
setProperty ("pic_"+j, _alpha, (0));
loadMovie(picName+j+".swf","pic_"+j);
loadMovie(picName+j+".swf","modelHolder_1");
setProperty("modelHolder_1",_alpha, (0));
}
}
loadAll(1,6,"pic_");
loadMovie("agency.swf","modelHolder");
//general function to upload and get access to the xml files
//for the buttons
function showModel(modelName,fileName) {
//this is to empty the preloader textfield
counter="";
//variables for the name of the model and for the xml file
var modelName;
var fileName;
//uploading the xml, model is just an instance we use here
model = new XML();
model.onLoad = newModel;
//this facilitates accessing the xml tree, since white
//space is also considered childnode
model.ignoreWhite = true;
model.load(fileName);