PDA

View Full Version : Flash Popup.



Cheng
01-06-2006, 06:18 AM
Hi.
It's me again with another problem.
Since John helped me to resolve my problem with the centered image popup window, I have another popup that shows without a window frame at all, but not centered.
The popup is made in Flash.
Please have a look at the attachment and let me know if it is possible to make this popup appear centered.
Thanks in advance.
Kind regards,
Cheng

Cheng
01-07-2006, 04:39 AM
Ok if nobody has a solution the the centered flash popup mentioned above, maybe this is possible.
If you click this link here:
http://www.tommys-service-enterprise.gmxhome.de/Nang%20Paya.htm
There is an image in the middle and when you click it it opens centered popup window.
Is it possible to have this popup without any window frame?
Just the image, nothing else.
Thank you all.
Cheng

sleipner
01-08-2006, 03:24 AM
I think I found an example of it here, http://www.kirupa.com/developer/mx/transparency.htm, if I remember right, it puts a "transparent" or something like that in one of the embed parameters of the html code...

Cheng
01-08-2006, 05:31 AM
Thanks for your reply.
But this forum there is Flash MX related and I'm using Swishmax if I have to do some Flash.
Also I don't want that popup to be transparent as you can see in attachment I've posted the popup is not transparent.
I only want someone to help me by telling how to make this appear centered.
Thanks again.
Cheng

jscheuer1
01-08-2006, 06:19 AM
Well, I was unable to get your demo to play onclick using your code but, that might be because I was trying this as a local demo. I was able to get the demo to play using .play() for IE (instead of .GotoFrame(1)) and in FF by using a right click and selecting play from the Macromedia menu. Once I had that happening, I gave the containing division an id:


<div id="flashDiv" style="position:absolute;top:50px;left:100px;">

Next I wrote a little script that can go in the head:


<script type="text/javascript">
onload=function(){
var w=window.innerWidth? window.innerWidth : document.documentElement.clientWidth
document.getElementById('flashDiv').style.left=(w-document.getElementById('popup').width)/2+'px'
}
</script>

This did the trick on centering. You are on your own getting the darn thing to play.:)

Notes: 'document.documentElement' is for use with a DOCTYPE as your demo had one. With no DOCTYPE, it should be 'document.body'. Better still is to use a test function, as some earlier IE versions may not support document.documentElement but, as these browsers probably will not do flash either, I didn't worry about it.

Cheng
01-08-2006, 10:39 AM
Hi John.
Thanks again for your expertise.
I will try out the code you posted, but what I don't understand is that you cant play the file.
You should just double click the popup.html file and then it should open in Explorer and then just click on the link "Open Popup" and that opens the popup.swf
It works for me from inside WinRar without even saving the file when I click on it from where I posted the attachment.
Strange really.
I try your code and let you know.
Thank you.
Cheng

Cheng
01-08-2006, 10:58 AM
Here It's me back again.
It's nearly working.
When I open the browser window in 1024/768 the popup ist centered.
Only when I maximize the window to my full browser window size 1440/900 the popup is not centered anymore.
But then if I open the window in the begining in 1440/900 the popup is centerd, but then again if resized to whatever size without closing then the window first, the popup is not centered anymore.
Could you please be so kind and have a look into that as well.
I really want this to work for a long time, but you are the 1st person I know that has a clue about this coding stuff
By the way, how would all this work if the "Open Popup" link is inside a table?
I thought I got it now, but still something is missing as it appears.
Thanks again for your help.
Cheng
PS.
In the attachment you find the popup example after I modified it with your code.

Cheng
01-08-2006, 11:31 AM
Here an example inside a table.
Like the way it appears now, but only centered and no matter what window size.
Then that would be exactly what I'm trying to do for ages without any result.
But you brought me very close to it.
Please have a look at this attachment and see if the popup could be centered.
Some people in other forums told me that this is impossible, but I think it is.
And if someone can do it then it's probably you.
I really appreciated.
Hope one day I can help you out somehow.
cheng

jscheuer1
01-08-2006, 07:01 PM
The code I wrote assumes that the window will remain the same size that it was when opened. It can be changed to accommodate resizing:


<script type="text/javascript">

function centerPopUp(){
var w=window.innerWidth? window.innerWidth : document.documentElement.clientWidth
document.getElementById('flashDiv').style.left=(w-document.getElementById('popup').width)/2+'px'
}

onload=centerPopUp;
onresize=centerPopUp;

</script>

As long as the pop up container is absolutely positioned, it makes no difference where the link that activates it is.

