问题标签 [loaderinfo]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
4956 浏览

flash - 如何获取嵌入 Flash 电影的 URL?

今天我试图获取我的 Flash 电影所在的 URL。

我在这里发现了一个类似的问题,它通过指向 Flash 的 LoaderInfo方法的链接得到了回答,但我不确定我是否在我的测试电影中正确使用它作为 textField:http: //leongaban.com/stackoverflow/getUrl /不显示网址

更新!工作代码

我所需要的就是这个:stage.loaderInfo.url:)

http://leongaban.com/stackoverflow/getUrl/

0 投票
3 回答
2095 浏览

apache-flex - 其他人在被另一个 swf 加载时无法收听 uncaughtErrorEvent 吗?

当我尝试uncaughtErrorEvents直接加载时访问调度程序时,一切正常。但是,当我在另一个 swf 加载时尝试相同的代码时,我得到一个参考错误。

直接加载时的输出(在浏览器中):

由另一个“加载器”SWF 加载时的输出:

如果其他人可以复制这一点,我将不胜感激。

编辑:也试过用stage.loaderInfo, 而不是loaderInfo. 同样的问题...

0 投票
1 回答
821 浏览

actionscript-3 - AS3 - 如何从 GET 请求接收 swf 中的参数?

我尝试使用var params: Object = ((this.stage.loaderInfo) as LoaderInfo).parameters;来获取参数,但它返回一个没有属性的对象。如果我使用 LoaderInfo.url,LoaderInfo 会给我没有参数的正确 URL。我正在使用请求:http://localhost/foo.swf?start=foobar。params.hasOwnProperty("start") 什么都不返回,并且使用 for 循环表明“params”没有属性。如何在我的代码中接收 start/foobar 对?由于我们的设置,我更愿意不使用 FlashVars。

0 投票
2 回答
652 浏览

apache-flex - 通过 url 将参数传递给 flex 模块

我在 Flex 应用程序中重复使用几个模块,并通过“loaderInfo.url”var 传入参数来改变条件。这适用于给定模块的第一次迭代,但后续尝试将始终看到与第一次创建相同的参数,无论实际使用什么。

创建模块时是否有某种方法可以重置此值?

当我在'CreationComplete' 处理程序(例如'trace(this.loaderInfo.url);')中查看参数时,每次(对于给定的模块)都是相同的,而不管通过?param=string 实际传递了什么。我究竟做错了什么?

0 投票
2 回答
341 浏览

actionscript-3 - AS3:是否可以只接受 FlashVars 而忽略查询字符串参数?

LoaderInfo的 Adob​​e 页面指出:

参数的两个来源是:主 SWF 文件的 URL 中的查询字符串,以及 FlashVars HTML 参数的值(这只影响主 SWF 文件)。

我们希望只接受 FlashVars 参数并忽略作为查询字符串的一部分传入的参数。这有可能吗?

0 投票
1 回答
410 浏览

actionscript-3 - LoaderInfo.width != flex 3.5 中的 stage.width

使用 flex 3.5 遇到奇怪的行为。这是一个最小的代码: build.xml 目标:

播放器.mxml:

PlayerApp.as:

物体:

使用调试播放器运行所有这些会产生以下跟踪:

这会导致添加到应用程序的视频(包含在 Sprite 中)仅显示为 250x154 左右大小,因为 500x375 被压缩到页面上包含的 320x240 元素中。

继续问题:是否有可能以任何方式避免此错误,以便 swf 仍可与 flash 版本 9.0.115 一起使用。我也不想在 build.xml 文件中硬编码大小,因为播放器大小可能会在近期发生变化。

免责声明:我使用 flex 3.5 作为 flash 播放器 9.0.115 必须受支持,并且由于企业客户的原因必须支持 flash 9.0.115 (甚至 9.0.115 似乎对某些人要求太多。)我还注意到我可以编译.as 没有 .mxml,但我把它留在这里。

0 投票
1 回答
3372 浏览

flash - actionscript 3 LoaderInfo 来自一个类

我正在使用 flashvars 来获取一些信息。当我从主 fla 框架中使用 LoaderInfo(this.root.loaderInfo).parameters 时,它工作得很好,但是我怎样才能从一个类中使用它呢?

像这样的东西-

我收到此错误消息:通过具有静态类型的引用访问可能未定义的属性根。

希望有人能指导我如何克服这个问题。谢谢!

0 投票
1 回答
608 浏览

actionscript-3 - 获取 swf 布尔参数

我有一个我称之为的 swf

/SWFUploader/upload.swf?single=true

然后在 ActionScript 3 中,我读取了该值。但它不起作用。这是我的测试代码(第一个块取自http://blogs.adobe.com/pdehaan/2006/07/using_flashvars_with_actionscr.html):

令人沮丧的是,这是被追踪的两条线:

我究竟做错了什么?

0 投票
1 回答
1981 浏览

actionscript-3 - Can't load youtube thumbnail images. Security sandbox violation: LoaderInfo.content: cannot access '*.png'. No policy files granted access

I can't seem to wrap my head around this image loading problem with my actionscript 3.0 project. I suspect it has something to do with how I have the crossDomain.xml set up. The problem is that I can load youtube movie thumbnail images from http://img.youtube.com/ into flash and display them completely fine when testing/running the SWF in a stand alone (local) player.

But when I upload the SWF and test it through the web I receive Sandbox Errors and Security Violations.

Here is my crossDomain.xml (stored on the root of the server):

Here is some AS3:

Here is the error I get with the current configuration of crossDomain.xml and loaderContext

I've tried creating the LoaderContext without checkPolicyFiles as false.

Is there any way to remove these Security Sandbox violations? Or because the crossDomain.xml used is hosted by YouTube.com there isn't anything I can change?

If it is the ladder how does one load these thumbnail images and use them? Can a policy file put restrictions on the loaderInfo.content property?

Any help would be great, Thanks! TwoBit

0 投票
2 回答
210 浏览

actionscript-3 - firefox 不会将 xml 加载到由 html 代码中的参数调用的 swf 中(在 IE 中工作正常)

我在 flash cs5/as3 中建立了一个练习。它从 xml 文件中提取其内容。因为我想让其他人更容易基于这个 swf 创建自己的练习,所以我希望 actionscript 加载 xml,文件名基于 html 代码中的参数。

在这种情况下,xml 称为oef01.xml

链接如下所示:BoFlitsOefening.swf?id=oef01

像这样的动作脚本:

该构造在 Internet Explorer 中运行良好,但在 Firefox 中运行良好。我已经进行了互联网研究,但我找不到我能够应用的解释或解决方案,尽管这个问题是已知的。