All global variables were eliminated and bugs removed.
copyright © Joachim Schnier
The use of this component is free, however if you use please link to my site http://can_info_guide.tripod.com/ (Flashspot).
Disclaimer: The developer of this component is not responsible or liable for any damage caused by the use of the component.
The XmlSearchEngine Component is a Flash XML-based search engine designed for CDs or for designers who want to build a script-independent database. In order for the component to work properly, please follow the instructions. If you have problems or find bugs e-mail me.
The XMLSearchableDatabase component has several search options, which can be used separately or combined.
Up to 4 subcategories can be selected by entering values for subsubitem1 to 4. In the xml file this is an attribute in the childnode with the nodevalue "subsubitem". Another subsearch can be made by using the checkbox. To activate, enter a checkbox value and values for 1. and 2. subsubitem. In the xml file use the attribute "subitem1" and give it a value.
The following node values and attributes other than the xml definition have to be used in the xml file for correctly parsing the file:
An example xml file is shown here:
<?xml version="1.0"?> <items> <subitem age="under 30"> <subsubitem subsubitem1="black"> <susan id="34" name="Susan" subitem1="french" subitem2="blue" myFrame="frame3" pic="images/susan.jpg"> <p> <b>Susan Black</b> <li>age: 21</li> <li>eye color: dark blue</li> <li>hair color: black</li> <li>height: 179 cm</li> <li>weight: 185 pounds</li> <li>foreign language: <i>french</i></li> <a href="susan.html" target="newfile"><u>Web site</u></a> </p> </susan> </subsubitem> <subsubitem subsubitem1="blond"> <monica id="12" name="Monica" subitem1="german" subitem2="blue" myUrl="monicas.html" pic="images/monica1.jpg"> <p> <b>Monica Schneider</b> <li>age: 21</li> <li>eye color: dark blue</li> <li>hair color: blond</li> <li>height: 179 cm</li> <li>weight: 185 pounds</li> <li>foreign language: <i>german</i></li> <a href="monicas.html" target="newfile"><u>Web site</u></a> </p> </monica> </subsubitem> </subitem> </items>Here is the url for one of the xml files used in the above example.
Using actionscript on the main timeline the subsubitem categorie can be changed according to which categorie was selected. Enter the names of the xml files in the component parameter window. When you select any of the susubitems radio buttons, delete "defaultValue" for only the items you select and leave the fields in the component parameter window blank. Similarly you can do this for the checkbox. Then write a script similar to the one below and put in a keyframe on the main timeline. The value for the var instancename.subSearch_1.checked is from 1 to 8 depending on which xml file is selected and how many different files you use. You have to, however, give the instance of the component on stage a name (instancename).
this.onEnterFrame = function(){
if(instancename.subSearch_1.checked == 1){
ssItem1 = "enter value A";
ssItem2 = "enter value B";
ssItem3 = "enter value C";
ssItem4 = "enter value D";
ssItem5 = "enter value";
instancename.subSearch_2.radio1b.textField.text = ssItem1;
instancename.subSearch_2.radio2b.textField.text = ssItem2;
instancename.subSearch_2.radio3b.textField.text = ssItem3;
instancename.subSearch_2.radio4b.textField.text = ssItem4;
instancename.subSearch_2.checkingBox._visible = true;
instancename.subSearch_2.checkingBox.textField.text = ssItem5;
} else if(instancename.subSearch_1.checked == 2){
ssItem1 = "enter value E";
ssItem2 = "enter value F";
ssItem3 = "enter value G";
ssItem4 = "enter value H";
ssItem5 = "defaultValue";
instancename.subSearch_2.radio1b.textField.text = ssItem1;
instancename.subSearch_2.radio2b.textField.text = ssItem2;
instancename.subSearch_2.radio3b.textField.text = ssItem3;
instancename.subSearch_2.radio4b.textField.text = ssItem4;
instancename.subSearch_2.checkingBox._visible = false;
}
}
There are two sample files given however without the images. To set up the component for basic testing enter: