open picture using getURL (two parter)

I have a web site where i wish to have a 'click to enlarge' button.
I can easily do this with:
on (release) {
      getURL ("pictures/building.jpg" ,"_new")

my problem is, I wish the browser to open at the size of the picture, not full screen.

see link below for an exact example of what i want to do:

I know this is not flash, but is it possible?
If not, how to I recreate this including the 'close window' button?
are there any tutorials? Need to learn quickly.
I do have access to dreamweaver but have rarely used it.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Do you know the size of the pictures? then you can use:


sledgeAuthor Commented:
thanks Roonaan.

flash originally reported the following errors:

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 2: ')' or ',' expected

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 3: Unexpected '}' encountered

Total ActionScript Errors: 2        Reported Errors: 2

due to single and double quote problems had to change the script in flash to this :

on (release) {

when i run it, nothing happens.

Where have I messed up the code?
Might be that the javascript call only works when run from browser. Can you test that for me?

Also, you might need to change the "_blank" into "myWindow", as is already opening a new window, and "_blank" is a value you would use for target, not as windowname.

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

sledgeAuthor Commented:
changed "_blank" to "myWindow", published out and ran through I.E. still the same result. I did notice at the bottom left of I.E where it says 'done', there is a yellow triange with an exclamation mark in it.
Put this in the <head></head> area of your html document.  Change the commented values in the top lines if neccessary:

<script language='javascript' type='text/javascript'>
smallestWidth  = 200; // Approx width of smallest image you'll use
smallestHeight = 200; // Approx height of smallest image you'll use
xOffset = 100; // Distance window pops from left
yOffset = 100; // Distance window pops from top
var closeOffFocus = true; // True-Window will close when focus is lost(i.e. they click the main window again.  Change to false if you don't want this.

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+smallestWidth+',height='+smallestHeight+',left='+xOffset+',top='+yOffset;
var optIE='scrollbars=no,width=150,height=100,left='+xOffset+',top='+yOffset;
function popIt(imageURL,imageTitle){
if (isNN){'about:blank','',optNN);}
if (isIE){'about:blank','',optIE);}
with (imgWin.document){
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('function sizeIt(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');      

writeln('function writeTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!closeOffFocus) writeln('</head><body bgcolor=000000 scroll="no" onload="sizeIt();writeTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="sizeIt();writeTitle();self.focus()" onblur="self.close()">');
writeln('<img name="someImage" src='+imageURL+' style="display:block"></body></html>');

Now your actionscript code would be:

on (release) {
getURL("javascript:popIt('yourImageName.jpg','Title to appear in title bar of window here.');");

"I wanna study Theology - I've always been a big fan of the word 'the' and don't feel it's been properly defined yet." - Sam 1970-Still Kicking

sledgeAuthor Commented:
thanks sam85281.
I have no knowledge of javascript at all. what parts of your code do i change for my picture name and where it is in a sub directory?
try using "_self" for target.
... hmmm, on closer insepction... you need target in the actionscript call... and to possibly name your js window something else...

on (release) {
sledgeAuthor Commented:
managed it with this code found on the macromedia web site.


function openNewWindow(URLtoOpen, windowName, windowFeatures) {, windowName, windowFeatures);

<BODY bgcolor="#FFFFFF">
<!-- URL's used in the movie-->
<A HREF=javascript:openNewWindow('/pictures/building.jpg','thewin','height=360,width=480,toolbar=no,scrollbars=yes') ></A> <!-- text used in the movie-->
<!--This button opens a new window method: getURL:"javascript" --><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 WIDTH=400 HEIGHT=250>
 <PARAM NAME=movie VALUE="test.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="test.swf" quality=high bgcolor=#FFFFFF  WIDTH=400 HEIGHT=250 TYPE="application/x-shockwave-flash" PLUGINSPAGE=""></EMBED>


on (release) {
      getURL("javascript:openNewWindow('pictures/building.jpg','thewin','height=360,width=480,toolbar=no,scrollbars=yes') ");
sledgeAuthor Commented:
Discovered this one:

<BODY bgcolor="#FFFFFF">
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
function FSCommand_DoFSCommand(command, args) {
  var FSCommandObj = InternetExplorer ? FSCommand : document.FSCommand;
{if(command=="openbuilding"){ openNewWindow()}}function openNewWindow(){setTimeout('pictures/building.jpg','newwindow',
// Hook for Internet Explorer
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
        navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
      document.write('<SCRIPT LANGUAGE=VBScript\> \n');
      document.write('on error resume next \n');
      document.write('Sub FSCommand_FSCommand(ByVal command, ByVal args)\n');
      document.write('  call FSCommand_DoFSCommand(command, args)\n');
      document.write('end sub\n');
      document.write('</SCRIPT\> \n');


on (release) {

Many thanks to all for your help.

Dushan De SilvaTechnology ArchitectCommented:
Sometimes following solution might help for you.

BR Dushan
The javascript I gave you will work for any image, you don't need to designate the image in the javascript, only in the ActionScript:

Using your original example, the code would be:

on (release) {
getURL("javascript:popIt('pictures/building.jpg','This Is A Really Nice Building');");

PAQed with points refunded (300)

Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.