javascript>flash
- Started
- Last post
- 8 Responses
- ********
This looks like a problem for unfittoprint!!!(or someone else who's really good)
Okay guys, I have a .swf that loads into an HTML page; the html page has a function that opens a new window(popups!)
via a getUrl command w/in Flash.How would I set the function(or the code in flash) to open the window with varying parameters for width and height?
Thanks for the help.
Code is below.
*code w/in html page*
*code w/in flash*
myVar.onRelease = function() {
this.marked._visible = 1;
getURL("javascript:openNewWindow... mortenson.swf',
'thewin','height=500,width=500,t... ');");
- unfittoprint0
you could this one I did:
JAVASCRIPT:
function popup(url, windowName, w, h, wint, winl, scroll, size) {
if (winl == 'center') {
winl = (screen.width - w) / 2
};
if (wint == 'center') {
wint = (screen.height - h) / 2
};
winprops = 'height='+h+',width='+w+',top...
win = window.open(url, windowName, winprops);
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus();
}
}FLASH:
button.onPress(){
getURL("javascript:popup('portfo...don't forget that inside the "", you should use ' ' for the javascript parameters...
keep me updated....
- shellie0
make a js page and put this in it...
function popGreg()
{
popWindow("yourURL.html",500,500...
}
add whatever else you want in there...
then in your html page put above the
and in flash on your button put getURL("javascript:popGreg();");
i might be wrong.. but i might be right. good luck
- shellie0
ok.. nevermind. :/ im way too slow.
- unfittoprint0
good one girl ;-)
I usually use shellie's approach, do the function in javascript, and define a popup also in the HTML, and then call it from Flash.
This is because I don't know if Flash accept all those popup parameters... You'll see...
- ********0
Ooh, from the man himself. Thanks. I think that's similar to what I have, I guess my question is this:
How do I pull variables from an array in flash and send them to the javascript?i.e.
winX=array[i][0];
winY=array[i][1];then send winX & winY to the javascript function...
does this make sense?
Thanks for your help.
By the way the hipster bingo is such a sweet post! hahaha.
- shellie0
eep* correction:
then in your html page put above the /head tag put
script language="javascript" src="nameofyourjsfile.js"
ugg.
- ********0
I would like to just be able to update the array rather than write a function for each popup...
- unfittoprint0
that's a bi-dimensional array right (an array inside an array, right?)
you can try this(?)
winX=array[i][0];
winY=array[i][1];and then just substitute the 'stuff' inside the getURL like constructing a string...
button.onPress(){
getURL("javascript:popup(
'portfolio/web/polis/inde
x.htm','polis','595','840
','"+winX+"','"+winY+"','no',
'no')")?...