dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: window size doesnt fit exactly to image loaded?!?!?!?! This is driving me nuts!!!

  1. #1
    I need to make a window pop up when clicking a button in flash that will load an image and the window will fit exactly to the size of the image without bars, scrollbars...etc...

    go to http://www.andallthatcouldhavebeen.com and enter. Then click on the little box in the left hand bottom corner and an image should pop up in a window that fits it exactly...that's what I need to do, can anyone help!?!??!

    Mike


    Please help this is driving me nuts!!!!

  2. #2
    Flashbuzzer eastb's Avatar
    Join Date
    Oct 2001
    Posts
    274

    maybe this picture is used as background.
    seems simple.
    <body background="....">
    then when you open the file, specify the exact width, height and options like noscrollbars etc.
    use javascript, it's the easiest.

  3. #3
    absent
    Join Date
    Aug 2000
    Location
    NB, Canada
    Posts
    155

    Angry

    have you tired putting MARGINHEIGHT="0" MARGINWIDTH="0"
    TOPMARGIN="0" LEFTMARGIN="0" in the BODY tag?..
    this will make the perfect fit for the top corners...
    you can also specify in the popup that you'd like
    no scrolling, so if the image is larger than the windows
    it'll just cut it off..

    hope that helps.. ^_^


  4. #4
    Loop Junkie calpomatt's Avatar
    Join Date
    Mar 2001
    Location
    CA
    Posts
    855
    Looks like it's working fine to me...

    Here some javascript code that opens up a window the same size as the image...and you use the same code for every image:

    <SCRIPT LANGUAGE="JavaScript">

    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->

    <!-- Begin
    function CaricaFoto(img){
    foto1= new Image();
    foto1.src=(img);
    Controlla(img);
    }
    function Controlla(img){
    if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
    }
    else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
    }
    }
    function viewFoto(img){
    largh=foto1.width+20;
    altez=foto1.height+20;
    stringa="width="+largh+",height="+altez;
    finestra=window.open(img,"",stringa);
    }
    // End -->
    </script>

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