A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Fulll browser size flash

  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    1

    Fulll browser size flash

    Hi I am making full browser page, but resize doesnt work well. It looks like the flash took wrong stageWidth and stageHeight at the start... Then it all works but with wrong numbers

    http://www.frai.cz/www/

    (when you launch swf in standalone player, it works well - download http://www.frai.cz/www/frai3.swf)

    I have resizing done this way:
    Code:
    stage.scaleMode = StageScaleMode.NO_SCALE;
    var start_w:Number = stage.stageWidth;
    var start_h:Number = stage.stageHeight;
    function initThis(obj:MovieClip):void {
     obj["startX"] = obj.x;
     obj["startY"] = obj.y;
    }
    initThis(obj1_mc);
    initThis(obj2_mc);
    initThis(obj3_mc);
    initThis(pozadi);
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    function resized(evt:Event):void {
     var dif_x:Number = (stage.stageWidth-start_w)/2;
     var dif_y:Number = (stage.stageHeight-start_h)/2;
     var tw_1:Tween = new Tween(obj1_mc, "x", Regular.easeOut, obj1_mc.x, obj1_mc["startX"]-dif_x, 12, false);
     var tw_2:Tween = new Tween(obj1_mc, "y", Regular.easeOut, obj1_mc.y, obj1_mc["startY"]-dif_y, 12, false);
     var tw_7:Tween = new Tween(pozadi, "x", Regular.easeOut, pozadi.x, pozadi["startX"]-dif_x, 12, false);
     var tw_8:Tween = new Tween(pozadi, "y", Regular.easeOut, pozadi.y, pozadi["startY"]-dif_y, 12, false);
     var tw_3:Tween = new Tween(obj2_mc, "x", Regular.easeOut, obj2_mc.x, obj2_mc["startX"]+dif_x, 12, false);
     var tw_4:Tween = new Tween(obj2_mc, "y", Regular.easeOut, obj2_mc.y, obj2_mc["startY"]+dif_y, 12, false);
     var tw_5:Tween = new Tween(obj3_mc, "x", Regular.easeOut, obj3_mc.x, obj3_mc["startX"]+dif_x, 12, false);
     var tw_6:Tween = new Tween(obj3_mc, "y", Regular.easeOut, obj3_mc.y, obj3_mc["startY"]-dif_y, 12, false);
    }
    stage.addEventListener(Event.RESIZE,resized);
    Can anyone help? - I am not expert

  2. #2
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    are you setting the stage align to , top left ?

    Code:
    stage.align = StageAlign.TOP_LEFT;

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