• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

make flv playback exact fit to window project not desktop

Participant ,
Aug 07, 2012 Aug 07, 2012

Copy link to clipboard

Copied

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

TOPICS
ActionScript

Views

3.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 07, 2012 Aug 07, 2012

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

}

}

Votes

Translate

Translate
Community Expert ,
Aug 07, 2012 Aug 07, 2012

Copy link to clipboard

Copied

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

}

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 07, 2012 Aug 07, 2012

Copy link to clipboard

Copied

thank you so much , you are my hero cause i post this in many forums and no one answered for a week !!

*****

i have only one little problem :

is there any chance to make this button 2 function ???

like fullscreen button when click on it goes to full screen and when click again back ( reset ) to normal ??

it not nice to create another button to go back normal size .

and is it possible to edit script of current flv playback and replace this script with default fullscreen script action ?? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 07, 2012 Aug 07, 2012

Copy link to clipboard

Copied

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;

}

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 07, 2012 Aug 07, 2012

Copy link to clipboard

Copied

wow you are my master now , i never think that i get my answer too soon !!

but i cant find any  fs button from the components panel to add it ...

how this button works ?

can i make my own button with my own graphics ?

if not please help me to find fs button with more guid where i can find

and if its possible please tell me how can i use my own button ready for 2 function ,,,

thank you so much for spending time to explain me i know it`s boring and dificault to explain for new users with low knowledge about AS3 ///

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 07, 2012 Aug 07, 2012

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 08, 2012 Aug 08, 2012

Copy link to clipboard

Copied

i copy and paste exactly what you give to me

but it show 8 compile errors after test movie :

1120: Access of undefined property flv_pb_w.

and flv_pb_y and _h and _x

where is the problem ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 08, 2012 Aug 08, 2012

Copy link to clipboard

Copied

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;

}

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 08, 2012 Aug 08, 2012

Copy link to clipboard

Copied

thank you so much i have only one poblem ....

the full windows (fs_btn) is not fixed with my plyer so when it goes to exact fit the fs_bt will be on my video  in some ugly position !!

i try to Group this or try to edit skin and put buttonn in but i get scrpt error and not success

can i write some sipt to move button or embed or attach to player bar ?????

As seems you are  CommunityMVP  and master in AS3 ,  can you recomend any source , video Tutorial or ebook to learn AS3 and solve some problem like this ... i really want to develop in AS3 , i just dont know how must i start and whats the best source

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 09, 2012 Aug 09, 2012

Copy link to clipboard

Copied

Dear kglad , thanks again for help me 

can you help me to slove my last problem ??

to set the right position for full window button or attach it some how to player bar

please let me know if it`s not possible because i must think about another way or give up at all ...

thanks again ...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2012 Aug 09, 2012

Copy link to clipboard

Copied

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;

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 10, 2012 Aug 10, 2012

Copy link to clipboard

Copied

thank you so much my friend ...

you help me a lot to end my project this script do exactly what i want

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 10, 2012 Aug 10, 2012

Copy link to clipboard

Copied

LATEST

you're welcome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines