inserting javascript into flash buttons in DW

  Amadas 17:26 18 Dec 04

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 04

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 04

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

  Amadas 20:30 18 Dec 04

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.

Microsoft Surface Studio PC release date, pricing, design, features and spec: Microsoft showcases…

1995-2015: How technology has changed the world in 20 years

This amazing app turns your iPad Pro into a Cintiq

Apple Q4 2016 financial results | Apple earnings report: iPhone, iPad and Mac sales down, profits d6…