Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using Dreamweaver to get a Flash button's click action to open a "popup" in a new, resized window

Posted on 2003-11-08
8
Medium Priority
?
1,131 Views
Last Modified: 2010-04-25
I used Dreamweaver to create a Flash button that links to a slideshow I created.  I would like the button to open a new, resized window without any IE toolbars when it is clicked.

I used Dreamweaver to create an onClick action that should result in a new, resized window without toolbars.  A new window does open but it includes the toolbars and is not resized.

Here is the code that appears within my head tags:

<SCRIPT Language=JavaScript>
function MM_openBrWindow(theURL,winName,features) { //v2.0
  alert( "MM_openBrWindow has been called" );       // debugline
  window.open(theURL,winName,features);
}
//-->
</SCRIPT>

I added the debugline to see if the function is ever even activated and never received the alert.

Here is the code I am using for the Flash button:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="103" height="24" onClick="MM_openBrWindow('yachts.htm','yachts2','width=640,height=480')">
          <param name="BASE" value=".">
          <param name="movie" value="marine.swf">
          <param name="quality" value="high">
          <param name="bgcolor" value="#000099">
          <embed src="marine.swf" base="." quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="103" height="24" bgcolor="#000099" onClick="MM_openBrWindow('yachts.htm','yachts2','width=640,height=480')"></embed>
        </object>

This is my first experience with Flash buttons so hopefully it is just something stupid in the code I missed.

Thanks in advance!

-Scott
0
Comment
Question by:Gobernaster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 8

Expert Comment

by:klykken
ID: 9710532
The onlick statment needs to be done in actionscript from within the flash file.
Look here: http://www.macromedia.com/support/flash/ts/documents/popup_windows.htm

-klykken
0
 
LVL 8

Expert Comment

by:klykken
ID: 9710536
The getURL:"javascript" is what you're looking for.
http://www.macromedia.com/support/flash/ts/documents/popup_windows.htm#geturljs

-klykken
0
 

Author Comment

by:Gobernaster
ID: 9710771
klykken,

I followed the instructions in the getURL:"javascript" link you provided and ended up with the following code in between my head tags:

<SCRIPT>

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->

function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
</script>

And the following code for my flash button:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="103" height="24" onClick="MM_goToURL('parent','javascript:openNewWindow('http://www.macromedia.com','thewin','height=400,width=400,toolbar=no,scrollbars=yes')');return document.MM_returnValue">
          <param name="movie" value="marine.swf">
          <param name="quality" value="high">
          <param name="bgcolor" value="#000099">
          <embed src="marine.swf" base=""  quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="103" height="24" bgcolor="#000099" swLiveConnect=true NAME=marine.swf></embed>
        </object>

I am sure it is a mistake I am making, but the function still never even seems to be called.

Please help...
0
Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

 
LVL 8

Expert Comment

by:klykken
ID: 9710840
Yes you are making a mistake :-)

"object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="103" height="24" onClick="MM_goToURL('parent','javascript:openNewWindow('http://www.macromedia.com','thewin','height=400,width=400,toolbar=no,scrollbars=yes')');return document.MM_returnValue">
"

You cannot put the javascript into the <object> tag as you've done above. You have to do it inside you *flash* file like the links I gave you describes. It is done with Actionscript which is very similar to javascript, but it runs inside the .fla file. You have to open you .fla file in Macromedia Flash to insert the onlick valies for your pop-up window.

Follow the guidlelines here exactly:
http://www.macromedia.com/support/flash/ts/documents/popup_windows.htm#geturljs

As you can see, the javascript needs to be exactly like this:
<script language="JavaScript">
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
</script>

And in  your Flash file, (open it in Macromedia Flash):
1. Assign the getURL action to a button or keyframe.
2. For the URL, insert the code below, copying the information exactly.

javascript:openNewWindow('yachts.html','yachts2','height=480,width=640,toolbar=no,scrollbars=yes')

Make sure it's all in one line in your input field.

-klykken

 
0
 

Author Comment

by:Gobernaster
ID: 9710922
I figured it had to just be me.

The problem is that the button I am using is a standard button that came with DreamWeaver so what I have is the .swf file, not the actual .fla file.  That is why I was not editing it within flash...

Is there any way to add the Actionscript within DreamWeaver?
0
 
LVL 8

Accepted Solution

by:
klykken earned 1000 total points
ID: 9710929
Gobernaster,
Ah I see. I think this Technote from Macromedia addresses the solution for this:

Using the Open Browser Window behavior with Flash Buttons
http://www.macromedia.com/support/dreamweaver/ts/documents/fl_button_openbrowser.htm

-klykken
0
 

Author Comment

by:Gobernaster
ID: 9711014
PERFECT!!!  Thank you klykken!!!!!!  Sorry you had to work so hard for those points.
0
 
LVL 8

Expert Comment

by:klykken
ID: 9711099
No Problem, the points amount was appropiate :-)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question