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,122 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SWF won't scale? 4 534
Question about Dreamweaver CC 1 313
Error pops up while using DWCSS 2015 11 168
MAC Dreamweaver connect to external MS SQL Server 2 39
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…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

738 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