BrowserManager 返回 null - Flex 4

发布于 2024-11-25 10:35:23 字数 604 浏览 1 评论 0原文

我正在努力使用 Flex 4 - BrowserManager,当您从 bin-debug 文件夹执行代码时,它可以工作,但当我导出发布版本时,它就不起作用。

这是代码:

var bm : IBrowserManager = BrowserManager.getInstance();                
bm.init();
var o : Object = URLUtil.stringToObject(bm.fragment, "&");

我试图使用它将外部参数获取到 swf 文件中,但当我导出发布版本时它根本不起作用。

此博客 http://flexperiential.com/2010/05/06/browsermanager- returns-null/ 知道这个 BrowserManager 有问题,但是他们建议的解决方案不起作用,他们做了某种奇怪的技巧,你无法在项目中重现。

如果有人可以在这里给我一些帮助,我将非常感激。

谢谢。

I am strugling with the Flex 4 - BrowserManager, somehow it works when you execute the code from the bin-debug folder, but when I export a release build then it does not work.

This is the code:

var bm : IBrowserManager = BrowserManager.getInstance();                
bm.init();
var o : Object = URLUtil.stringToObject(bm.fragment, "&");

I am trying to use it to get external parameters into the swf file, but it simply does not work when I export a release build.

This blog http://flexperiential.com/2010/05/06/browsermanager-returns-null/ knows there is something wrong with this BrowserManager, but the solution they suggest does not work, they make some sort of weird trick that you can not reproduce in your project.

If someone could give me some help here, I would really appreciate it.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

用心笑 2024-12-02 10:35:23

终于找到了解决办法。事实上,BrowserManager 在 bin-debug 文件夹中工作,无论它位于硬盘驱动器中的哪个位置,并且当您“导出发布版本”时,它不会在硬盘驱动器中工作除非您将 bin-release 文件夹放在 Flex 中4 项目文件夹,通常位于这个地址“C:\Documents and Settings\your-user-name\Adobe Flash Builder 4”;是的,我知道这听起来很奇怪,但这就是它实际的工作原理。

因此,如果您发现此问题,只需将 bin-release 文件夹复制到此位置,然后双击 html 文件即可在浏览器中再次加载 Flex 项目。

我在远程服务器上也遇到了这个问题(BrowserManager 也不起作用),是因为我忘记上传也位于 bin- 内的 history 文件夹 -发布文件夹,所以不要忘记也上传此文件夹。

Finally found the solution. In fact, the BrowserManager works from the bin-debug folder wherever it's located in your hard drive, and when you "Export a release build" it wont work from your hard drive unless you place the bin-release folder in the Flex 4 project folder, which is usually at this address "C:\Documents and Settings\your-user-name\Adobe Flash Builder 4"; yes, I know it sounds weird, but this is how it actually works.

So, if you find this problem, just copy the bin-release folder to this location and double-click the html file to load again the flex project in your browser.

I also had this problem on my remote server (the BrowserManager was not working either), and was because I forgot to upload the history folder which is also located inside the bin-release folder, so don't forget to upload this folder too.

盛夏尉蓝 2024-12-02 10:35:23

我也有类似的问题。就我而言,history.js 的使用在 index.template.html 文件中进行了注释。取消注释它对我有用。

I also had similar issue. In my case, use of history.js was commented in index.template.html file. Uncommenting it worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文