I’ve got a bunch of movieclips which are thumbnails. When you click them, they open a popup with that picture up big and a little description of it.
I’ve got these two pieces of code:
Sender
onClipEvent(load){
thisName = this._name
thisPictureNumberArray = thisName.split("Container")
thisPictureNumber = thisPictureNumberArray[1]
//Popup Window Variables
winURL = "popup_2.html";
winName = "Andrew Scott Photography";
winWidth = 830;
winHeight = 770;
winToolbar = 0;
winLocation = 0;
winDirectories = 0;
winStatus = 0;
winMenuBar = 0;
winScrollbars = 1;
winResizable = 0;
//If clicked...
this.onRelease = function(){
thisPictureTitle = _parent.titlesArray[thisPictureNumber]
thisPictureDescription = _parent.descriptionsArray[thisPictureNumber]
thisPicturePath = _parent.pathsArray[thisPictureNumber]
//Send the Picture Info to the Popup
//Open Popup
getURL ("javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open('" + winURL + "','" + winName + "','" + "width=" + winWidth + ",height=" + winHeight + ",toolbar=" + winToolbar + ",location=" + winLocation + ",directories=" + winDirectories + ",status=" + winStatus + ",menubar=" + winMenuBar + ",scrollbars=" + winScrollbars + ",resizable=" + winResizable + ",top='+((screen.height/2)-(" + h/2 + "))+',left='+((screen.width/2)-(" + w/2 + "))+'" + "')}else{myWin.focus();};void(0);");
//Check when the popup is opened.
sendPicturreInfo = new LocalConnection();
sendPicturreInfo.connectionOK = function(){
sendPicturreInfo.send("pictureInfo", "getinfo", "Picture 1", "This is the first test picture.", "pictures/tort1.jpg");
}
sendPicturreInfo.connect("connectionTest");
}
}
Reciever
popConnector = new LocalConnection();
popConnector.getInfo = function(title,description,path){
//Load the picture
loadMovie(path,pictureBox);
//Put in the Title and description
textBox.html = true
textBox.htmlText = ""
textBox.htmlText = "<font size='14' color='#117733'><b>"+title+"</b></font><br><font size='14' color='#000000'>"+description+"</font>"
}
popConnector.connect("pictureInfo");
popConnector.send("connectionTest", "connectionOK");
It’s working fine, but when I change the values in the first part ([size=1] sendPicturreInfo.send(“pictureInfo”, “getinfo”, “Picture 1”, “This is the first test picture.”, “pictures/tort1.jpg”);[/size]) to be the variables thisPictureTitle, thisPictureDescription and thisPicturePath, it just shows up blank in the popup window. When I just use text strings “Picture 1” then it works fine.
Any ideas why?
Edit: and if I trace the variables trace(thispictureTitle); it works fine too, so they’re being got fine.