Cheng
01-09-2006, 04:16 AM
Hi Mad Professor.
Everything is fine now except one thing.
You said:
""As long as the pop up container is absolutely positioned, it makes no difference where the link that activates it is.""
What you mean by "absolutely positioned"?
If I put the Link that opens the popup inside a table and then save it.
It is working, but when I move the folder that contains the popup.html and the popup.swf to another location then it's not working anymore.
Also the one without a table, if the folder that contains the files is renamed then it's not working anymore.
In the attachment there are 2 zip files one with the link inside a table and one without a table.
Try to rename the folder popup.
When I do this it's not working anymore
For the one inside a table maybe it's because of the container must be absolue positioned, but I don't know what you mean with that.
I hope I'm not hurting your nerves to much with this, but please help me to solve this.
Thanks a lot.
Cheng

P.S.
I just found out that if you rename the folder from LinkInsideTable to popup the also the one with a table is working.

Cheng
01-09-2006, 04:58 AM
I think I found out how to do it.
Would this be correct to just change the code here from:

name="popup" src="../Popup/popup.swf"

To:

name="popup" src="../whatever/popup.swf"

At least it seems like it's working like this.

jscheuer1
01-09-2006, 05:55 AM
OK, sounds like things are working. You seem to have two basic questions, one is about absolute positioning. Here is where you have the flash pop up container absolutely positioned, it is how you had it in your original code and all the other versions too, I think:


<div id="flashDiv" style="position:absolute;top:180px;left:114px;">

Without that, there are other ways to center it:

<div id="flashDiv" align="center">

But, then it will not be 180px from the top, at least not in most cases, rather it will be wherever the division falls on the page.

Question two is about paths. You have that right. Wherever the file you are trying to access on a page is, the path and filename to that file must be correct in your code, otherwise the browser cannot find the file.

Cheng
01-09-2006, 06:12 AM
Wow, it seems to work fine now.
By the way, if I change the path in the code once then I can rename the folder again to whatever without changing the code again and it still works.
Also the folder then can be moved and it is still working.
Nice job.
Now I'm going to try that on a website online.
Hope everything goes smoothly so I don't have to come back for your help.
Thanks again.
You did what other people told me is impossible.
So long.
Cheng

Cheng
01-09-2006, 12:12 PM
Hi John.
Please have a quick look at this:

http://www.tommys-service-enterprise.gmxhome.de/test.htm

I tried it online, but somehow it does not show centered.
Is it because the popup is to large?
Is it possible that the popup overlaps the grey area above the content page?
If not then the popup is probably to large, but I even tried it smaller, but it wont be centered.
Would've been to nice if it would just work on the 1st try.
Thanks again.
Cheng

jscheuer1
01-09-2006, 06:43 PM
You have the old script on that page, the one to use when centering a pop up window, not the new script to center the "flashDiv".

Cheng
01-10-2006, 06:57 AM
Hi John.
Now I'm really confused.:confused:
I thought that is the right script.
I use the same script in the test.zip as in the popup_example.zip attachment.
Please have a quick look at both the attachments and tell me where the mistake is located.
Thank you very, very much.
Cheng

PS.
Could it be the case that I have to rename something, because now the swf file is not called popup anymore?

jscheuer1
01-10-2006, 08:16 AM
If you are confused, don't add to that confusion by throwing in archives of other pages. I was referring to the linked page in your post:

http://www.tommys-service-enterprise.gmxhome.de/test.htm

That page has this script on it (the one for centering a popup window with an image as its source):


<script language="javascript" type="text/javascript">
<!--

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,re sizable=no';
win=window.open('',myname,settings);
win.document.write('<body style="margin:0;padding:0;" onblur="self.close()"><img src="'+mypage+'">');
win.document.close();
}
// -->
</script>

But, since on that page you are using a .swf in a popup division, you should use the newer script we discussed:


<script type="text/javascript">

function centerPopUp(){
var w=window.innerWidth? window.innerWidth : document.documentElement.clientWidth
document.getElementById('flashDiv').style.left=(w-document.getElementById('popup').width)/2+'px'
}

onload=centerPopUp;
onresize=centerPopUp;

</script>

As for changing names, only the id attributes of the object tag and container divisions matter, they should be unique and match the id's of the tags they are referencing. From looking at the code of:

http://www.tommys-service-enterprise.gmxhome.de/test.htm

It looks like it should work with the second script in this post, if it had it on the page, which as of this writing, it doesn't.

Cheng
01-10-2006, 09:22 AM
Sorry for the confusion, but now I replaced it with the right code in here:

http://www.tommys-service-enterprise.gmxhome.de/test.htm

Now it is this code:

<script type="text/javascript">

