scratch2.0的编译是一大难点,编译通过之后小修小改其实没有什么难度。
使用Flash Builder配置开发环境
- 下载devolpe版的Scratch-flash源码:https://github.com/LLK/scratch-flash
-
安装Flash Builder 4
-
下载已整合好的flex air SDK
-
新建flex项目,项目地址指向源码的根目录(不是src),应用程序类型选择桌面,
-
配置SDK(如果导入时没有配置),项目属性 -> Flex编译器 -> 配置Flex SDK -> 添加
-
导入源码中的libs中的swc库(如果没有自动导入的话)
-
项目->属性->Flex模块,添加一个模块,源代码选择src\Scratch.as,输出scratch.swf,选择不优化
-
其他配置:
- 框架链接选择“合并到代码中”
- 取消勾选验证RSL摘要
- 编译器参数:
-locale zh_CN -swf-version=19 -default-size=800,600 -define+=SCRATCH::allow3d,false -define+=SCRATCH::revision,'e267f37'
-
修改Main-app.xml配置, 参考下面附录
-
src里新建icons文件夹,放入对应尺寸的图片文件,文件名对应Main-app.xml内的配置
-
(可选)将官方安装包的media目录复制到src下
-
项目/构建项目,项目/导出发行版,包内容全选,数字签名自己新建一个
-
导出完成后 Scratch.air就是离线版的安装包
air格式转成exe格式
D:\development\flashbuilder\flex_sdk_air\bin\adt -package -target native Scratch.exe Scratch.air
Main-app.xml参考
“`xml
<id>scratch-offline</id>
<versionNumber>1.0</versionNumber>
<filename>Scratch</filename>
<name>Scratch编辑器客户端</name>
<description></description>
<copyright></copyright>
<initialWindow>
<title>Scratch编辑器客户端</title>
<content>Scratch.swf</content>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
<minimizable>true</minimizable>
<maximizable>true</maximizable>
<resizable>true</resizable>
</initialWindow>
<icon>
<image16x16>icons/AppIcon16.png</image16x16>
<image32x32>icons/AppIcon32.png</image32x32>
<image48x48>icons/AppIcon48.png</image48x48>
<image128x128>icons/AppIcon128.png</image128x128>
</icon>
<fileTypes>
<fileType>
<name>Scratch2ProjectFile</name>
<extension>sb2</extension>
<contentType>application/octet-stream</contentType>
<icon>
<image16x16>icons/ProjectIcon16.png</image16x16>
<image32x32>icons/ProjectIcon32.png</image32x32>
<image48x48>icons/ProjectIcon48.png</image48x48>
<image128x128>icons/ProjectIcon128.png</image128x128>
</icon>
</fileType>
</fileTypes>
<!--
More options:
http://livedocs.adobe.com/flex/3/html/File_formats_1.html#1043413
-->
“`
发表评论
抢沙发~