PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Position UILoader Content
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Position UILoader Content

  1. #1
    Member
    Join Date
    Oct 2002
    Posts
    56

    Position UILoader Content

    Hi FK, I have UILoader that loads images 427x240, then I thought to load an external swf dimensions 427x273. So I resized UILoader to height 273, now the images on load are positioned vertical middle, gap top and bottom, i need this to be absolute Top.

    How do I set UILoader loaded content to position Top? Many thanks Paul

  2. #2
    Member
    Join Date
    Sep 2009
    Posts
    57
    You should use a stageListener to do this. With this function whener ever the browser is resized, the clip will always go to that position. For example if you want your clip to always stay on middle top, no matter to what size your browser is resized to. the clip will always stay on middle top. Here is the function

    Actionscript Code:
    //--INITIALIZE VARIABLES
    stageListener = new Object();
    Stage.addListener(stageListener);
    //------------------------------------------------------------------------------------------------------


    //--IMPORTING FLASH TWEEN CLASS
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    //------------------------------------------------------------------------------------------------------



    //--MAKE MOVIE STAGE SCALE 100%
    Stage.align = "LT";
    Stage.scaleMode = "noScale";
    //------------------------------------------------------------------------------------------------------

    activate();//This function will automatically positioning your target MC to the centre stage without tweening
    //------------------------------------------------------------------------------------------------------



    //--POSITIONING YOUR TARGET MOVIE CLIP TO THE CENTRE OF THE STAGE WITH TWEENING
    function activate()
    {
        stageListener.onResize = function()
        {
            //Positioning target mc to centre on the stage
            mc._y = mc_y;
            mc_x = mc._x;
                          origY = Stage.height - Stage.height;
                          origX = (Stage.height/2)-(mc._width/2);
            new Tween(mc, "_y", Strong.easeIn, mc._y, origY, 1.5, true);
            new Tween(mc, "_x", Strong.easeIn, mc._x, origX, 1.5, true);
            //To see flash tween class details table check it out here -> [url]http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00003606.html[/url]
        };

        stageListener.onResize();
    }

    Hope this helps and this will also add an effect to the mc when it moves.

  3. #3
    Member
    Join Date
    Oct 2002
    Posts
    56
    Thanks danddleo! Im not sure I explained myself properly.

    I have a UILoader positioned and sized on stage, (427x240) jpg images load from a tileList and all is good.

    I want to use the same UILoader to load a SWF, size 427x273.(note height is 33px bigger)

    When I resize the UILoader to larger height, the images that load from the tileList are vertically placed in the middle of UILoader, leaving white space top and bottom.

    Is it possible to get the images to load inside the UILoader to x=0 y=0 (Top Left inside UILoader), leaving the 33px white space at bottom.

    Thanks again Paul

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