Problem with If Statement
Well, my first post here, hope i can solve this 😃
The problem is that i do have a if that seems to not obey me:
if (_parent.foto2 == 'no' ) {
btNext._visible = false;
}
I believe I am having some problem with the variable "foto2". I tried tracing, and if I add a 'trace ('_parent.foto2') right before the if, the result is 'no'.
So i'm 100% that what's inside the var on the moment of the loop is 'no'. I can even use it to change dynamic text boxes to 'no'.
What maybe possible is that it's a type of var that if doesn't understand maybe?
So i'll try to be short explaining from it comes.
I'm doing a gallery where a click on a thumbnail leads to a zoom image, or images, based on XML, so firstly I prepared a set of vars from the xml:
function checkLoading(success) {
if (success == true) {
var totalNodes = imagesXML.firstChild.childNodes.length;
for (i=0; i< totalNodes; i++){
fotoEnd = 'images/lookbook/' + imagesXML.firstChild.childNodes.firstChild.firstChild;
this["fotoToLoad"+i] = fotoEnd;
this["fototwo"+i] = imagesXML.firstChild.childNodes.childNodes[1].firstChild;
this["text"+i] = imagesXML.firstChild.childNodes.childNodes[2].firstChild;
}
frame1.loadFirst (this);
}
}
The last function there, loadFirst, runs inside the thumbnail, it it uses fotoToLoad+i as the thumb to load (and also the first zoom image), fototwo+i as the second image of zoom (wich might be an image filename or a 'no', wich i would use as control to showor not the brNext button). And the text+i is the images's description. I'm also forwarding the this to the function so that i can use the vars there.
On the thumbnail mc I have a moviecliploader working, so that it will fun the followin after load ends: