Copy link to clipboard
Copied
Hi again...=)
I have a problem....again. Maybe someone can help me out with this.
Little background:
I have a main.swf inside html-wrapper. I load some external SWFs into it. Sometimes there is a FLV-video included into a SWF, sometimes not. Those external SWFs comes actually from an automated process, so I don´t have acces to any source codes of them, and I have no clue about instance names of any objects etc...
Problem:
Theres a fullscreen button in main.swf. It works perfectly if I use it with external SWF without FLV. But if I try to use it with external SWF with FLV video takes over the screen and all the other graphics etc. disappears.
I´m looking for a solution to disable that fullscreen for FLV, but I still want my main.swf to go fullscreen... I know that I could use myFLVplayer.fullScreenTakeOver = false if I just knew the instance name of that FLV-player... but I don´t. And I actually doubt that it keeps changin all the time in a process that creates those SWFs, so there´s not much use to know how it is named in one SWF, name is probably totally different in another...
no, use:
setTimeout(call_flvTakeOverDisableF,500);
function call_flvTakeOverDisableF(){
flvTakeOverDisableF(MovieClip(loader.content))
}
Copy link to clipboard
Copied
pass the content of your loader (after loading is complete and cast as a movieclip) to the below function:
function flvTakeOverDisableF(mc:MovieClip){
for(var i:uint=0;i<mc.numChildren;i++){
if(mc.getChildAt(i) is FLVPlayback){
FLVPlayback(mc.getChildAt(i)).fullScreenTakeOver = false;
break;
} else if(mc.getChildAt(i) is MovieClip){
flvTakeOverDisableF(MovieClip(mc.getChildAt(i)));
}
}
}
Copy link to clipboard
Copied
Thanks, that look promising...
I have a function where I load my external SWF in. I put a listener inside that function:
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, flvTakeOverDisableF);
Then I cast loaded SWF as a MovieClip inside the function you gave:
function flvTakeOverDisableF(mc:MovieClip){
var mc = MovieClip(loader.content); //casting loaded content as MovieClip mc
for(var i:uint=0;i<mc.numChildren;i++){
if(mc.getChildAt(i) is FLVPlayback){
FLVPlayback(mc.getChildAt(i)).fullScreenTakeOver = false;
break;
} else if(mc.getChildAt(i) is MovieClip){
flvTakeOverDisableF(MovieClip(mc.getChildAt(i)));
}
}
}
I still do something wrong, I get warning:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::Event@3d146a01 to flash.display.MovieClip.
Copy link to clipboard
Copied
no, don't edit the code i suggested. use:
function whatever(){
//your loader code
.
.
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompleteF );
}
function loadCompleteF(e:Event){
flvTakeOverDisableF(MovieClip(loader.content));
}
function flvTakeOverDisableF(mc:MovieClip){
for(var i:uint=0;i<mc.numChildren;i++){
if(mc.getChildAt(i) is FLVPlayback){
FLVPlayback(mc.getChildAt(i)).fullScreenTakeOver = false;
break;
} else if(mc.getChildAt(i) is MovieClip){
flvTakeOverDisableF(MovieClip(mc.getChildAt(i)));
}
}
}
Copy link to clipboard
Copied
Ok, thanks...
I did that and now I get warning:
ReferenceError: Error #1065: Variable FLVPlayback is not defined.
at sourceCS3_fla::MainTimeline/flvTakeOverDisableF()
at sourceCS3_fla::MainTimeline/magLoaded()
Copy link to clipboard
Copied
are you using an flvplayback component?
Copy link to clipboard
Copied
I suppose there has been used FLVPlayback component, but actually I can´t be sure, it looks like one but I only see SWF, not any source.... I must try to ask that.
Copy link to clipboard
Copied
Have not heard a word from authors of that SWF file... but I open SWF into a decompiler and got lots of code... I picked up following function that was inside SWF:
public function get fullScreenTakeOver():Boolean
{
return flvplayback_internal::uiMgr.fullScreenTakeOver;
}
Could I call that some way from my loading swf? And disable fullscreen of videoplayer that way?
Copy link to clipboard
Copied
addt an flvplayback component to your loading swf's library. retest using the code i suggested. if that fails, delay the execution of the function i supplied for about 500ms after loading is complete and retest.
Copy link to clipboard
Copied
ok,thanks... I tried that. Without delay it didn´t work... what do you think. can I just use setTimeout like this:
setTimeout(flvTakeOverDisableF(MovieClip(loader.content)),500);
Copy link to clipboard
Copied
no, use:
setTimeout(call_flvTakeOverDisableF,500);
function call_flvTakeOverDisableF(){
flvTakeOverDisableF(MovieClip(loader.content))
}
Copy link to clipboard
Copied
If I keep FLVPlayback component just in Library, it throws me:
ReferenceError: Error #1065: Variable FLVPlayback is not defined.
at sourceCS3_fla::MainTimeline/flvTakeOverDisableF()
at sourceCS3_fla::MainTimeline/call_flvTakeOverDisableF()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at SetIntervalTimer/onTimer()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
If I drag it to stage, it doesn´t give any warnings but it behaves strangely. If I open it to browser and push fullscreen button, it opens that empty FLVPlayback Component to fullscreen:

Copy link to clipboard
Copied
Never mind last one... I just named that extra FLVPlayback and used another fullScreenTakeOver = false; to it... now it works like a charm... million thanks to you (again)....![]()
Copy link to clipboard
Copied
you're welcome.
Copy link to clipboard
Copied
Whenever I search for a probelm and find a solution, I find that you are the one who posted that solution! Thanks for your great help!
Copy link to clipboard
Copied
you're welcome, too!
(believe it not, it's not unusual for me to search for the solution to a problem only to find that i'd solved it before.)
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more