function centerPopUp(){
var w=window.innerWidth? window.innerWidth : document.documentElement.clientWidth
document.getElementById('flashDiv').style.left=(w-document.getElementById('popup').width)/2+'px'
}

onload=centerPopUp;
onresize=centerPopUp;

</script>

The same in the attached file, but the popup wont center.
This is my last attempt, because I know you must be fad up with this by now, but please have one more look at it for the last time.
Thank you.
Cheng

jscheuer1
01-10-2006, 09:37 AM
On the test page, there is a script conflict. Remove:


onload=centerPopUp;

from the script and add to your body tag's onload event (addition red):


<body bgcolor="#000000" onload="centerPopUp();FP_preloadImgs(/*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button3E.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button3D.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button1E.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button1D.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button21.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button20.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button27.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button26.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button2A.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button29.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button2D.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button2C.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button30.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button2F.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button33.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button32.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button49.gif', /*url*/'file:///C:/Documents%20and%20Settings/Tommy/My%20Documents/My%20Web%20Sites/Tommys%20Amulet%20Website/images/button4A.gif')">

You will also need to get rid of this line:


window.onload=jsStarFieldBG_onLoad;

from the:

usingit_js_starfield_background.js

file and insert its event in the body tag:


<body bgcolor="#000000" onload="centerPopUp();jsStarFieldBG_onLoad();FP_preloadImgs(/* . . .

One more thing, since I told you this was only for a page with a DOCTYPE, either add the DOCTYPE as you had in your original demo, or use document.body instead of document.documentElement in the script.

Cheng
01-10-2006, 10:54 AM
I can't find this entry here:

window.onload=jsStarFieldBG_onLoad;

The other 2 things I changed allright.
Only this entry:

window.onload=jsStarFieldBG_onLoad;

I can't find it.

jscheuer1
01-10-2006, 10:58 AM
It is in the external .js file named:

usingit_js_starfield_background.js

Cheng
01-10-2006, 11:37 AM
I changed it the way you said, but now the popup is completely out of focus.
Looks like I give up.
Would it at least work if I get rid of the starfield background?
In the attachment you find the changed test.html

jscheuer1
01-10-2006, 05:25 PM
I changed it the way you said, but now the popup is completely out of focus.
Looks like I give up.
Would it at least work if I get rid of the starfield background?
In the attachment you find the changed test.html

In the attachment, everything is as I suggested except for the script, which needs to have 'document.documentElement' changed to 'document.body':


<script type="text/javascript">

function centerPopUp(){
var w=window.innerWidth? window.innerWidth : document.body.clientWidth
document.getElementById('flashDiv').style.left=(w-document.getElementById('popup').width)/2+'px'
}

onresize=centerPopUp;

</script>

Cheng
01-11-2006, 08:43 AM
Hi John.
Wow!
It's nearly working.
Only if the window is resized, it has to be refreshed that the popup is centered in the different window size.
We had this before and by adding:

onresize=centerPopUp;

it was working.
But this entry is allready there, so I recon it's another small modification and it should work fine.
I really appreciate your patience with this.
Thanks a lot.
Cheng

PS. Latest modification is attached.

jscheuer1
01-11-2006, 10:12 AM
Yep, you've got it, a slight adjustment. Just like there was a conflict onload there is a conflict onresize. This line needs to be removed from "usingit_js_starfield_background.js":


window.onresize=jsStarFieldBG_onResize;

and on the page, where we have:


onresize=centerPopUp;

Make it like so:


onresize=function(){centerPopUp();jsStarFieldBG_onResize();}

Cheng
01-11-2006, 10:42 AM
Hi John.
You are a genius.
It's working just fine now.
Nice job.
I was very close to give up on it.
Thanks again very much for your patience.
I really appreciated.
So long.
Cheng.
PS. In the attachment the final result.

Cheng
01-14-2006, 04:07 PM
Hi.
It's me again.
The script is working fine so far.
Only now I'm trying to have more than 1 flash popup on the same page.
I think I changed the ID for the container correct and also gave the second popup a different name.
Both popups are working now, except that only one is centered.
Could you please have a look at the attachment and tell me where the problem is?
My plan is to have 3 of them.
If I got these two working then I hope I just can add another one the same way.
Thanks in advance.
Cheng

jscheuer1
01-14-2006, 05:30 PM
<script type="text/javascript">

function centerPopUps(){
var w=window.innerWidth? window.innerWidth : document.documentElement.clientWidth
document.getElementById('flashDiv').style.left=(w-document.getElementById('popup').width)/2+'px'
document.getElementById('flash1Div').style.left=(w-document.getElementById('popup2').width)/2+'px'
}

onload=centerPopUps;
onresize=centerPopUps;

