View Full Version : attaching Javascript to Flash button in Dreamweaver.

Aug 22nd, 2003, 12:59 PM
Hello all.

As stated I'm trying to add a javascript to a Flash button but I'm not exactly sure how to, by hand or via dreamweaver ultradev. I already have a popup on my site from a link so I know how to do them, it's attaching them to Flash buttons that confuses me.

javascript:popUp('http://www.whatever.html') is what I've put for the link for the flash button + I have the necessary code in the <head> tag but a regular sized window opens with javascript:popUp('http://www.whatever.html') in the location bar, and it says that the page cannot be found. If anyone would be so gracious as to tell me what I am doing wrong it would be greatly apprecitated. Thank You in advanced.


Aug 22nd, 2003, 01:06 PM
^ I think you all know what goes there in place of the smiley face! it's : P without the space. Oops!

Aug 22nd, 2003, 04:34 PM
In DreamWeaver UltraDev you should be able to click on the flash button in your window, and, in the behaviors panel on the right hand side, click the '+' button and add any javascript element they let you. Did you try that?

Aug 22nd, 2003, 07:05 PM

I didn't think additional behaviors could be applied to Flash text via Dreamweaver. So I figured it would be possible to do it manually. the article says I could apply more behaviors with Flash, but I don't have flash and was looking for a work-around. But thank you so much bradyj for taking the time out to even read and reply, I really appreciate it.

Aug 22nd, 2003, 07:47 PM
You're more than welcome!:thumbsup:

Hmm... that is unusual, but it does make sense. I know I can use ActionScript in Flash to do similiar things, but I was unaware that the <embed> would not work otherwise with javascript.

Are you on a PC or Mac?

Any of you JavaScript junkies know if there's a work around?

Sep 5th, 2003, 06:42 PM
Try this code:

on (release) { getURL("javascript:var mypopup = window.open('http://www.google.com','mySite','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizab le=1,width=500,height=300,top='+eval((screen.availHeight - 300) / 3)+',left='+eval((screen.availWidth - 500) / 2));mypopup.focus();"); }

Sep 5th, 2003, 09:16 PM
[email protected], thank you for replying. I will keep that code for future reference but since my post I have scrapped the idea of adding popup windows to Flash buttons. lol, I couldn't figure out, but now I have a completely new layout devoid of the buttons period.. But thank you so much for helping, whether the code works or not, I really appreciate your time.

Sep 5th, 2003, 09:20 PM
Originally posted by supernova82
[email protected], thank you for replying.

np feller ;)