A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Full Browser Issue...

Threaded View

  1. #1
    Junior Member
    Join Date
    Nov 2006
    Posts
    10

    Full Browser Issue...

    I have a background movie clip (bg_mc) and a FLV Player (FLVPlayer) that I want to use in a full browser flash. Everything is working except that the FLVPlayer is aligning itself by the Top Left, when you look at the attached pic you can see that the alignment circle is in the center. When I adjust the browser size everything adjusts as it should even the FLVPlayer, but the Player is adjusting itself to the TopLeft...so most of the Player is out of the screen.

    Can anyone assist?
    Here is my ActionScript:
    Actionscript Code:
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.Event;

    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.align = StageAlign.TOP_LEFT;
    stage.addEventListener(Event.RESIZE, resizeHandler);


    //function to handle background image resize.
    function setBackground() {
        var reg2 = stage.stageWidth / 2;
        var reg1 = stage.stageHeight / 2;
        bg_mc.x = reg2;
        bg_mc.y = reg1;
        bg_mc.width = stage.stageWidth;
        bg_mc.height = stage.stageHeight;
        bg_mc.scaleX <= bg_mc.scaleY ? (bg_mc.scaleX = bg_mc.scaleY) : (bg_mc.scaleY = bg_mc.scaleX);
    }
    setBackground();
    //set intitial position
    function setPos() {
       
        FLVPlayer.x = stage.stageWidth / 2;
        FLVPlayer.y = stage.stageHeight / 2;
    }
    setPos();
    //set position when stage resizes
    function resizeHandler(event:Event):void {
        setBackground();
        setPos();
    }
    Attached Images Attached Images

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