Results 1 to 3 of 3

Thread: newbie question: resizing backgrounds

  1. #1
    Join Date
    May 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default newbie question: resizing backgrounds

    Hi

    I really don't know much about flash or swf files but in updating my portfolio I came across Polaroid gallery. I have managed to update the background jpeg with my own picture and remove the fade effect. However in the original program the background was tileable so when seen in a full screen browser looked fine.

    As my picture is not tileable I would like to know if it is possible to scale the background or the whole swf object without tiling the background.

    Thank you for any help you can give

  2. #2
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    If your background image is a static file, eg .gif, jpg, etc. I know a way that scales the background to fit the window.

    There is a proviso to this, it will lose resolution if the original is too small.

    In the header section, or adapt for a CSS file :-
    HTML Code:
    <style type="text/css">
    #background_image {
    	position: absolute;
    	top: 0px;
    	left: 0px;
    	height: 100%;
    	width: 100%;
    	z-index: 1;
    }
    
    #page {
    	position: absolute;
    	top: 0px;
    	left: 2px;
    	z-index: 2;
    	height: 100%;
    	width: 100%;
    	overflow: auto;
    }
    </style>
    Immediately after <body> put this
    HTML Code:
     <img src="myimage.jpg" alt="my background" id="background_image">
    and then wrap the rest of your code in this div

    HTML Code:
    <div id="page">
    Rest of my body code
    </div>
    You may be able to adapt this to fit your requirements, it may be possible to replace the 'img src' above with a swf.

    However, for static pages, most people actually make their background image larger and let HTML/CSS resize it automatically to fit the screen size

  3. The Following User Says Thank You to forum_amnesiac For This Useful Post:

    Malco (05-15-2009)

  4. #3
    Join Date
    May 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much for your reply, I have spent some time playing around with the files now and although that wasn't quite what I was looking for I realised that it could be a work around.

    After adding the transparent parameter, removing the background from the swf and setting the two IDs to different z layers it appeared to be working. Unfortunately the z layers (or maybe position absolute?) seems to affect the swf and double clicking no longer enlarges the images


    HTML Code:
    <img src="background.jpg" alt="my background" id="background_image"> 
      <div id="fullscreendemo">
      <strong>This site requires Flash Player 8.0 or greater</strong><br />
      Please click <a href="http://www.adobe.com/products/flashplayer/">here</a> to download.<br />
      If you are sure you have the required version, press this link: <a href="readme.html?detectflash=false">bypass the detection</a>.
      </div>
    <script type="text/javascript">
    //<![CDATA[
    var so = new SWFObject("polaroid.swf", "polaroid", "100%", "100%", "8", "#FFFFFF");
    // specify the url to the xml-file, default is photos.xml
    so.addVariable("xmlURL","photos.xml");
    so.addParam("wmode","transparent");
    so.write("fullscreendemo");
    //]]>
    </script>

Bookmarks

Posting Permissions

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