# Problem with Code for Pop-up Window?

**URL:** <https://forum.kirupa.com/t/problem-with-code-for-pop-up-window/149258>\
**Category:** Uncategorized\
**Created:** [May 27, 2005, 9:52am UTC](https://forum.kirupa.com/t/problem-with-code-for-pop-up-window/149258 "2005-05-27T09:52:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mimi](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mimi](https://forum.kirupa.com/u/mimi)\
**Post date:** [May 27, 2005, 9:52am UTC](https://forum.kirupa.com/t/problem-with-code-for-pop-up-window/149258/1 "2005-05-27T09:52:43Z")

</div>

Hi everybody,

My problem with the same Code AS for pop-up window is :

- It works correctly with the button on my flash having only 1 scene ! ![](http://forum.kirupa.com/uploads/kirupa/1357/df0c8b911c28db09.gif)
- But not with the flash consisting of 2 scenes when this same code applied to the button on the last frame of scene2 ??? ![](http://forum.kirupa.com/uploads/kirupa/1358/45c09538b3a21810.gif) what’s wrong ??? ![](http://forum.kirupa.com/uploads/kirupa/1359/a1a8c09275f3a1df.gif)

Help me for this problem, plzzzzzzzz…!!! ![](http://forum.kirupa.com/uploads/kirupa/1360/c68cdd2597991807.gif)  
Thanks in advance !

Here’s the code that I’ve found from this tut.

[color=#000084]

```auto
[color=#000084]on (release) {[/color][/color]
[color=#000084][color=#000084] Movieclip.prototype.openWin1 = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable){ [/color][color=#000084]	[/color][/color]
[color=#000084][color=#000084] getURL("javascript:var myWin1;if (!myWin1 || myWin1.closed){myWin1=window.open('"+url+"', '"+winName+"', '"+"width="+w+", height="+h+", toolbar="+toolbar+", location="+location+", directories="+directories+", status="+status+", menubar="+menubar+", scrollbars="+scrollbars+", resizable="+resizable+", top='+0+', left='+150+'"+"')} else{myWin1.focus();};void(0);"); };[/color][/color]
[color=#000084][color=#000084][/color][/color]
[color=#000084][color=#000084]address = "[/color][color=maroon]mylink.html[/color][color=#000084]";[/color][/color]
[color=#000084][color=#000084]winName = "window1";[/color][/color]
[color=#000084][color=maroon]width = 550;[/color][/color]
[color=#000084][color=maroon]height = 413;[/color][color=#000084]	[/color][/color]
[color=#000084][color=#000084]toolbar = 0;[/color][/color]
[color=#000084][color=#000084]location = 0;[/color][/color]
[color=#000084][color=#000084]directories = 0;[/color][/color]
[color=#000084][color=#000084]status = 0;[/color][color=#000084]	[/color][/color]
[color=#000084][color=#000084]menubar = 0;[/color][/color]
[color=#000084][color=#000084]scrollbars = 0;[/color][/color]
[color=#000084][color=#000084]resizable = 0;[/color][/color]
[color=#000084][color=#000084][/color][/color]
[color=#000084][color=#000084]openWin1(address,winName,width,height,toolbar,location,directories,status,menubar,scrollbars,resizable); [/color] [/color][color=#000084]}

```

[/color]
