Skip to main content
Petteri_Paananen
Inspiring
May 10, 2010
Answered

FLV fullscreen problem

  • May 10, 2010
  • 1 reply
  • 4890 views

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...

This topic has been closed for replies.
Correct answer kglad

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);


no, use:

setTimeout(call_flvTakeOverDisableF,500);


function call_flvTakeOverDisableF(){

flvTakeOverDisableF(MovieClip(loader.content))

}

1 reply

kglad
Community Expert
Community Expert
May 10, 2010

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)));
        }
    }
}

Petteri_Paananen
Inspiring
May 11, 2010

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.