通过一个基本路径,以在运行时加载的SWF路径、加载、基本、SWF

2023-09-08 14:21:04 作者:冰舞の恋雪

我有一个的main.swf它加载module.swf和module.swf装载部分资产。 该module.swf独立工作,也需要当的main.swf装载工作。

I have a main.swf which loads a module.swf and the module.swf loads some assets. The module.swf works standalone and also needs to work when loaded by main.swf.

但不幸的是,module.swf找不到资产时,通过的main.swf加载,因为资产没有位于相对的main.swf,但位于相对于module.swf。

But unfortunately the module.swf can't find the assets when loaded by main.swf because the assets aren't located relative to the main.swf, but are located relative to the module.swf.

正如我不能碰module.swf,我也不愿改变的目录结构,我要寻找一个解决方案,接近一个的基地的参数,它可以在一个swf被嵌入到HTML中使用。

As I can't touch the module.swf and I'm also unwilling to change the directory structure, I am looking for a solution close to the a "base" parameter which can be used when a swf is embedded into html.

有没有办法使用加载SWF文件时,模拟基参数的行为装载机

Is there a way to simulate the base parameter's behaviour when loading a swf file using Loader?

Here是一种类似但悬而未决的问题。

Here is a similar yet unanswered question.

推荐答案

您可以使用的 的符号链接,以此来重定向你的资产网址

You could use symlinks as a way to redirect your assets url when loaded via the main swf