Quantcast
Channel: Adobe Community: Message List - Flash Catalyst
Viewing all articles
Browse latest Browse all 180

Re: off stage object's

$
0
0

Another idea that might work, if you just wanted to adjust overall scale would be to simply embed your swf in a div with a hidden overflow.

 

Then, use javascript to scale that div to the appropriate size when the window is resized.  That way, you can resize your swf to the appropriate size, while keeping your aspect ratio locked in and hiding any elements outside of the main stage (which was why I utilized this method).

 

The resize function might look similar to the following:

 

function resizeDiv()

{

          var swfDiv = document.getElementById("mySWF");

          if (swfDiv) // check to see if div exists, in case this is called before document finishes loading

          {

                    var height = window.innerHeight;

                    var width = window.innerWidth;

                    var ratio = Math.min(height/1200, width/1600);

                    height = 1200*ratio;

                    width = 1600*ratio;

 

                    swfDiv.style.width = width + "px";

                    swfDiv.style.height = height + "px";

          }

}


Viewing all articles
Browse latest Browse all 180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>