A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Resize load image, text and buttons no scale...

  1. #1
    Senior Member
    Join Date
    Jul 2003
    Location
    Canary Islands
    Posts
    222

    Resize load image, text and buttons no scale...

    I would like to ask for any idea to solve my problem.
    I need to load the picture jpg into the main swf by xml.
    During the viewing at the main swf, the picture has to resize according to the size of the window.
    The other text and the buttons don't change the size, so no scale.
    Thank you for any help.

  2. #2
    Junior Member
    Join Date
    Oct 2005
    Posts
    1

    This should help

    See below ...

    Where "bkgdMC" is the instance name of the empty movieclip you call your XML from.


    Stage.align = "TL";
    Stage.scaleMode = "noScale";

    var stageListener:Object = new Object();
    Stage.addListener(stageListener);

    setBackground();

    stageListener.onResize = function() {
    setBackground();
    };

    function setBackground() {

    var middleX = Stage.width/2;
    var middleY = Stage.height/2;

    bkgdMC._x = topX;
    bkgdMC._y = leftY;


    bkgdMC._width = Stage.width;
    bkgdMC._height = Stage.height;

    bkgdMC._xscale = bkgdMC._yscale = Math.max(bkgdMC._xscale, bkgdMC._yscale);
    }

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