dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: jpg in javascript popup window?

  1. #1
    Member
    Join Date
    Feb 2002
    Posts
    45
    I know how to open already made html file in a javascript but what I need is to open jpeg in a javascript. With the script I'm using below it opens the window but it leaves left and top margin not at 0 so the picture is a bit off to the buttom right.
    on (release) {
    getURL("javascript:window.open('pic.jpg','','width =1024,height=768,top=0,left=0,scrollbars=no'); void(0);");
    }

    I tried putting leftmargins=0 but it still doesn't work
    on (release) {
    getURL("javascript:window.open('pic.jpg','','width =1024,height=768,top=0,left=0,bgcolor=#000000,left margin=0,topmargin=0,scrollbars=no'); void(0);");
    }

    Anybody know what should I put so it doesn't leave those margins?

    Thanks

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    it is a bit more complex, then...
    function openjpg(image, w, h)
    { win = window.open('', 'image', 'width='+w+',height='+h+,'... other properties');
    win.document.write('<body margin-left=0 ....>'+
    '<img src="'+image+'" width='+w+' height='+h+' border=0>');
    win.document.close();
    }
    This way you can put all the style tags you need for different browsers into the body tag

    Musicman

  3. #3
    Member
    Join Date
    Feb 2002
    Posts
    45
    Is it a flash syntax? Cause when I tried this, it gives me a bunch of errors. Could you please clarify with all the parantheses and with
    on (release) {
    beginning and end.

    I tried this:
    code:
    on (release) {
    getURL("win = window.open('', 'cs_assault0007.bmp', 'width='800',height='600')");
    win.document.write(''+
    '');
    win.document.close();
    }

    and it doesn't work, just opens the blank window in the same window.

  4. #4
    Member
    Join Date
    Feb 2002
    Posts
    45
    Musicman come back! I need you here man

  5. #5
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    it is a bit of javascript to place into your html page,
    so in the movie you would do
    on(release) {
    getURL("javascript:loadjpg('flowers.jpg', 450, 300)");
    }

    Musicman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center