Statement must appear within on handler
myButton.onRelease=function(){
This is the error you get when trying to paste frame code onto an object(movieclip). Create a brand new test movie. Paste the function on the first frame of the movie....
Code:
function launchNewWin(url, wdth, hdth, windowNewName) {
if (windowNewName == undefined) {
var windowNewName = "newWin";
}
//End if
getURL("javascript:window.open(\""+url+"\",\""+windowNewName+"\",\"width="+wdth+",height="+hdth+",top=\"+((screen.availHeight/2)-("+hdth/2+"))+\",left=\"+((screen.availWidth/2)-("+wdth/2+"))); void(0);");
}
Now, just for testing, lets get rid of the button and let the function run when the movie first loads. Paste this directly below the function ...
_root.launchNewWin("http://msn.com", 700, 380, "myNewWindow");
The last parameter(myNewWindow) really only needs to be modified if you plan on using multiple windows. If you use the same window name, any pop up you open will reload the existing custom window. If you use a new window name, a new custom browser window will open. Once you get the msn site to open, try changing the path to the video file.
Bookmarks