# Some JavaScript in FLash problems

**URL:** <https://forum.kirupa.com/t/some-javascript-in-flash-problems/29639>\
**Category:** flash\
**Created:** [August 28, 2003, 11:25pm UTC](https://forum.kirupa.com/t/some-javascript-in-flash-problems/29639 "2003-08-28T23:25:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sintax321](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@sintax321](https://forum.kirupa.com/u/sintax321)\
**Post date:** [August 28, 2003, 11:25pm UTC](https://forum.kirupa.com/t/some-javascript-in-flash-problems/29639/1 "2003-08-28T23:25:00Z")

</div>

Trying to launch a popup window.

button code:  
[AS]on (release) {  
getURL(“javascript:openNewWindow(‘news.htm’, ‘\_blank’,‘height=400,width=550,toolbar=no,scrollbars=no’)”);  
}  
\</script\>[/AS]

html code:  
[AS]\<script language=“JavaScript”\>  
function openNewWindow(URLtoOpen, windowName, windowFeatures) {  
newWindow=window.open(URLtoOpen, windowName, windowFeatures);  
}[/AS]

I get a error every time and no popup loads. Any ideas?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 28, 2003, 11:40pm UTC](https://forum.kirupa.com/t/some-javascript-in-flash-problems/29639/2 "2003-08-28T23:40:10Z")

</div>

I don’t know, but why not use the tutorial here?

Because I’m lazy, I would just put:

```auto

getURL("java/script:window.open('news.htm','news','=400,width=550,toolbar=no,scrollbars=no');");

```

The second thing in the javascript is the new window’s name, not target - but I don’t think that would stop it from working

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 28, 2003, 11:45pm UTC](https://forum.kirupa.com/t/some-javascript-in-flash-problems/29639/3 "2003-08-28T23:45:25Z")

</div>

The one here blocks mutliply winodws form beeing open and error’s if you use any spaces in your title.

With your chages do i have to chage the HTML code?

i have the code on the news button here  
[http://www.sintax321.com/stc/stc.html](http://www.sintax321.com/stc/stc.html)  
you cna see i get an error every time.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 29, 2003, 1:12am UTC](https://forum.kirupa.com/t/some-javascript-in-flash-problems/29639/4 "2003-08-29T01:12:34Z")

</div>

:bump:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 29, 2003, 1:20am UTC](https://forum.kirupa.com/t/some-javascript-in-flash-problems/29639/5 "2003-08-29T01:20:09Z")

</div>

You wouldn’t use the code in HTML because window.open will work by itself.

The reason that you can’t open multiple windows with the tutorial here is because that second atribute in the javascript code is the new window’s name. If you change that second atribute for each code set, then it will open multiple windows.

Hang on…I’ll make a fla 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 29, 2003, 1:30am UTC](https://forum.kirupa.com/t/some-javascript-in-flash-problems/29639/6 "2003-08-29T01:30:00Z")

</div>

thanks freddy

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 29, 2003, 2:11am UTC](https://forum.kirupa.com/t/some-javascript-in-flash-problems/29639/7 "2003-08-29T02:11:16Z")

</div>

You bet - here’s what I did:  
[http://www.freddythunder.com/test/sintax.html](http://www.freddythunder.com/test/sintax.html)

Each of the three windows has a unique window name ‘pic1’,‘pic2’, and ‘pic3’. The AS in the tutorial had to be doctored a little because before it checked for the variable from the button ‘myWin’ if it had been activated - well I got rid of all that!! :evil:

I also added top and left as locations instead of them all being centered - you’ll see all that crap in the code.

Umm…I don’t know what you meant by ‘spaces in your title’. Do you mean the title of the window that you’re opening? Beacuse that’s done in the html code that you are opening, ie, you open sintax.html that has HTML code that starts like:

```php

<head>
<title>This is sintax.html - so there!</title>
</head>
<body>
//etc etc...

```

I think that should about do it for ya? Yeah? Anything else lemme know - _and thanx for making me a pixel Kirupian!!!_😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 29, 2003, 6:38am UTC](https://forum.kirupa.com/t/some-javascript-in-flash-problems/29639/8 "2003-08-29T06:38:51Z")

</div>

thanks a ton man. I’ll lplay around and see how things go.