</script>

Cheng
01-15-2006, 08:48 AM
Gee thanks.
That was easier than I thought.
It's working just fine.
Now I will try this on the webpage together with the javascript starfield background.
I hope it will work there as well.
Thanks again.
Cheng

Cheng
01-17-2006, 10:32 AM
Hi.
Here is exactly what I thought.
In here it wont work, even I did it the same as in the popup_test.htm
The files are uploaded to a server, because they are to large to send as an attachment zip file.

http://www.mbs-paper.com/popup/popup_test.htm

Each popup can pe opened, but they are not centered.
Defenitly I could not do this at all without your help.
I hope it's not to much to ask to have you have a look at it again.
Defenitly the last time.
Thanks a lot.
Cheng

jscheuer1
01-17-2006, 11:56 AM
Go back to posts numbers 23 and 25 in this thread. You are having some of the same problems translating your success on the simple test page to the more complex display page as you were having before.

Cheng
01-17-2006, 01:11 PM
All right.
That's it.

http://www.mbs-paper.com/popup/popup_test.htm

Only one last thing.
Is it possible that the popups center not only to the middle from left and right, but also from top and bottom compared to the window size.
Now the top line of the popups will stay at the point where I place them.
Coult it be something here?:

<div id="flash1Div" style="position:absolute;top:440px;left:103px;">

Instead of what I put in red like center maybe.
But I tried center allready and it did not work.
It is not so important, but would be nice to know, also if someone did not scroll down to the end the popups could center to the window proportions.
As I said many times before, I really appreciate your help and patience.
Thank you.
Cheng

jscheuer1
01-17-2006, 08:07 PM
function centerPopUps(){
var w=window.innerWidth? window.innerWidth : document.body.clientWidth
var h=window.innerHeight? window.innerHeight : document.body.clientHeight

document.getElementById('flash1Div').style.left=(w-document.getElementById('popup1').width)/2+'px'
document.getElementById('flash1Div').style.top=(h-document.getElementById('popup1').height)/2+'px'
document.getElementById('flash2Div').style.left=(w-document.getElementById('popup2').width)/2+'px'
document.getElementById('flash2Div').style.top=(h-document.getElementById('popup2').height)/2+'px'
document.getElementById('flash3Div').style.left=(w-document.getElementById('popup3').width)/2+'px'
document.getElementById('flash3Div').style.top=(h-document.getElementById('popup3').height)/2+'px'
}

Cheng
01-18-2006, 03:55 AM
Now it looks like this:

