Flex 外部配置文件

发布于 2024-08-13 05:52:32 字数 137 浏览 2 评论 0原文

我的问题:我有一个 Flex3 程序访问服务器。该程序本身位于服务器上并通过网络浏览器访问。关键是我不想在 swf 文件中硬编码要访问的服务器的 IP,因为它会发生变化以及由于各种其他原因......

我该怎么做?我可以将文件放在同一目录中吗?

My problem: I have a program in Flex3 that accesses a server. The program itself is on a server and accessed through a web browser. The point is that I don't want to hardcode in the swf file the IP of the server to access, since it changes and for various other reasons...

How can I do that? Can I put a file in the same directory and what then?

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

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

发布评论

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

评论(1

终难遇 2024-08-20 05:52:32

要访问与 SWF 相同的服务器上的配置文件,您应该能够使用具有相对 URL(而不是绝对 URL)的 HTTPServiceURLLoader。您可以通过访问基本应用程序的 url 字段并从中创建一个新的绝对 URL 来获得更奇特的效果(更改端口)。

如果 SWF 与 HTML 分开托管,您可以使用 BrowserManager url 来构建您的配置 url。

To access a config file on the same server as the SWF, you should be able to use an HTTPService or URLLoader with a relative URL rather than absolute. You can get fancier (changing ports) by accessing the url field of your base Application and creating a new absolute URL from that.

If the SWF is hosted separately from the HTML, you can use BrowserManager url to build your config url instead.

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