Copy link to clipboard
Copied
the problem is when I clicked on the button to play the swf on larger size.
it shows up like this
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..
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
...Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
}
///////////////////////////////////////////////////
Copy link to clipboard
Copied
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?
maybe there is some script that i missed
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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 :
-----------------------------------------------------------
/////////////////////////////
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)
how can i get the flvpb without the black blank and without cut on the bottom and right side?
Copy link to clipboard
Copied
i can't determine what you're showing with those two screenshots.
are either of them supposed to be the swf in fullscreen?
Copy link to clipboard
Copied
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 9 | 1119: 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..
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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 9 | 1119: 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?
Copy link to clipboard
Copied
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.
}
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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;
}
}
------------------------------------------------------------------------------------------ ---------------
Find more inspiration, events, and resources on the new Adobe Community
Explore Now