Flex Paper 源码编译

FlexPaper是一个开源轻量级的在浏览器上显示各种文档的组件,被设计用来与PDF2SWF一起使用, 使在Flex中显示PDF成为可能,而这个过程并无需PDF软件环境的支持。它可以被当做Flex的库来使用。

 

实现如豆丁和百度文库一样的效果,可以先将文件转为swf,再使用flex paper来进行在线浏览。

 

Flex Paper播放器及组件下载地址:
http://code.google.com/p/flexpaper/downloads/list

它的使用很简单,可以看我前面的转载的Flex:使用FlexPaper显示PDF文档。


源码下载 需要使用svn 地址:
http://flexpaper.googlecode.com/svn/trunk/

 

下面主要讲一下对源码的重新编译:

(转出错的提示及解决http://bbs.9ria.com/viewthread.php?tid=24002)

 

我的 flex builder 的版本是3.0.2.  为什么在使用时,无法定义vector对象,提示说是找不到类型,代码提示中也找不到提示. vector是顶级包的类型.请教高手,这是什么问题呢?怎么解决?

右键你创建的工程,选择properties选择Flex Compiler 将你的FlashPlayer的版本改为10再试试。我试过是可以成功的。

 

还有一个错误见文章最后面。

 

我使用flex builder 4导入flexpaper源码后有出错提示,在problems里有如下提示:

Description Resource Path Location Type unable to open 'C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\frameworks\locale\hu_HU' FlexPaper Unknown Flex Problem

我拷入这个下载下来的flexPaper时,将它的.actionScriptProperties文件里的支持的言语包去掉只剩下:

 additionalCompilerArguments="-locale=en_US  -allow-source-path-overlap=true"

并在true后加入 -source-path=locale/{locale}

还是出错,我就没办法,不知道有没有做过这方面的朋友愿意告诉一下我怎样将flex paper源码导入flex builder而不会出错。

 

我在无奈之下,就自己新建了一个flex project,将flex paper的src下的东西全拷过来放在src下,将locale和assets拷入到根目录下,这时出现如下错误:

Description Resource Path Location Type
Unable to resolve resource bundle "FlexPaper" for locale "en_US". ww  Unknown Flex Problem
Unable to resolve resource bundle "FlexPaper" for locale "en_US". ww  Unknown Flex Problem
Unable to resolve resource bundle "FlexPaper" for locale "en_US". ww  Unknown Flex Problem

网上有人说可以在Propertities-->Flex Compiler的Addition compiler arguments里加入 -source-path=locale/{locale}可以解决,我试过是可以的.

 

自己新建一个mxml文件,输入如下内容:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
	layout="absolute"
	width="100%" height="100%"
	xmlns:flexpaper="com.devaldi.controls.flexpaper.*">
	
	
	
	<!--Scale为浏览文档的放大比率-->
	<flexpaper:FlexPaperViewer width="100%" height="100%" 
		Scale="1.0" SwfFile="a.swf" />
	
</mx:Application>

 

便可直接flex paper的运行显示,然后就作自己的改造处理。

 

修改好之后,如何打成swc包呢?

(转swc文件的内容:

swc文件是flex的压缩包文件,就像是java的jar文件一样,所以如果将.swc后缀名修改成.zip,然后可以用winrar打开,里面就存有相应的内容,flash提供了这个工具,pkzip可以直接打开这个文件。
其中文件列表包括如下内容:
catalog.xml,文件描述,其中列举了组件的内容 )

 

如何在flex builder中打包swc文件:

1.新建actionscript library project
2.将需要的源文件导入到SRC目录下。
3.在项目的配置的flex library build path中,将src前面打勾。
4.OK。刷新一下就可以在bin目录下看到SWC文件了

 

我这里改造好的flexpaper的src全部覆盖actionscript library project的src目录,并将locale和assets目录拷到这个项目的根目录下,再到propertities里的Flex Library Compiler里的Additional compiler arguments加入-source-path=locale/{locale}不然它找不到语言包。这样完了之后,刷新一下项目,它就自动打包好到这个项目下的bin里的啦,并具它会将引用到的flex的sdk的包也打进去,在bin下的swc文件,你可以直接放到其它工程里去作为引用包使用,就是提供API供外面project调用。

 

 

最后附:

Flexviewer中创建自己的Flex中文语言包

http://fishincd.blog.sohu.com/130076793.html

 

 

Flex: Unable To Open locale en_US or fr_FR

If you want to create a localized application you may find yourself in a strange situation when you did all the steps like in the book, but you continue to receive the “Unable to open locale xx_XX” error messages.

To simulate a fix on this issue we will take the example of adding French to your app.

Basic steps:
- The first step is to create a fr_FR folder under the /locale/ one exactly like in the Flex documentation and then add the translated bundle.properties file.
- The second step is to add the compiler options: -locale en_US,fr_FR

 

Extra steps you need to make in order to get rid of the ugly “unable to open locale” error message:

1. goto the following path :

<flex-install-folder>/sdks/<current-sdk-folder>/bin/

for windows it’s: C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\bin\

2. Execute the following command:

copylocale.exe en_US fr_FR

That’s all, hope we helped you!
————————-

The TiMeister Team

再转载(http://stackoverflow.com/questions/1028644/flex-unable-to-open-locale-en-us):

 

Flex : Unable to open 'locale/en_US'

Using Flex Builder :
I have created a new Actionscript Project. I want to use mx.controls.Button class in it, so I did the following :

  1. Added '-locale=en_US -source-path=locale/{locale}' to the Actionscript compiler arguments
  2. Added 'framework.swc' to the library path

But now I get this error: unable to open 'locale/en_US' I looked up and I do have the following directory inside my Flex Builder 3 installation: 
./sdks/3.0.0/frameworks/locale/en_US

How to fix it?

Have you added a "locale" directory containing an "en_US" directory at the root of your Flex project, to be used for storing your locale-specific properties? For example, in a project supporting English- and French-localized strings, your Flex project structure might look something like this:

-- YourProject
   |-- libs
   |-- locale
       |-- en_US
           |-- resources.properties
       |-- en_FR
           |-- resources.properties
   |-- src
       |-- [Your source files...]

Sounds like that might be what's happening. Give it a try and post back if it doesn't work for ya.

还有:
http://www.mti.epita.fr/blogs/2009/01/05/i18n-en-flex/

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值