Flash SWF文件无法找到XML数据文件时加载到WebBrowser控件(但在IE9作品) [英] Flash SWF file cannot find XML data file when loaded into WebBrowser control (but works in IE9)

查看:251
本文介绍了Flash SWF文件无法找到XML数据文件时加载到WebBrowser控件(但在IE9作品)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面一个长的解释,有希望准确简短的问题总结这里位:

Bit of a long explanation below, with a hopefully accurate short question summary here:

能否一个.NET WebBrowser控件(Win7的64位,IE9,当前的Flash 10.3.183.7)将SWF文件加载到<对象>标签,其中所述的SWF文件在还包含XML数据文件以这样的方式,以具有SWF文件加载和显示XML数据的单独文件夹

Can a .NET WebBrowser control (Win7 64-bit, IE9, current Flash 10.3.183.7) load a SWF file into an <object> tag, where the SWF file is in a separate folder that also contains an XML data file in such a way as to have the SWF file load and display the XML data?

更新:下添加一些更多的信息的基础上进一步的实验......

UPDATE: Added some more information below based on some further experimentation...

血淋淋的细节:

这一直困扰我几天。考虑以下几点:

This has plagued me for a couple of days. Consider the following:

C:\ dev的\ wb.exe - 使用一个web浏览器,从盘面显示本地SWF文件的程序

C:\dev\wb.exe -- program that uses a WebBrowser to show a local SWF file from the disk

C:\ DATA \ mySWF.swf - 我想播放SWF文件 C:\ DATA \ myData.xml - 与数据文件mySWF.swf正在寻找

c:\data\mySWF.swf -- the SWF file I want to play c:\data\myData.xml -- the file with data that mySWF.swf is looking for

C:\ HTML \ index.html的 - 由wb.exe加载HTML文件。这个文件有一个&LT;对象&gt;标签设置一个Flash ActiveX控件播放C:\ DATA \ mySWF.swf

C:\html\index.html -- HTML file loaded by wb.exe. This file has an <object> tag to set up a Flash ActiveX control playing c:\data\mySWF.swf.

原来,这个开始与 swfobject.js 被使用,而当我没有看到结果,我期待,我不停地简化了,直到我得到的地步,我没有什么,但没有额外的库的HTML文件。

Originally, this started with swfobject.js being used, and when I didn't see the results I was expecting, I kept simplifying until I got to the point where I don't have anything but an HTML file with no additional libraries.

如果我加载 index.html的到IE9,它的工作原理。我看到的SWF文件与加载的XML文件中的数据播放。

If I load the index.html into IE9, it works. I see the SWF file playing with the data from the XML file loaded.

当我运行wb.exe,它加载了 C:\ HTML \ index.html的文件,我看到的SWF播放。但是,数据字段为空。如果我中的index.html复制到 C:\ DATA \ index.html的并加载到wb.exe的话,我看到我的数据

When I run wb.exe, it loads the C:\html\index.html file, and I see the SWF playing. But the data fields are empty. If I copy the index.html to C:\data\index.html and load it into wb.exe, THEN I see my data.

我的index.html文件:

My index.html file:

<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <style type="text/css">
* {
   width: 100%;
   height: 100%;
   margin: 0;
   padding: 0;
   overflow: hidden;
}
      </style>
</head>
    <body MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" RIGHTMARGIN="0" TOPMARGIN="0" BOTTOMMARGIN="0"> 
        <object  type="application/x-shockwave-flash" width=100%" height="100%" id='player1' name='player1'> 
            <param name='movie' value='C:\data\mySWF.swf'>
            <param name='allowfullscreen' value='true'>
            <param name='allowscriptaccess' value='always'>
            <param name='base' value='C:\data\'>
            <param name='menu' value='false'>
            <param name='quality' value='best'>
            <param name='scale' value='exactfit'>
        </object>
    </body>
</html>

基础参数似乎得到这个工作的一部分,但我阻碍,为什么或者是否我能得到Flash ActiveX控件工作我需要它的方式,而不必在同一文件夹中的SWF文件加载HTML文件。

The base parameter seemed to be part of getting this to work, but I'm stymied as to why (or whether) I can get the Flash ActiveX control to work the way I need it to, without having to load an HTML file from the same folder as the SWF file.

更新:如果我把myData.xml文件到C:\ HTML文件夹,我从C加载:\ HTML \ index.html的,我得到的SWF中的数据值。如此看来,该Flash插件是使用index.html文件的路径,而不是基本参数。

UPDATE: If I put the myData.xml file into the C:\html folder, and I load from C:\html\index.html, I get the data values in the SWF. So it seems that the Flash plug-in is using the path of the index.html file, and NOT the base parameter.

更新:我们已经发现,通过更experiementation,这个问题不会出现,如果SWF文件使用的Action Script 2(AS2)为它的XML处理(通过与XML.load())发生的,而是一个SWF文件中使用动作脚本3(AS3)(通过对URLLoader.load())不能正常工作。这只是变得怪异。

UPDATE: We've found out, through more experiementation, that this problem does NOT appear to occur if the SWF file uses Action Script 2 (AS2) for its XML handling (via XML.load()), but a SWF file using Action Script 3 (AS3) (via URLLoader.load()) does NOT work properly. This just gets weirder.

我AP preciate您的耐心。

I appreciate your patience if you stuck around this far, and hopefully you might be able to educate me as to my problem.

感谢。

推荐答案

作为后续行动,我自己的问题,也没有很好的解决方案。

As a follow-up to my own question, there's no nice solution.

我们通过使用jQuery来调整&LT工作围绕这一问题在主HTML标记来引用文件夹的SWF和我们加载一个新的SWF文件每次XML文件中。这样的作品,但没有人真的很高兴。

We worked around the issue by using jQuery to adjust a <base href="">tag in the main HTML to refer to the folder with the SWF and XML file in, each time we loaded a new SWF file. That works, but no one's really happy with it.

我们采访了微软,然后给Adobe。 Adobe称其在.NET web浏览器中使用Flash控制的不支持用例,不希望任何更多的是这个问题。

We talked to Microsoft, and then to Adobe. Adobe calls the use of Flash in a .NET WebBrowser control an "unsupported use case" and doesn't want anything more to do with the issue.

这篇关于Flash SWF文件无法找到XML数据文件时加载到WebBrowser控件(但在IE9作品)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