在全屏模式下获取本地文件

时间:2015-04-15 10:13:42

标签: file actionscript-3 air fullscreen filereference

我有swf扩展到全屏:

stage.displayState = StageDisplayState.FULL_SCREEN;

第二次我尝试选择本地文件,它正在折叠到NORMAL_SCREEN

    file_mask = new FileFilter("Images: (*.jpeg, *.jpg, *.png, *.JPG)","*.jpeg; *.jpg; *.png; *.JPG");
    local_file.browse([file_mask]);

是错误,功能还是以前的方式???

import flash.net.*;
import flash.events.*;
import flash.display.*;

expand_btn.addEventListener(MouseEvent.CLICK, openApp)
function openApp(e:MouseEvent) {
    stage.displayState = StageDisplayState.FULL_SCREEN;
}

file_btn.addEventListener(MouseEvent.CLICK, openApp2)
function openApp2(e:MouseEvent) {
    var local_file:FileReference = new FileReference();
    var file_mask:FileFilter = new FileFilter("Images: (*.jpeg, *.jpg, *.png, *.JPG)","*.jpeg; *.jpg; *.png; *.JPG");
    local_file.browse([file_mask]);
}

1 个答案:

答案 0 :(得分:1)

使用全屏互动。

 stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
 //Align top left of the stage.
 stage.align = StageAlign.TOP_LEFT;
 //align swf contents without scale.
 stage.scaleMode = StageScaleMode.NO_SCALE;

如果您在浏览器中嵌入,请添加以下参数。

<param name="allowFullScreenInteractive" value="true" /> 

Ref