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.
We now have to create listbox functions. The first function is the changehandler for the listbox called chooseMenu(myList). First we clear our movieholder, then we define the Value of the listbox, which is the var modelDescription. If that is not undefined, then we either upload a textfile with the description or if we access the description as the first child in our XML file.
//listbox changeHandler function
function chooseMenu(myList) {
movieHolder.unloadMovie();//we clear the movieholder, every time a listbox
//item is selected. "modelDescription" is the value for each item.
modelDescription = myList.getValue();
if (myList.getValue()!=undefined){
//we either execute the loadVars function(see above) or show the nodeValue
//in the main textfield "InstanceName_0.text" depending on what
//modelDescription will hold. When you execute this with "Test Movie",
//there will be a complain, because either hasn't been found but that does not
//matter for execution of the movie itself.
loadText(modelDescription);
InstanceName_0.text = modelDescription;
}
}
The actual function combining the list and changehandler is chooseModel(model,description). We define here by myList.addItem() that to each modelName model there will be a modelDescription description. Then we set the changehandler function, which we have defined above so that whenever the user clicks on an item (model) the corresponding whatever it is (description) is shown. This can be a url, movie, picture, anything which we define.
//function for the listbox
function chooseModel(model,description){
//this script defines the item "model", which is "modelName" and its
//value description, which is "modelDescription". All items will be listed.
myList.addItem(model,description);
//this will execute the above function and only one item be selected.
chooseMenu(myList);
myList.setChangeHandler("chooseMenu");
}