inserting javascript into flash buttons in DW

  Amadas 17:26 18 Dec 2004

Good day all,

I'm having difficulty placing a javascript behaviour (open browser window) into a flash button "link" within dreamweaver MX.

I'm trying achieve a link that will open a new window at a certain size. Although I've gone to the macromedia support site and followed their instructions, it still does not work. This is becoming rather frustrating.

The page I wish to open is "VR/main.htm" with a size of 500 px X 540 px.

Any ideas?


  smudge101 20:03 18 Dec 2004

Place this in the <HEAD>

<script language="JavaScript">
function openCenterWin(url,theWidth,theHeight){
var theTop=(screen.height/2)-(theHeight/2);
var theLeft=(screen.width/2)-(theWidth/2);
var features=

Your button link will be something like this:

<a href=javascript:openCenterWin("YourPage.htm",500,540)><font face="Microsoft Sans Serif" size="2" color="#FFCC00">Directions</a>

This will also centre your window to the screen

Hope this helps

  smudge101 20:10 18 Dec 2004

Sorry, obviously you need to substitute "YourPage.htm" with "VR/main.htm"

  Amadas 20:30 18 Dec 2004

Thank you smudge 101, I knew I'd get my answer here.

I needed to modify the code a bit.


Is what I needed to place within the "link" field of the flash button for it to work.

Thanks again, it's working like a charm.


This thread is now locked and can not be replied to.

Elsewhere on IDG sites

AMD Radeon Adrenalin release date, new features, compatible graphics cards

8 brilliant character artists speaking at Pictoplasma 2018

iMac Pro release date, UK price & specs

Football : comment regarder la Ligue 1 en direct ?