开发者

flashvars issue

I received an swf (AS3) file that works when you pass it variables through flashvars. I can't recompile it to work in a different way because we only bought the compiled swf, not the source.

We could use it in an HTML page, but the problem is we must use it (in a sort of proprietary) Windows form (fundamentally, an application that takes a path and displays an image, a video or a swf in a form).

Now: we can't pass the swf vars by appending them to the path and we can't recompile the swf. Is there any other way to pass two variables to the swf to make it work? We thought we could have another swf with hard-coded variables load the proprietary swf for this last one to read them once loaded, but unfortunately it does not work. Any ideas? The problem is the proprietary swf is waiting variables through:

LoaderInfo(this.root.loaderInfo).parameters['varName']

EDIT 1: I did another thing. I loaded the swf from another swf and passed variables through URLVariables(). It doesn't work: the compiler says can't find that path (throws an I/O Error).

EDIT 2: I don't know if it is safe, but it seems it works the way I said in "EDIT 1". I thought the swf could not compile but it seems it doesn't care too much about the errors #2044 and #203开发者_Python百科5 thrown by the compiler.

I would say [SOLVED] but if you have any comments I would be glad to read them.


Have you tried putting the variables in the url/query string? I'm not sure of the variables are secure or need to be, but this should do it.


Coming from strongly-typed languages, this blew my mind, but if you declare a variable in flashVars, you don't need to do the following:

var flashVar = LoaderInfo(this.root.loaderInfo).parameters.flashVar;

You don't have to declare flashVar at all, in fact, because it was declared as a parameter already. You can just reference the flashVar of that name, no declaration required. This language strikes me as silly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