Esto esta en el primer frame:
Código :
stop();
_root.nameBut.enabled = false;
//this is the function for the search engine
function searchSite() {
flashSite = new XML();
flashSite.load("url_flashkit_goto.xml");
flashSite.onLoad = findSite;
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++) {
if (this.childNodes[count01].nodeName.toLowerCase() == "flashkit") {
flashkitContent = this.childNodes[count01];
}
}
findUrl(flashkitContent);
}
function findUrl(thisUrl) {
for (var count02=0; count02<=thisUrl.childNodes.length; count02++) {
//we are defining the var modelName here
urlName = thisUrl.childNodes[count02].nodeName.toLowerCase();
//the string from the input textfield is compared
//with the name of the childnodes
if (searchWindow.toLowerCase() == urlName && urlName != undefined) {
//if there is a match we do all this
thisName = thisUrl.childNodes[count02].attributes.name;
headline = thisUrl.childNodes[count02].attributes.action;
urlText = thisUrl.childNodes[count02].attributes.myUrl;
frameNumber = thisUrl.childNodes[count02].attributes.frame;
//the button will appear..
_root.nameBut.enabled = true;
_root.nameBut._alpha = 50;
//if there is no match...
//we cannot use urlName here because this still holds more child node names
//and this statement will always be executed, so we use thisName.
//urlText is undefined: if the user presses the submit button w/o adding text
//this will be executed if urlText is undefined.
}else if (searchWindow.toLowerCase() != thisName.toLowerCase() || urlText == undefined){
//the button is disabled
_root.nameBut.enabled = false;
//the button will not appear
_root.nameBut._alpha = 0;
headline = "Sorry, no match.";
}
}
}
}
//here we define the function for the button containing the frame number
function myFrame(){
gotoAndStop(frameNumber);
}
//here we define the function for the button containing the url and the
//browser target window
function myUrl(){
getURL(urlText,"_blank");
}
Y este este el XML:
Código :
<?xml version="1.0"?> <flashkit> <flashmx name="flashmx" myUrl="http://flashkit.com/board/forumdisplay.php?forumid=61" frame="2" action="Press to go to the Flash MX forum."> </flashmx> <flash5 name="flash5" myUrl="http://board.flashkit.com/board/forumdisplay.php?forumid=26" frame="3" action="Press to go to the Flash 5 forum."> </flash5> <tutorials name="tutorials" myUrl="http://flashkit.com/tutorials/" frame="4" action="Press to go to the Tutorials section."> </tutorials> </flashkit>
I si por ejemplo en el atributo name de Flashmx añade ni que sea un 5 separado es decir con un espacio ya no encuentra nada.. hace rato que estoy mirando de solucionarlo pero nosé como...
Salu2
