Flash web game移植到android平台需要注意的地方
来源:互联网 发布:c语言调试器 编辑:程序博客网 时间:2024/05/18 19:18
1、air不支持Security.allowDomain("*");
如同一个swf即要支持flash player播放,又要支持air,则通过类型来判断:
if(flash.system.Capabilities.playerType !="Desktop") Security.allowDomain("*");
2、var cm:ContextMenu =new ContextMenu();
air的 cm.customItems为空。
3、报错:调用loader.loadBytes()方法时,SecurityError:Error #3226: Cannot import a SWF file when LoaderContext.allowCodeImport isfalse.
原因是没有设置LoaderContext.allowCodeImport,这样解决:
var con:LoaderContext = newLoaderContext();con.allowCodeImport = true;loadBytes(mc, con);
4、报错:1119: 访问可能未定义的属性allowCodeImport (通过 static 类型 flash.system:LoaderContext 引用)。
原因是使用了allowCodeImport属性,需要flash player 10.1才支持
5、报错:调用loader.load()方法时,SecurityError:Error #2142: Security sandbox violation: local SWF files cannot use theLoaderContext.securityDomain property.
原因是LoaderContext使用了SecurityDomain.currentDomain,air不支持SecurityDomain.currentDomain ,但依旧可以使用new LoaderContext();
con = new LoaderContext(false,null,SecurityDomain.currentDomain);----不支持
con = new LoaderContext(false,ApplicationDomain.currentDomain);----支持loader.load(new URLRequest(_source), con);
6、旋转实现
stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE,onOrientationChange);private functiononOrientationChange(event:StageOrientationEvent):void { switch(event.afterOrientation) { caseStageOrientation.DEFAULT: // re-orient display objects based on // the default(right-side up) orientation. stage.setOrientation(StageOrientation.DEFAULT) break; caseStageOrientation.ROTATED_RIGHT: // Re-orient display objects based on //right-hand orientation. stage.setOrientation(StageOrientation.ROTATED_RIGHT) break; caseStageOrientation.ROTATED_LEFT: // Re-orient display objects based on //left-hand orientation. stage.setOrientation(StageOrientation.ROTATED_LEFT) break; caseStageOrientation.UPSIDE_DOWN: // Re-orient display objects based on // upside-downorientation. stage.setOrientation(StageOrientation.UPSIDE_DOWN) break; } }
7、到目前为止,好像还不能实现手机麦克风(Microphone.isSupported为true,但不知为何说话没反应,待解决)
8、自定义air应用图标:修改-app.xml文件,icon属性
<icon> <image16x16>ico/16.png</image16x16> <image32x32></image32x32> <image36x36></image36x36> <image48x48></image48x48></icon>
- Flash web game移植到android平台需要注意的地方
- 将Cocos2d-x从iOS平台移植到Android平台需要修改的地方
- cocos2d-x 移植android,用到jni需要注意的地方
- 移植C/C++程序到不同平台时需要留意的地方
- android 混淆时需要注意的地方
- android自定义view需要注意的地方
- android手势监听需要注意的地方
- android studio快捷键需要注意的地方
- 需要注意的地方
- 需要注意的地方
- 需要注意的地方
- 将 Java Web 应用从 Windows 移植到 AIX 时需要注意的问题
- 将 Java Web 应用从 Windows 移植到 AIX 时需要注意的问题
- 将 Java Web 应用从 Windows 移植到 AIX 时需要注意的问题
- android bionic移植需要注意的事项
- hibernate 从oracle 移植到mysql 需要改的地方
- web界面测试中需要注意的地方
- web项目,tomcat转到weblogic需要注意的地方
- Java中的注解以及应用 @Deprecated @SupressWarning @Override
- 大家一起写操作系统(1)-引导程序
- Android图片的处理类
- 8个MySQL性能优化技巧
- 添加路径到sys.path
- Flash web game移植到android平台需要注意的地方
- UDP Socket
- SQL Server CONVERT() 函数
- sp_send_dbmail (Transact-SQL)
- 多线程学习记录3-读写锁
- hadoop源码 找不到org.apache.test.ant
- 可行性研究
- Red Hat Enterprise Linux (RHEL) 6.3 update firefox
- c# winform背景图片超过屏幕分辨率怎么办