flash pop up
- Started
- Last post
- 8 Responses
- effour
Anyone have a link to centered external browser pop-up for flash 8?
Thx.
- ********0
first define the followgin function in your actions layer:
Movieclip.prototype.openWinCentr... = function (url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
getURL ("javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open('" + url + "','" + winName + "','" + "width=" + w + ",height=" + h + ",toolbar=" + toolbar + ",location=" + location + ",directories=" + directories + ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",top='+((screen.height/2)-(" + h/2 + "))+',left='+((screen.width/2... + w/2 + "))+'" + "')}else{myWin.focus();};void(0...
}Add the following to the button that will trigger the pop up
on (release) {
address = "url here";
target_winName = "name for the new window";
width = whatever u want in pixels;
height = same here;
//0 = NO, 1 = YES
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 1;
resizable = 0;
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}
- anayafx0
got these AS errors on export:
(but i think it might be newstoday's handling of the code)
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 14: ')' or ',' expected
openWinCentre(addre ss, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 15: Unexpected '}' encountered
}Total ActionScript Errors: 2 Reported Errors: 2
- effour0
Thx Daro...
Keep getting errors...care to send me a sample...would be greatly appreciated...
Thx
- ********0
Sure, hold on just a sec...
- spl33nidoru0
is it me or is Daro's code only working in Flash 5 ?
I never seem to find an easy fix for Flash 8, any input would be greatly appreciated.(seems like the kirupa link pop-up isn't centered on macs)
- st33d0
It's better to put javascript in the html header and call it from a function in Flash.
getURLs with a shed load of javascript in tend to behave rather unpredictably in my experience.
- spl33nidoru0
right, that's what i usually do.
i was hoping there was a way to leave everything in one place.oh well :)