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,077 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 …
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 video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

19 Experts available now in Live!

Get 1:1 Help Now