本文介绍了Flash Builder 4.6不针对Flash Player 10.2编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新创建的Flex应用程序,试图以我的第一个Flash Player 10.2为目标。我使用Flash Builder 4.6创建了它,并使用4.5a SDK编译。我还设置了在Adobe Flash Player选项中定位到10.2.0的选项。当我创建发布版本时,没有错误,并且生成的HTML文件包含以下内容:

  //对于版本检测,设置为分钟。所需的Flash Player版本,或0(或0.0.0),无版本检测。 
var swfVersionStr =10.2.0;但是,如果我尝试在浏览器中使用v10.2的插件访问应用程序它说11.1是需要的。我也有一个简单的Flash CS5动画,只使用stop()和getURL()相同的问题。动画工作,但不停止。

感谢您的详细回复wxvxw我现在已经采取了我的编译器选项的屏幕截图,但不能在这里显示我是一个新用户,但网址是...





我试过了-target-player 10.2.0(以前)和现在的-target-player 10.2,但都没有工作。我还在以下目录中找到了playerglobal.swc:
C:\ Program Files(x86)\Adobe\Adobe Flash Builder 4.6 \sdks\4.5.0\frameworks\libs \player\10.2



谢谢。 Dan。

解决方案

IIRC,FB 4.6附带的SDK只包含FP 10.1和FP 10.3库。所以,为了编译FP 10.2,你必须找到相应的playerglobal.swc(也许查看旧的SDK版本?)。

现在,关于您的设置:要编译的播放器的版本是在编译器参数中设置的,有多种方法可以做到这一点,但它看起来像你已经做了一些其他的事情:)为了编译某些播放器版本,编译器需要知道该播放器的版本是如何表现的,也就是说,它需要描述玩家当时所有的内置函数。 playerglobal.swc提供了这些函数的定义(搜索您的SDK文件夹中的可能位置)。 -target-player 是你需要的编译器参数。一种告诉编译器目标玩家的方法是打开项目设置,并在附加的编译器参数行中输入 -target-player 10.2 。请注意,您可能没有合适的playerglobal.swc。在这种情况下,编译器错误将粗略地指向要找到这个库的目录。



Flash Builder和SDK从未有过11+播放器的需求, (更多的是,SDK甚至没有针对这个版本进行测试),所以这个要求是不相关的(你使用Google Chrome进行测试,也许你需要检查 about:plugins 页面?)。你所设置的是一些应该告诉用于嵌入SWF的JavaScript脚本的变量,运行SWF所需要的最低版本的播放器,这对SWF本身没有影响,它只是用于用户的信息(你应该这样设置,以防用户使用老版本的播放器时会被告知升级)。如果您使用了FB的代码生成或者Adobe提供的Ant任务来生成包含SWF的HTML页面,那么这个变量将被设置为您用来编译SWF的相同版本,否则由您来调整它为适当的价值。


I am new to creating Flex applications and trying to target Flash Player 10.2 with my first. I have created it using Flash Builder 4.6 and compiled using the 4.5a SDK. I've also set the option to target 10.2.0 in the the Adobe Flash Player options. When I create the release build, there are no error and the resulting HTML file contains the following:

// For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.
var swfVersionStr = "10.2.0";

However, if I try to visit the application in a browser with v10.2 of the plug-in it says 11.1 is needed. I also have the same problem with a simple Flash CS5 animation that only uses stop() and getURL(). The animation works but doesn't stop.

Thanks for the detailed reply wxvxw I've now taken a screenshot of my compiler options, but can't show it here as I'm a new user, but the URL is...

https://lh6.googleusercontent.com/-3xEJ0RTFG-8/Tw9rJt2UloI/AAAAAAAAARs/Ruu9Em66fgo/s800/fboptions.PNG

I've tried -target-player 10.2.0 (previously) and now -target-player 10.2 but neither worked. I've also located the playerglobal.swc in the following directory:C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.5.0\frameworks\libs\player\10.2

Thanks. Dan.

解决方案

IIRC, the SDK that comes with FB 4.6 only has FP 10.1 and FP 10.3 libraries. So, in order to compile for FP 10.2 you will have to find the corresponding playerglobal.swc (maybe look up older SDK releases?).

Now, regarding your settings: the version of the player you want to compile for is set in the compiler arguments, there are multiple ways to do that, but it looks like you've done something else instead :) In order to compile for certain player version, the compiler needs to know how that version of the player behaved, that is it needs a description of all the built-in functions the player had at that time. playerglobal.swc provides the definitions for those functions (search your SDK folder for the possible location). -target-player is the compiler argument that you need. One way to tell the compiler what player to target is to open the project settings and in the additional compiler arguments line type something like -target-player 10.2. Note that you might not have the appropriate playerglobal.swc. The compiler error in such case will roughly point you to the directory where this library is to be found.

Flash Builder and SDK had never had 11+ player as a requirement, (more yet, the SDK has not even been tested against this version), so the requirement is unrelated (did you use Google Chrome for testing, maybe you need to check about:plugins page?). What you did set is some variable that is supposed to tell the JavaScript script that is used to embed the SWF, what minimum version of the player is required to run the SWF, this has no effect on the SWF itself, it's only for user's information (you should set it in such a way, that in case users have older version of player they will be told to upgrade). If you used FB's code generation, or the Ant task provided by Adobe to generate the HTML page containing SWF, then this variable would be set to the same version you used to compile your SWF to, otherwise it's up to you to adjust it to the proper value.

这篇关于Flash Builder 4.6不针对Flash Player 10.2编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 16:40