Link 1: (http://www.mbs-paper.com/popup/popup_test1.htm)

I think I better leave it as it was.
In fact it should work like this:

Link 2: (http://www.tommys-service-enterprise.gmxhome.de/Somdej.htm)

Here the popup is not Flash, but it is centered to the screen and not to window.
Probably that is impossible with a flash popup.
Anyway I'm quiet happy so far.
Thanks again.
Cheng

jscheuer1
01-18-2006, 05:41 AM
Ooops, I forgot about scrolling, this will probably take care of that:


function centerPopUps(){
var w=window.innerWidth? window.innerWidth : document.body.clientWidth
var h=window.innerHeight? window.innerHeight : document.body.clientHeight
hAdj=document.body.scrollTop

document.getElementById('flash1Div').style.left=(w-document.getElementById('popup1').width)/2+'px'
document.getElementById('flash1Div').style.top=(h-document.getElementById('popup1').height)/2+hAdj+'px'
document.getElementById('flash2Div').style.left=(w-document.getElementById('popup2').width)/2+'px'
document.getElementById('flash2Div').style.top=(h-document.getElementById('popup2').height)/2+hAdj+'px'
document.getElementById('flash3Div').style.left=(w-document.getElementById('popup3').width)/2+'px'
document.getElementById('flash3Div').style.top=(h-document.getElementById('popup3').height)/2+hAdj+'px'
}
document.onmousedown=centerPopUps

If not, we will have to get the scroll state at the same time the images are clicked. This, as I say, should do that though, give it a shot. If this works we can get rid of onresize and onload calls for centerPopUps().

Cheng
01-18-2006, 12:40 PM
Hi John.
Yeah, that's it!!!
You are incredible good with this scripting stuff.

The Result: (http://www.mbs-paper.com/popup/popup_test1.htm)

Thank you so much.
Cheng

By the way, would it be possible that the popup centers just when using the scrollbar and without having to click somewhere in the window after scrolling?
I'm just curious.

jscheuer1
01-18-2006, 08:21 PM
I noticed a problem with this latest change. If the user's window isn't tall enough to accomodate the entire pop up, they can never close it! To fix that, I'd try getting rid of this line:


document.onmousedown=centerPopUps

and changing these type lines:


<a title="click for large view"href="javascript:popup2.GotoFrame(1)">

to:


<a title="click for large view" href="javascript:popup2.GotoFrame(1)" onmousedown="centerPopUps();">

By the way, with both this and the previous modification, you no longer need the red parts in these lines:


onload=centerPopUps;
onresize=function(){centerPopUps();jsStarFieldBG_onResize();}

or:


<body bgcolor="#000000" onload="centerPopUps();jsSta . . .

and should really remove them.

Cheng
01-19-2006, 04:57 AM
This did not work I think.
I did exactly as you said:

Last Modification: (http://www.mbs-paper.com/popup/popup_test2.htm)

Before: (http://www.mbs-paper.com/popup/popup_test1.htm)

Or did I make a mistake somewhere?

jscheuer1
01-19-2006, 05:21 AM
Well, there are and were many mistakes on the page. Hopefully, the only fatal one, as far as this script goes, is the latest, you have:


onresize=jsStarFieldBG_onResize();}

If you go back and look carefully at how I recommended you edit that line, you will see that it should look like so:


onresize=jsStarFieldBG_onResize;

I'm just guessing but, there is a good chance that will take care of it.

Cheng
01-19-2006, 08:30 AM
Yes, this nearly fixed it.
Only onmousedown=center popups wont work.
If this works again like it did before than it should be finaly and I mean finaly be over with.

Link: (http://www.mbs-paper.com/popup/popup_test2.htm)

There is an option in Front Page to "Reformate HTML".
I did this as well.
Hope that it did any good to the whole HTML coding.

jscheuer1
01-19-2006, 09:19 AM
It works here (your latest demo), what's the problem?

Cheng
01-19-2006, 10:12 AM
Before when the page was scrolled and afterwards clicked into the window somewhere, the popup centered.
That's not working anymore.
And on resize the window the same thing.
It wont center on resize.
At least when I try it wont.

Link: (http://www.mbs-paper.com/popup/popup_test2.htm)

jscheuer1
01-19-2006, 08:16 PM
Ah, I see, that first problem:


Before when the page was scrolled and afterwards clicked into the window somewhere, the pop up centered.
That's not working anymore.

is best left 'unfixed'. Because, if a user's window or screen is too small to fit the pop up vertically, and they scroll to see the x to close it, as soon as they click to close, the pop up moves first, making it impossible to close.

If you still want the pop ups to move on resize, that can be added back in but, it is hardly needed. Very few folks will resize with a pop up visible, and if the do, won't mind that it hasn't recentered. Also, depending upon where that will put the pop up, in some cases it would be better left where it was. Still, to add that back in, change this line back the way we had it, from:


onresize=jsStarFieldBG_onResize;

to:


onresize=function(){centerPopUps();jsStarFieldBG_onResize();}

Cheng
01-20-2006, 04:50 AM
Hi John.
I guess you're right.
So I just changed the the center on resize function and will leave at that.
Finaly that's the end of that.
Wow, this was a long threat for just a couple of small things.
Thanks again very much and as I said before.
You are the man!
So long.
Cheng

deletedtourist
10-14-2007, 03:46 PM
hi everyone!

im trying (i think) to do the same as cheng and to be honest im a little out of my depth and need help. i want when the user clicks a button in flash, a pop up to display and show another swf file. this is the code ive used so far....


this i can see sets the size of the window and states what to display within the window.....


pinkstill.onPress = function() {

//customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = "contact.swf";
target_winName = "contact";
width = 500;
height = 400;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 0;
resizable = 0;
//sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);

}



and this in another layer as instructed by the tutorial....

_root.openWinCentre = 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);");

}

/**/




any help would be so appreciated,
thanks,
vikki :D

Cheng
10-14-2007, 05:23 PM
Hi Vikki

I'm not a coder and probably someone else here can help you more than I do.
What I understand from your post is that you want to open a centered popup window from inside a Flash animation which is different from what I tried to do but I used to do the same think that you want with Swishmax.
The code to open a centered popup from a Flash animation using Swishmax is:


window.open('http://www.sample.com/sample.html','Contact','width=500,height=400,resizable=no,scrollbars=no,toolbar=no,top='+((screen.availHeight/2)-(400/2))+',left='+((screen.availWidth/2)-(500/2))+'');void(0);

You need to create a html file that contains your swf file the one you want to open as popup.
But if you want that the popup is a Flash popup without a window frame around it I have an example for you that might help that is if you have Swishmax.
The swi file is attached to this message.
Hope that helps you a litlle.