A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Auto Resize

  1. #1
    Getting better day by day.....
    Join Date
    Mar 2005
    Location
    United Kingdom
    Posts
    79

    Auto Resize

    I HAVE NOTICED THAT ON SOME WEBSITES THE SIZE OF THE SWF AUTOMATICALLY RESIZES TO FIT IN THE BROWSER WINDOW.

    THE SITE I HAVE CREATED IS 900 PIXELS WIDE AND 700 PIXELS WIDE, WHICH WORKS FINE ON MY PC, BUT ON THOSE WITH LOWER RESOLUTION IS USELESS.

    CAN ANYONE TELL ME HOW TO ACHEIVE THIS AUTO RESIZING.

    I AM IMPORTING THE FILES INTO FRONTPAGE 2000 BEFORE PUBLISHING TO THE WEB.

    AN EXAMPLE THE MAIN INTERFACE CAN BE FOUND AT www.martyn.guitarman.ukonline.co.uk

    THANKS

    MARTYN

  2. #2
    Degenerate and baise art thou. docree's Avatar
    Join Date
    Feb 2001
    Location
    USA
    Posts
    390
    Set your width in the page's code to %.
    Such as 99% by 99%. It does not always give the best
    results, but works none the less.

    My Caps Lock key was broken, once, too.

    Hey guys, I'm back on my meds. Whoo-Hoo! j/k
    DocRee

  3. #3
    Can't Re- Member gusmus's Avatar
    Join Date
    Sep 2002
    Location
    España
    Posts
    663
    Here is the section of code you need to change. As Docree pointed out, it doesn't always give the best results but it works. If you compare the " Width & Height " sections of the code with the original code KM generates you will notice that the sizes have been changed to "%" instead of "px".
    As the size of your SWF is large "900 X 700 px", you should have no problems but be careful when using anything smaller than 600 X 400 px as it can lead to distortion on larger monitors.

    <object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" id=index width=100% height=100%codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0">
    <param name="movie" value="index.swf" />
    <param name="quality" value="high" />
    <param name="play" value="true" />
    <param name="loop" value="true" />
    <param name="bgcolor" value="#ffffff" />
    <embed src="index.swf" width=100% height=100% bgcolor="#ffffff" quality="high" loop="true"

    If you want your swf to be full screen then I wonder why you are embedding into "Frontpage", The KM generated html will do the jobe just as well.
    humanus somes est divinitus in ipsum
    Wiliiam Wallace

  4. #4
    Getting better day by day.....
    Join Date
    Mar 2005
    Location
    United Kingdom
    Posts
    79
    Dear Gusmus

    I've always avoided the changing of the code because it appears to be in Japennese hehehe
    However, i took your good adive and changed the width and height values to 100% using the hmtl editor in Frontpage. It did exactly what I was trying to acheive. Now the poor sods with low resolution will need a magnifying glass hehe

    Thanks matey!!!!!

  5. #5
    Can't Re- Member gusmus's Avatar
    Join Date
    Sep 2002
    Location
    España
    Posts
    663
    Glad it helped,,, but dump the frontpage and html your stuff,, frontpage makes huge files full of gobbldeygook just to do the same job.
    humanus somes est divinitus in ipsum
    Wiliiam Wallace

  6. #6
    Member
    Join Date
    May 2005
    Location
    Germansky
    Posts
    58

    It worked so far...

    Hi Dudes!
    Replacing fixed width/height to percents (I used 99%) works fine...
    with Internet Explorer. In Mozilla Firefox the SWF is displayed
    in thumbnail size, even smaller than the original "creation" size.

    I know the Slideshow I did there looks very poor (replaced for 5hItty..
    got censored ) ... I was busy on other things, so its just a placeholder
    for the final animation.

    Getting rid of Mocrisoft Products (Gusmus is absolutely right) like
    M$ Office (alt=OpenOffice.org - fine javabased free stuff) or
    Frontpage (better learn some HTML and edit manually) I don´t want
    to use and recommend Exploder anymore...

    So any Ideas to make this autosizing work on Mozilla/Firefox?
    By the way: I my case the HTML is opened in a JS-popup,
    maybe thats the cause for this malfunction(?) ?

    You´ll find the flash-popup under Menuentry "Die Story"
    clicking on the Image or on the foot phrase "Band-History en detail...."
    Here is the site : http://www.piccadilly.musicpage.de
    Last edited by hule2; 10-01-2005 at 05:14 PM.
    Let me learn from you!
    -always under construction-

  7. #7
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    When you want to display your swf using a percentage, always check how it looks in different window sizes. Most of the times it isn't a good idea. Bitmaps look worse, shapes may be off by a pixel due to rounding issues, dynamic text may be hard to read.

    It usually works better if you want to cover the whole stage to access the width and height properties of the stage and place and scale your objects dynamicly using scripting or center the content.

  8. #8
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    Quote Originally Posted by hule2
    Hi Dudes!

    You´ll find the flash-popup under Menuentry "Die Story"
    clicking on the Image or on the foot phrase "Band-History en detail...."
    Here is the site : http://www.piccadilly.musicpage.de
    Is this a german rock band or what?
    Any programming language is at its best before it is implemented and used.

  9. #9
    Degenerate and baise art thou. docree's Avatar
    Join Date
    Feb 2001
    Location
    USA
    Posts
    390
    Some links to get started in the right direction...

    Check out the scale mode...
    OBJECT and EMBED tag attributes
    IE: <param name="scale" Value="exactfit">

    Tech note: size limited in FireFox...
    This may be the cause and offers a work around.

  10. #10
    Member
    Join Date
    May 2005
    Location
    Germansky
    Posts
    58

    101 Percent lol

    EXACT FIT!

    100% Hit by Doc Ree.
    Found my Info.
    Thanks so much.

    @ w.brants: You rock, but in this case all thoughs are wasted time...
    but, thanks for watchin/helpin anyway.

    @ tmoore935 : I really LOVE not just like your style... and your kind of music..
    --That subject is a REVIVAL site of an 70s Cover Band (CCR etc.)

    @ docree : YOU DID it ... in this case, where "nothing else matters", btw one of my favs songs by metallica, i followed your linx and GOT HAPPY!


    IT WORKS! Thats all...
    Fine work, guys.

    stefan
    Last edited by hule2; 10-01-2005 at 08:35 PM.
    Let me learn from you!
    -always under construction-

  11. #11
    Degenerate and baise art thou. docree's Avatar
    Join Date
    Feb 2001
    Location
    USA
    Posts
    390
    Remember guys [and girls], you need the tags for both EMBED and OBJECT for it to work...
    It's where many projects go sour.

    Now that I've seen that tech note,
    I need to check my sites that are going size crazy in FF.

    Thanks, Stefan.
    A round of applause for Brants, Tmoore, and the rest of the gang.
    Oh the tangled web we weave.

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