A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: scale to browser window only if below a set resolution?

Hybrid View

  1. #1
    Member
    Join Date
    Jul 2008
    Posts
    73

    scale to browser window only if below a set resolution?

    My swf size is approximately 1000x700. If the browser size is smaller than this it needs to scale down but if it is larger I don't want it to scale. Just like this http://www.milesaldridge.com/.

    I've tried publishing the Flash settings at Scaleefault(Show All) which scales it but I need to stop the scaling upwards at 1000x700.

    I'd have thought that I could say in the html if (width<1024){scale;} and if(height<700){scale;}. But it's not working. Should it all be done in the html?

  2. #2
    Member
    Join Date
    Jul 2008
    Posts
    73
    Does anyone know if I'm going the right way here?

  3. #3
    Member
    Join Date
    Jul 2008
    Posts
    73
    BTW I've been publishing this using Flash Player 7. It seems to make a difference if using ScaleDefault. Above Flash Player 7 the scale doesn't work here.

  4. #4
    Member
    Join Date
    Jul 2008
    Posts
    73
    Really ..no one knows? I've got the code partly doing what I need in the as.

    Code:
    Stage.align = "TL";
    Stage.scaleMode = "Scale";
    
    var w = Stage.width;
    var h = Stage.height;
    
    var maxWidth = 1024;
    var maxHeight = 708;
    
    setStageSize = function () {
    	this._width = Stage.width;
    	this._height = Stage.height;
    	this._yscale = this._xscale;
    	
    };
    
    setStageSize();
    stageListener = new Object();
    stageListener.onResize = function() {
    	Void;	
    	var w = Stage.width;
    	var h = Stage.height;
    	if (w<maxWidth) {
    		setStageSize();
    	}
    	if (w>maxWidth) {
    		w = maxWidth;
    		}
    
    };
    Stage.addListener(stageListener);
    someone must know. this is f*ing driving me nuts

Tags for this Thread

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