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

Fullscreen problem with blank space

New Here ,
Oct 10, 2014 Oct 10, 2014

the problem is when I clicked on the button to play the swf on larger size.

it shows up like this

2.jpg

How can i get rid of the blank space there?

this is the script i write on the first frame of timeline to play fullscreen:

---------------------------------------------------------------------------------------------------------


import flash.system.fscommand;

fscommand("fullscreen", "true");

fscommand("allowscale", "false");

stage.addEventListener(Event.ADDED, FLVAdded, true);

function FLVAdded(e:Event):void

{

if (e.target is FLVPlayback)

{

e.target.fullScreenTakeOver = false;

}

}

---------------------------------------------------------------------------------------------------------

and this is the script i write on frame 310 that contain the button for viewing larger size of the swf.

---------------------------------------------------------------------------------------------------------

ekonomi_1_button.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_20);

import fl.display.ProLoader;

import flash.display.Loader;

var fl_ProLoader_20:ProLoader;

//This variable keeps track of whether you want to load or unload the SWF

var fl_ToLoad_20:Boolean = true;

function fl_ClickToLoadUnloadSWF_20(event:MouseEvent):void

{

  if (fl_ToLoad_20)

  {

  fl_ProLoader_20 = new ProLoader();

  fl_ProLoader_20.load(new URLRequest("swf/Ekonomi_1_1.swf"));

  addChild(fl_ProLoader_20);

  }

  else

  {

  fl_ProLoader_20.unload();

  removeChild(fl_ProLoader_20);

  fl_ProLoader_20 = null;

  SoundMixer.stopAll();

  }

  // Toggle whether you want to load or unload the SWF

  fl_ToLoad_20 = ! fl_ToLoad_20;

  Ekonomi_1_1.stop();

}

---------------------------------------------------------------------------------------------------------

anyone help me please..

TOPICS
ActionScript
1.0K
Translate
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 , Oct 10, 2014 Oct 10, 2014

again, that line makes no sense because the stage has no such property.

if your flvplayback component has instance name, flv_pb replace:

////////////////////////////////

stage.addEventListener(Event.ADDED, FLVAdded, true);

function FLVAdded(e:Event):void

{

if (e.target is FLVPlayback)

{

e.target.fullScreenTakeOver = false;

}

}

//////////////////////////////////////

with

//////////////////////////////////////

flv_pb.addEventListener(Event.ADDED_TO_STAGE, FLVAdded, true);

function FLVAdded(e:Event):void{

flv_pb.f

...
Translate
Community Expert ,
Oct 10, 2014 Oct 10, 2014

assign the fullScrenTakeOver property of your flvplayback component to be true if you want it to fill the screen.

the stage has no such property.

Translate
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
New Here ,
Oct 10, 2014 Oct 10, 2014

do you mean that i have to change my first frame script from:

e.target.fullScreenTakeOver = false;           ----->      e.target.fullScreenTakeOver = true;     ?



i changed it, the screen goes blank when i entered frame 310

Translate
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 ,
Oct 10, 2014 Oct 10, 2014

again, that line makes no sense because the stage has no such property.

if your flvplayback component has instance name, flv_pb replace:

////////////////////////////////

stage.addEventListener(Event.ADDED, FLVAdded, true);

function FLVAdded(e:Event):void

{

if (e.target is FLVPlayback)

{

e.target.fullScreenTakeOver = false;

}

}

//////////////////////////////////////

with

//////////////////////////////////////

flv_pb.addEventListener(Event.ADDED_TO_STAGE, FLVAdded, true);

function FLVAdded(e:Event):void{

flv_pb.fullScreenTakeOver = true;  // if you want your flv_pb to fill the screen.  otherwise, use false

}

///////////////////////////////////////////////////

Translate
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
New Here ,
Oct 10, 2014 Oct 10, 2014

i have just replaced on frame 1 with this:

----------------------------------------------------------------------------------------------------------------

Ekonomi_1_1.addEventListener(Event.ADDED_TO_STAGE, FLVAdded, true);

function FLVAdded(e:Event):void

{

Ekonomi_1_1.fullScreenTakeOver = true;  // if you want your flv_pb to fill the screen.  otherwise, use false

}

----------------------------------------------------------------------------------------------------------------

but it stuck, it stop at frame 1.

then, i tried to put

----------------------------------------------------------------------------------------------------------------

Ekonomi_1_1.addEventListener(Event.ADDED_TO_STAGE, FLVAdded, true);

function FLVAdded(e:Event):void

{

Ekonomi_1_1.fullScreenTakeOver = true;  // if you want your flv_pb to fill the screen.  otherwise, use false

}

----------------------------------------------------------------------------------------------------------------

on frame 310 line 41-45, but it still do the same blank space.

Will you please take a look on this file?

eko.rar - Google Drive

maybe there is some script that i missed

Translate
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 ,
Oct 10, 2014 Oct 10, 2014

i don't download and correct files unless i'm hired.

to continue working via this forum, create a new fla, add your flvplayback component, name it and use the frame 1 code in that new fla.  any problems?

Translate
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
New Here ,
Oct 10, 2014 Oct 10, 2014

i try to create new fla, add flvpb component, name it "aa", the source of the flvpb is a swf file and i use the frame 1 code.

///////////////////////////

aa.source = "lib/video/ekonomi_10_1_1.flv";

import flash.system.fscommand;

fscommand("fullscreen", "true");

fscommand("allowscale", "false");

aa.addEventListener(Event.ADDED_TO_STAGE, FLVAdded, true);

function FLVAdded(e:Event):void

{

aa.fullScreenTakeOver = false;  // if you want your flv_pb to fill the screen.  otherwise, use false

}

///////////////////////////

the result is :

4.jpg

-----------------------------------------------------------

/////////////////////////////

aa.source = "lib/video/ekonomi_10_1_1.flv";

import flash.system.fscommand;

fscommand("fullscreen", "true");

fscommand("allowscale", "false");

aa.addEventListener(Event.ADDED_TO_STAGE, FLVAdded, true);

function FLVAdded(e:Event):void

{

aa.fullScreenTakeOver = true;  // if you want your flv_pb to fill the screen.  otherwise, use false

}

/////////////////////////

the result is:-->(the swf is cut on right and bottom side)

3.jpg

how can i get the flvpb without the black blank and without cut on the bottom and right side?

Translate
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 ,
Oct 10, 2014 Oct 10, 2014

i can't determine what you're showing with those two screenshots.

are either of them supposed to be the swf in fullscreen?

Translate
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
New Here ,
Oct 11, 2014 Oct 11, 2014

sorry, my fault. it supposed to be a swf.

"aa" is an instance name for a button to load the swf file

so this is the code i entered on frame 1:

//////////////////////////////

import flash.system.fscommand;

fscommand("fullscreen", "true");

fscommand("allowscale", "false");

aa.addEventListener(Event.ADDED_TO_STAGE, FLVAdded, true);

function FLVAdded(e:Event):void

{

aa.fullScreenTakeOver = true;

}

aa.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF);

