문제

allightlscreen param이 false 인 경우 전체 화면 버튼을 제거하고 싶습니다.
      param value="true" name="allowfullscreen"

그 값을 감지 할 수 있는지 아는 사람이 있습니까? LoaderInfo.parameters의 다른 FlashVars와 함께 제공되지 않습니다.

도움이 되었습니까?

해결책

편집 : 이것은 이제 더 이상 사용되지 않습니다 (FP 8.5 / 9의 해킹이었습니다)

다음은 플레이어가 전체 화면 가용성 (THX @MRDOOB)이 있는지 여부를 감지합니다.

var hasFullscreen:Boolean = (stage.hasOwnProperty("displayState"))

다른 팁

당신이 원하는 회원은입니다

stage.displayState

그렇게 할당 할 수 있습니다.

import flash.display.StageDisplayState;

....

stage.displayState = StageDisplayState.FULL_SCREEN;
stage.displayState = StageDisplayState.NORMAL;

나는 읽는 것이 좋습니다 :

http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=livedocs_parts&file=00000352.html

편집하다:

오, 당신의 질문을 완전히 잘못 읽었습니다.

약간의 테스트 후에는 예외 메커니즘을 사용하여 인식 할 수있는 깜박임없이 테스트 할 수 있습니다.

try
{
    stage.displayState = StageDisplayState.FULL_SCREEN;
    stage.displayState = StageDisplayState.NORMAL;
} catch ( error:SecurityError ) {
// your hide button code            
}

AS3에 대한 솔루션

무대 속성을 통해 전체 화면이 허용되는지 확인할 수 있습니다.

try {
    if (btn.stage["allowsFullScreen"]) { // if this fails, then its not allowed
        // do full screen allow code here
        btn.alpha = 1; // show since its allowed
    }
} catch (error:Error) { // full scrren not allowed
    btn.alpha = 0.5; // dim since it cant be used
}

Embed에 allowllscreen이 False/True로 설정되어 있는지 여부를 감지 할 수 없습니다.

불행히도 사용자가 버튼을 클릭하여 최종 오류를 포착하여 버튼을 비활성화 할 때까지 기다려야합니다.

그래도 ... FlashPlayer 가이 값 자체를 다음과 같이 평가하려면 매우 특별한 맥락에 있어야합니다. 아마 편집했을 것입니다. 임베드가 전체 화면 모드가 허용되어야하는지 여부를 결정할 수있는 타사에 의해 처리되는 경우. 이 경우 추가 Flash-Var (예 : FullScreenButton = false)를 추가하십시오.

실제로 문서는 ActionScript 3에서 전체 화면 모드가 허용되거나 감지 될 수있는 방법에 대해 불분명합니다.

그들이 언급 한 유일한 것은 전체 화면 모드로 전환하려고하면 허용되지 않으면 예외를 얻을 수 있다는 것입니다. 이렇게하면 전체 화면 모드 버튼을 숨기거나 표시 할 수 없습니다.

방법이있을 수 있지만 "살아있는"은 악명 높거나 불완전합니다.

루트 객체의 매개 변수를 다음과 같이 거부하는 "전체 화면"PARAM의 값을 읽을 수 있습니다.

var keyStr:String;
var valueStr:String;
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
for (keyStr in paramObj) {
valueStr = String(paramObj[keyStr]);
//do something with this information
}

편집 : Flashvars로 돌아 오지 않는다고 언급했습니다.

내가 생각할 수있는 유일한 방법은 externalinterface를 통해 JavaScript 함수를 호출하는 것입니다. JavaScript에서 Flash Embed 매개 변수를 쉽게 읽을 수 있지만 영화가 포함 된 HTML에 JS를 삽입 할 수 있다고 생각하고 있습니다.

그 외에는 Jotham의 해결책이 괜찮아 보입니다. stage.displayState = StageDisplayState.FULL_SCREEN; 사용자 이벤트에 의해서만 트리거 될 수 있습니다.

사용자의 마우스 클릭 또는 키 프레스에 응답하여 전체 화면 모드가 시작됩니다. 영화는 사용자 입력없이 단계를 변경할 수 없습니다. (http://help.adobe.com/en_us/as3lcr/flash_10.0/flash/display/stage.html#displaystate)

눌렀을 때 Jotham의 코드를 실행하는 두 번째 버튼이 있어야합니다. 로그인 버튼이나 사용자가 어쨌든 누르는 다른 버튼으로 이동합니다.

안타깝게도 위의 게시물은 작동하지 않습니다. SWF :

package {
    import flash.display.Sprite;
    import flash.display.StageDisplayState;
    import flash.events.Event;
    import flash.events.MouseEvent;

    public class Tester extends Sprite {
        public function Tester() {
            trace("Display States: Full="+StageDisplayState.FULL_SCREEN+"; Normal="+StageDisplayState.NORMAL);
            trace( "- Display State? "+stage.displayState);
            trace( "- Full Screen Enabled? "+(stage.hasOwnProperty("displayState")) );
            stage.addEventListener( MouseEvent.CLICK, function(evt:Event=null):void {
                trace("Attempting to change to FullScreen...");
                try {
                    stage.displayState = StageDisplayState.FULL_SCREEN;
                    trace("Success!");
                    stage.displayState = StageDisplayState.NORMAL;
                } catch(e:*) {
                    trace("Fail! "+e);
                }
            });
        }

    }
}

전체 화면이 비활성화되면 추적됩니다.

Display States: Full=fullScreen; Normal=normal
- Display State? normal
- Full Screen Enabled? true
Attempting to change to FullScreen...
Fail! SecurityError: Error #2152: Full screen mode is not allowed.

문제는 Full Screen Enabled? true 부분.

나는 우리가

_root.stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullScreenListenter);

타이트 보안 세트 호스트에서 전체 화면 모드를 허용하려는 테스트에서 NULL 예외를 반환합니다. FullScreenevent 때문에 존재하지 않는 것 같습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top