Hi all!
I'm trying to set dynamically target URLs on some movie buttons already created in design mode.
The URLs are defined in a XML file that is successfully loaded and parsed into variables. The problem resides on affecting the movie clip in order to link to a desired URL.
I've already tried to make this:
boxIdx = 0;
while (boxCurrentNode!=null) {
boxSubNodes = boxCurrentNode.firstChild;
eval("btnOrg_" + boxIdx).txtButton.text = boxSubNodes.firstChild.nodeValue;
boxSubNodes = boxSubNodes.nextSibling;
eval("btnOrg_" + boxIdx).onPress = function () { this.getURL(boxSubNodes.firstChild.nodeValue, '_self' } ;
boxIdx++;
boxCurrentNode = boxCurrentNode.nextSibling;
}
The text boxes are filled correctly but all the "onPress" events points to the URL of the last string on the XML file. It seems that the function created for each movie button is overwrited on all previous movie buttons...
Ideas?
Carlos - a LINUX addict!
I'm trying to set dynamically target URLs on some movie buttons already created in design mode.
The URLs are defined in a XML file that is successfully loaded and parsed into variables. The problem resides on affecting the movie clip in order to link to a desired URL.
I've already tried to make this:
boxIdx = 0;
while (boxCurrentNode!=null) {
boxSubNodes = boxCurrentNode.firstChild;
eval("btnOrg_" + boxIdx).txtButton.text = boxSubNodes.firstChild.nodeValue;
boxSubNodes = boxSubNodes.nextSibling;
eval("btnOrg_" + boxIdx).onPress = function () { this.getURL(boxSubNodes.firstChild.nodeValue, '_self' } ;
boxIdx++;
boxCurrentNode = boxCurrentNode.nextSibling;
}
The text boxes are filled correctly but all the "onPress" events points to the URL of the last string on the XML file. It seems that the function created for each movie button is overwrited on all previous movie buttons...
Ideas?
Carlos - a LINUX addict!