import fl.display.ProLoader;

var fl_ProLoader:ProLoader;

var fl_ToLoad:Boolean = true;

function fl_ClickToLoadUnloadSWF(event:MouseEvent):void

{

  if(fl_ToLoad)

  {

  fl_ProLoader = new ProLoader();

  fl_ProLoader.load(new URLRequest("lib/swf/Ekonomi_1_1.swf"));

  addChild(fl_ProLoader);

  }

  else

  {

  fl_ProLoader.unload();

  removeChild(fl_ProLoader);

  fl_ProLoader = null;

  }

  fl_ToLoad = !fl_ToLoad;

}

/////////////////////////////////

the result is:

Scene 1, Layer 'Actions', Frame 1, Line 91119: Access of possibly undefined property fullScreenTakeOver through a reference with static type flash.display:SimpleButton.

when fullscreen, i just want the swf play in exact size without cut on bottom or right or have any black blank.

Help me out with this please. thanks..

Translate
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 ,
Oct 11, 2014 Oct 11, 2014

again, assign the fullScrenTakeOver property of your flvplayback component to be true if you want it to fill the screen.

in message 6 when you showed:  aa.source = "lib/video/ekonomi_10_1_1.flv";

that looked like aa was your flvplayback component reference.  now it appears aa is a button.

Translate
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
New Here ,
Oct 11, 2014 Oct 11, 2014

yes, in message 6, aa is my flvplayback, in which the source is "lib/video/ekonomi_10_1_1.flv"

and aa.fullScreenTakeOver =true  

With addition code :

aa.x=-400;

aa.y=-150;

i successfully fill the video to the screen. And thanks to you mr.kglad

then i try to apply it to a new fla in which, aa is a button to call a swf file with code snippet to load and unload img/swf (fl_ProLoader). The code is exactly the same with message 8.

the error occurs and show me this:

Scene 1, Layer 'Actions', Frame 1, Line 91119: Access of possibly undefined property fullScreenTakeOver through a reference with static type flash.display:SimpleButton.

I Think the error occur because aa now is a button not flvplayback component reference.

is there a way to make the swf that called from aa button to be fill in the fullscreen mode without any black blank space?

Translate
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 ,
Oct 11, 2014 Oct 11, 2014

yes.

if there's no flvplayback component in the loading and none in the loaded swf, do not use fullscreentakeover.

if aa is still your 'loading' button, just use something like:

var loader:Loader=new Loader();

addChild(loader);

aa.addEventListener(MouseEvent.CLICK, loadSWF);

function loadSWF(e:MouseEvent):void{

loader.load(new URLRequest("lib/swf/Ekonomi_1_1.swf"));

stage.displayState='fullScreen';  // if this is an html project, make sure you publish for allow fullscreen in the publish settings.  if it's any other app, you can use this line of code outside a button listener.

}

Translate
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
New Here ,
Oct 11, 2014 Oct 11, 2014

i'm going to publish the project to swf. So i put the stage.displayStage='fullScreen'; outside the button listener.

If there is no flvplayback component in the loading but there is flvplayback component in the loaded swf, what should i add to the code to get the loaded swf fill the fullscreen?

Translate
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
New Here ,
Oct 11, 2014 Oct 11, 2014
LATEST

it solved. Thanks mr.kglad.

i just change the ADDED (message 1 code) to ADDED_TO_STAGE (message 3 code) and remain the fullScreenTakeOver =false;

------------------------------------------------------------------------------------------ ---------------


import flash.system.fscommand;

fscommand("fullscreen", "true");

fscommand("allowscale", "false");

stage.addEventListener(Event.ADDED_TO_STAGE,FLVAdded, true);

function FLVAdded(e:Event):void

{

if (e.target is FLVPlayback)

{

e.target.fullScreenTakeOver = false;

}

}

------------------------------------------------------------------------------------------ ---------------

Translate
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