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
1,087 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Spry missing in DWcc 6 308
Download all files with one click 7 593
Saving Form Data when Leaving Page 3 356
Element Positioning for Fluid Grid Layout 6 119
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…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now