A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Fixed object size on resizable stage

  1. #1
    cbal
    Join Date
    Sep 2001
    Location
    Lima, Peru
    Posts
    55

    Fixed object size on resizable stage

    I have a SWF stage that needs to be resizable, as it loads content dynamically which may have different dimensions. Yet, I need an object (namely a 'Close' button) to keep its absolute size no matter how big or small the stage gets. I also need it to keep its relative position, let's say always at the top right corner of the resized Stage. Is there any way to achieve this?
    Cesar Ballon
    General Manager - PIXELSTUDIO S.A.C.
    http://www.pixelstudioperu.com
    [email protected]

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Try this

    Actionscript Code:
    Stage.align = "TL";

    Stage.scaleMode = "noScale";
    //Stage.scaleMode = "exactFit";

    button._x = Stage.width - button._width;
    button._y = Stage.height - Stage.height;

    function doResize()
    {
        button._x = Stage.width - button._width;
        button._y = Stage.height - Stage.height;
    }

    Stage.addListener({onResize:doResize});

    this does not keep original size button when using "exactFit"; only top right hand corner'

    my site/hobby:http://www.fgps.com/keith
    Last edited by fruitbeard; 01-02-2012 at 04:29 PM.

  3. #3
    cbal
    Join Date
    Sep 2001
    Location
    Lima, Peru
    Posts
    55
    It seems to be working fine. Thanks a lot!
    Cesar Ballon
    General Manager - PIXELSTUDIO S.A.C.
    http://www.pixelstudioperu.com
    [email protected]

  4. #4
    Junior Member
    Join Date
    Feb 2012
    Posts
    1

    Map Fixing Location issue

    Hello Friends,

    I have generated a map into .as 2.0. It's working fine.

    Now only when I clicks on the positioning controls, the map is moving out of frame/window. can anyone please guide me on same.

    Also I have set the proper code for it but still the issue is remain.


    Any help would be appreciated.

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