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
Full Browser Issue...
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Full Browser Issue...

  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

  2. #2
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    I do believe your problem is this line: If not come back and I will look more carefully

    stage.align = StageAlign.TOP_LEFT;
    ~calmchess~

  3. #3
    Junior Member
    Join Date
    Nov 2006
    Posts
    10
    Thanks for replying.
    When I change that to TOP both the FLVPlayer and bg resize seperately/differently.
    When I change it to CENTER both FLV and bg resize correctly but my FLVPlayer just flashes on/off.

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