A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Flash site scaling in browser

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    17

    Flash site scaling in browser

    Im designing a website but having trouble viewing the whole page on different sized monitors. On more square resolution monitors, the left side of the website will get cut off. If you scale the browser window up, to a more widescreen format again the site will come back into view, but as you scale your browser window to the left e.i. making it more square, agian the left side gets cut off.

    anyone know how to prevent or fix this?
    the site address is
    http://www.kithent.com/v2

  2. #2
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    I'm not exactly sure what your intentions are for viewing but sites I have done with large , full screen images , are done like this.

    Code:
    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.align         = StageAlign.TOP_LEFT;
    where as , you dont want to scale the entire swf , but rather add an event listener at the document , or root level , to handle the resize event.

    Code:
    stage.addEventListener(Event.RESIZE, resizeHandler);
    
    private function resizeHandler( evt : Event ) : void {
        //here you would resize the background image , and or mask which
        //usually works best
    };
    If you wanted to be thorough , you would resize a mask to the stageWidth and stageHeight , and you would resize the background image being masked , proportionately underneath.. meaning , you would need to do some additional math to ensure that image maintains its aspect ratio. otherwise , its going to get all squished. If your image is very wide in relation to its height , then its more 16:9 , and you would want to preserve that the best you can when resizing.

    Lastly , I always add in some javascript , to help manager scrollbars. Because even with a liquid layout , there going to come a point on lower resolutions, where the user can resize the browser so small , they can no longer interact with the nav , unless , you resize the div , or mark up element the swf is written into.

  3. #3
    Junior Member
    Join Date
    Oct 2009
    Posts
    17
    Ya I really need to get goin on learning javascript, any chance you could post some help for that?

  4. #4
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    yes i can. i dont really feel like typing all that here but take a look at this source :

    Code:
    http://adamyorkdev.com/js/main.js
    theres a bunch of ajax stuff you can just ignore. The idea is you set some constants within the js that represent your minimum width and minimum height. The browser calls a method on an interval , or an event , just like actionscript , its entirely up to you. I use an interval because it seems to work well across all platforms / browsers , even old versions of ie. But ive tried it both ways and it works, so its whatever you prefer. But i digress , so the method that gets called , will run some check to first to see what kind of browser your using , because the syntax is different , and then to see if the browser has succeeded your min width / height. If it has , it resizes the div your flash movie lives in , thus causing the scrollbars to pop up. Else , it forces that div to 100%.

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