Search Tutorials
The ActionscriptThe way we achieve to assign a URL to a certain text is to create a dynamic button. The button is dynamic in that sense that it can be en- or disabled, its visiblility be changed and of course most important its URL can be changed. But letīs now have a look at the script, which we go through stepwise. We first create the search function as shown in the previous tutorial.
//we have to disable the button for the moment until we activate it
_root.nameBut.enabled = false;
//this is the function for the search engine
function searchSite() {
flashSite = new XML();//here we create an instance name flashSite, which will hold the XML file.
flashSite.load("url_flashkit.xml");//loading the Instance with content
flashSite.onLoad = findSite;//once loaded the function findSite will execute
//we check if the file is loaded
if (this.loaded) {
headline = "Text loaded."
}else{
headline = "Text not yet loaded."
}
//with this function we will get access to the xml tree
function findSite() {
//"flashSite" contains the xml file
for (var count01=0; count01 <= flashSite.childNodes.length; count01++) {
Here I would like to point out a typo mistake in the previous tutorial. The instance name there was īmodelī, however the instance name in the loop was by mistake īmodelsī, which is undefined. Nevertheless the script was executed. I still do not know the exact reason, why it could be executed but I know that it was possible because we had model.ignoreWhite = true;and if we leave that out the script would not have been executed. Actually we did not need the ignoreWhite statement. So after this event I also belong to those who recommend to try to execute the script leaving out the ignoreWhite statement. This statement is, however, useful to detect the white space using trace for example and adjust the script if necessary.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|