Skip navigation
Currently Being Moderated

make flv playback exact fit to window project not desktop

Aug 7, 2012 1:15 AM

hi , first i want to say i use Flash Cs5 - flash player 10 - As3

 

 

i want when i click on full screen button on flv playback component my flv player window goes to exact fit my flash window not my desktop or even better if i can set resolution for full screen mode ....

 

 

i have strange problem the full screen function not work in any third party flash protection and projector tools ...

 

finally i found some component that use some As2 script to make full screen button function to exact fit window and it`s interensting cause this flv player works well in  test movie mode !!!

 

as the full screen function in default Flash Cs5 not work in test mode and you must run swf directly from local or run projector ...

 

i realize that when the full screen function works in flash test movie ( ctrl + enter ) mode it work in another third party tools too ...

 

i don`t now why but maybe some security reason in As3 dont let it run from test movie and another third party tools ...

 

 

what can i do about it ??

 

 

how can i write script for my flv playback component to read new function for full screen mode and set it to exact fit window ( project ) not my desktop ( the size of project not chang at all and only flv player resize to my window )

 

is this possible to set resolution for Resize mode  ?!?

 

is this possible to create a button for this ??!?

 

 

www.jpg

 

 

i know i ask many Questions and maybe u confued as i am now , but i have spend a week to solve this problem , checking all third party tools and no success , even i post my problem to many forums ...

 

pleaseeeeeeee help me

 
Replies
  • kglad
    72,220 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 7, 2012 6:55 AM   in reply to Arioman

    full screen is full screen.  you want full window.

     

    to do that, don't use a skin with a native fullscreen button, add your own button and code your button to do what you want:

     

    fs_btn.addEventListener(MouseEvent.CLICK,f);

     

    function f(e:MouseEvent):void{

    if(flv_pb.width<stage.stageWidth){

    flv_pb.width=stage.stageWidth;

    flv_pb.height=stage.stageHeight;

    flv_pb.x=0;

    flv_pb.y=0

    } else {

    //reset

    }

    }

     
    |
    Mark as:
  • kglad
    72,220 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 7, 2012 12:17 PM   in reply to Arioman

    yes, to both.

     

    use a skin without a fs button and add the fs button from the components panel, assign it the instance name fs_btn.  you can then use:

     

     

    fs_btn.addEventListener(MouseEvent.CLICK,f);

    flv_pb_x=flv_pb.x;

    flv_pb_y=flv_pb.y;

    flv_pb_h=flv_pb.height;

    flv_pb_w=flv_pb.width;

     

    function f(e:MouseEvent):void{

    if(flv_pb.width<stage.stageWidth){

    flv_pb.width=stage.stageWidth;

    flv_pb.height=stage.stageHeight;

    flv_pb.x=0;

    flv_pb.y=0

    fs_btn.on_mc.visible=false;

    fs_btn.off_mc.visible=true;

    } else {

    flv_pb.width=flv_pb_w;

    flv_pb.height=flv_pb_h;

    flv_pb.x=flv_pb_x;

    flv_pb.y=flv_pb_y;

    fs_btn.on_mc.visible=true;

    fs_btn.off_mc.visible=false;

    }

    }

     
    |
    Mark as:
  • kglad
    72,220 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 7, 2012 1:41 PM   in reply to Arioman

    in the components panel, in the video folder (where you find the two flvplayback components), is a FullScreenButton component.  drag it to your stage, assign fs_btn instance name and copy the code i suggested.

     
    |
    Mark as:
  • kglad
    72,220 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 8, 2012 7:20 AM   in reply to kglad

    that was my fault.  i failed to declare those 4 varialbes.  use:

     

     

     

     

    fs_btn.addEventListener(MouseEvent.CLICK,f);

    var flv_pb_x:Number=flv_pb.x;

    var flv_pb_y:Number=flv_pb.y;

    var flv_pb_h:Number=flv_pb.height;

    var flv_pb_w:Number=flv_pb.width;

     

    function f(e:MouseEvent):void{

    if(flv_pb.width<stage.stageWidth){

    flv_pb.width=stage.stageWidth;

    flv_pb.height=stage.stageHeight;

    flv_pb.x=0;

    flv_pb.y=0

    fs_btn.on_mc.visible=false;

    fs_btn.off_mc.visible=true;

    } else {

    flv_pb.width=flv_pb_w;

    flv_pb.height=flv_pb_h;

    flv_pb.x=flv_pb_x;

    flv_pb.y=flv_pb_y;

    fs_btn.on_mc.visible=true;

    fs_btn.off_mc.visible=false;

    }

    }

     
    |
    Mark as:
  • kglad
    72,220 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 9, 2012 12:34 PM   in reply to kglad

    use:

     

     

     

     

     

     

    fs_btn.addEventListener(MouseEvent.CLICK,f);

    var flv_pb_x:Number=flv_pb.x;

    var flv_pb_y:Number=flv_pb.y;

    var flv_pb_h:Number=flv_pb.height;

    var flv_pb_w:Number=flv_pb.width;

    var fs_btn_offsetX:Number=flv_pb.width+flv_pb.x-fs_btn.x;

    var fs_btn_offsetY:Number=flv_pb.height+flv_pb.y-fs.btn.y;

     

    function f(e:MouseEvent):void{

    if(flv_pb.width<stage.stageWidth){

    flv_pb.width=stage.stageWidth;

    flv_pb.height=stage.stageHeight;

    flv_pb.x=0;

    flv_pb.y=0

    fs_btn.on_mc.visible=false;

    fs_btn.off_mc.visible=true;

    } else {

    flv_pb.width=flv_pb_w;

    flv_pb.height=flv_pb_h;

    flv_pb.x=flv_pb_x;

    flv_pb.y=flv_pb_y;

    fs_btn.on_mc.visible=true;

    fs_btn.off_mc.visible=false;

    }

    fs_btn.x=flv_pb.width+flv_pb.x-fs_btn_offsetX;

    fs_btn.y=flv_pb.height+flv_pb.y-fs_btn_offsetY;

    }

     
    |
    Mark as:
  • kglad
    72,220 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 10, 2012 7:17 AM   in reply to Arioman

    you're welcome.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points