A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: window scrollbars

  1. #1
    Junior Member
    Join Date
    Sep 2004
    Posts
    18

    window scrollbars

    I have my flash file 700x700 published in html with noscale option. It is centered in the screen on white background. The thing is that when you scale window or open site in small resolution (640x480) part of the flash is cut out and there is no normal html scrollbar on the right. I would like to get vertical and/or horizontal scrollbar when resizing window on less than 700x700.

  2. #2
    Senior Member random25's Avatar
    Join Date
    Apr 2002
    Posts
    566
    depending on how the .swf is embedded you may be able to use:
    <param name="scrolling" value="auto">

    If you want to make an apple pie from scratch, you must first create the universe. Carl Sagan

  3. #3
    Junior Member
    Join Date
    Sep 2004
    Posts
    18
    but where this code goes

    this is my html:

    <!-- saved from url=(0013)about:internet -->
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
    <title>PeternelGrupa</title>



    <script language="javascript"> AC_FL_RunContent = 0; </script>
    <script language="javascript"> DetectFlashVer = 0; </script>
    <script src="AC_RunActiveContent.js" language="javascript"></script>
    <script language="JavaScript" type="text/javascript">


    <!--
    // -----------------------------------------------------------------------------
    // Globals
    // Major version of Flash required
    var requiredMajorVersion = 8;
    // Minor version of Flash required
    var requiredMinorVersion = 0;
    // Revision of Flash required
    var requiredRevision = 24;
    // -----------------------------------------------------------------------------
    // -->
    </script>
    <style type="text/css">
    body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    }
    </style>
    </head>
    <body bgcolor="#ffffff">

    <!--url's used in the movie-->
    <!--text used in the movie-->


    <script language="JavaScript" type="text/javascript">
    <!--
    if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
    alert("This page requires AC_RunActiveContent.js.");
    } else {
    var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
    if(hasRightVersion) { // if we've detected an acceptable version
    // embed the flash movie
    AC_FL_RunContent(
    'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0',
    'width', '100%',
    'height', '100%',
    'src', 'PeternelGrupa',
    'quality', 'best',
    'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
    'align', 'top',
    'play', 'true',
    'loop', 'true',
    'scale', 'noscale',
    'wmode', 'window',
    'devicefont', 'false',
    'id', 'PeternelGrupa',
    'bgcolor', '#ffffff',
    'name', 'PeternelGrupa',
    'menu', 'true',
    'allowScriptAccess','sameDomain',
    'allowFullScreen','false',
    'movie', 'PeternelGrupa',
    'salign', 't'
    ); //end AC code
    } else { // flash is too old or we can't detect the plugin
    var alternateContent = 'Alternate HTML content should be placed here.'
    + 'This content requires the Adobe Flash Player.'
    + '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
    document.write(alternateContent); // insert non-flash content
    }
    }
    // -->
    </script>
    <noscript>

    // Provide alternate content for browsers that do not support scripting
    // or for those that have scripting disabled.
    Alternate HTML content should be placed here. This content requires the Adobe Flash Player.
    <a href="http://www.macromedia.com/go/getflash/">Get Flash</a>
    </noscript>
    </body>
    </html>

  4. #4
    Senior Member random25's Avatar
    Join Date
    Apr 2002
    Posts
    566
    I would stick it right after the salign parameter like this:

    'allowFullScreen','false',
    'movie', 'PeternelGrupa',
    'salign', 't'
    'scrolling' 'auto'

    If you want to make an apple pie from scratch, you must first create the universe. Carl Sagan

  5. #5
    http://www.in3d.eu Kostas Zotos's Avatar
    Join Date
    Jul 2007
    Location
    Athens - Greece
    Posts
    408
    Hello all,

    Maybe put your contents inside a div layer wich has fix dimension so that force the browsers to show the scrollbars when scaled down..

    Here is a possible example (HTML code):
    Code:
    <html>
    ... ... 
    ... ...
    
    <body>
    <center>
    
    <div  style="width:750px; height:750px; text-align:center">
    
    <table  width="100%" height="100%" border="0">
    <tr>
    <td align="center" valign="middle" >
      
      <!-- your flash exported code goes here -->
     
    </td>
    </tr>
    </table>
    
    </div>
    
    </center>
    </body>
    
    </html>
    Note: Insert your div style (instead of: width:750px; height:750px) dimension values

    Kostas
    Last edited by Kostas Zotos; 02-07-2008 at 03:46 PM.
    K. Zotos online portfolio: http://www.in3d.eu

  6. #6
    Junior Member
    Join Date
    Sep 2004
    Posts
    18
    is there any java script that can add scroll bars if page is resized to less then 700x700px?

  7. #7
    An Englishman in Frankfurt Jimbrowski's Avatar
    Join Date
    Nov 2006
    Posts
    240
    I had a similar problem last night....

    I wanted just a vertical scrollbar to appear if needed, whilst hoping to get the browser to ignore the need for a horizontal bar.

    I published the swf with: height 100% and width 100%.....

    Then edited the html page in all 3 places to say: width="100%" height="786", where 786 is the exact pixel height of my swf.

    Works perfectly in all browsers tested - a vertical scrollbar appears when needed (on laptops for example) but the browser never feels the need to add horizontal bars thankfully.

    Jimmy

  8. #8
    Junior Member
    Join Date
    May 2002
    Posts
    4
    Jimbrowski thanks a lot. Used your same solution on a problem I was having and it works. (At least it works on Firefox and Safari on a Mac. I still need to look at it under MSIE.)

  9. #9
    Junior Member
    Join Date
    Apr 2008
    Posts
    8

    hey I've got a slightly more complex problem of the same nature

    I have a SWF that resizes itself by listening to a resize event
    ---------------
    //Add listener to stage to check for resize
    var stageListener:Object = new Object ();
    Stage.addListener (stageListener);
    // When the Stage dimensions change...
    stageListener.onResize = stretch;
    --------------------------------

    the stretch function places several movies on the screen without changing the aspect ratio of each of the original mc's (though it resizes some of them them as the stage expands). In order for the function to work properly, It seems that I have to have the HTML dimensions set to 100%.

    and so the problem is...

    Beyond a certain point, menus and text start to get too small to read, and to stop this I have made the stretch function stop reducing the size of the stage and changing the x/y placement of mc's when the stage is smaller than 700X560. At this point it begins cutting off the left and/or bottom of the stage. If the html window is smaller than 700X560 I want the explorer's scroll bars to appear.

    If I set the HTML dimensions to 700X560 the stretch function doesn't change anything when the window is resized (though if the window is smaller than this it shows the scrollbars). And if the HTML dimensions are set at 100% then the scrollbars do not appear even when the stage is being cut off.

    is there some workaround to get it to react the way I want?

    Thanx in advance-

    ProxRox

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