flexbuilder打包swc

[size=medium]flexbuilder打包swc地址:
http://blog.csdn.net/Arthur0088/archive/2009/11/02/4759435.aspx


在Flex中,有的时候,我们将一些常用的功能封装到了几个AS文件中去,但是如果要引用,还需要将公用的类引入到我们的工程,我们可不可以将这些功能打成一个swc发布出来供大家使用呢,答案是肯定的,现在就介绍一下该如何打SWC包。
我们使用的是JAVA程序员的法宝-eclipse来完成的。
现在有两种方式来完成swc打包动作,一个是在eclipse中的flex插件中建立一个swc工程,一个是利用eclipse中的ant工程来完成。

一、ant方式打swc
为了方便大家的使用,我将一个打PureMVC_MultiCore.swc的工程放到了网上,请大家先下载一下
下载地址:http://www.blogjava.net/Files/rainwindboys/SWCTest.rar

下面的介绍就是围绕这个工程展开的。
首先,请修正工程下的build.properties文件,文件如下:
# Window and document title for the documentation
title = ASDocs Test Library

# Class-folders you want to search for classes to be included in the docs, seperated by spaces (for example ../com/ ../net/ )
# to include every .as and .mxml file within your project, just state ../
domainextensions = ./flex-src

# The Location of deployment library on your Computer (PC/Mac) for compiled SWC file
liboutputfolder = bin
liboutputfile = PureMVC_MultiCore.swc
libpath = libs

# The Location of the output folder for your generated documents
docsoutputfolder = bin/docs

# Home directory for flex sdk 3, change this to build for Mac or PC using # as comment
# FLEX_HOME = C:/Program Files/Adobe/Flex Builder 3/sdks/3.0.0
FLEX_HOME = D:/Program Files/Adobe/Flex Builder 3 Plug-in/sdks/3.0.0

# The location of your asdoc.exe, change this to build for Mac or PC using # as comment
#asdoc.exe = C:/Program Files/Adobe/Flex Builder 3/sdks/3.0.0/bin/asdoc.exe
asdoc.exe = D:/Program Files/Adobe/Flex Builder 3 Plug-in/sdks/3.0.0/bin/asdoc.exe

需要修正的地方

domainextensions = ./flex-src:这个是你要打包的src路径
liboutputfolder = bin:这个是swc输出的路径
liboutputfile = PureMVC_MultiCore.swc:这个是输出swc的名字
libpath = libs:这个需要打包src用到的类库
docsoutputfolder = bin/docs:这个是asdoc输出的路径
FLEX_HOME = X:/Program Files/Adobe/Flex Builder 3 Plug-in/sdks/3.0.0:你的flex SDK的路径
asdoc.exe = X:/Program Files/Adobe/Flex Builder 3 Plug-in/sdks/3.0.0/bin/asdoc.exe:这个是asdoc的路径


在eclipse中window->preferences选择ant中的Runtime,将D:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.0.0\ant\lib\flexTasks.jar引入

然后执行build.xml生成SWC

二、建立SWC工程方式
这个比较简单,在建立工程的时候,选择flex libiary project,直接默认到最后一步。
然后再建立的工程上面鼠标右键,选择flex libiary build path 选中你要打入的src,点击完成后,会在bin目录中生成swc,但是需要注意的,如果没有生成swc有可能是src的编译没有通过。 [/size]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值