我可以将 linq to SQL 查询返回的内存中 XML 加载到 SWF 对象吗?
我可以将 linq to SQL 查询返回的内存中 XML 加载到 SWF 对象吗?
这是长版本。
目的是通过查询字符串将内存中的 XML 文件加载到 SWF 对象。
目前我从绝对路径读取并加载 XML 文件。
var flashvars = {xmlPath: "xml/" + GetQueryString("x") + ".xml" };
var params = { allowFullScreen: "true", wmode: "transparent" };
var attributes = {};
swfobject.embedSWF("main.swf", "gallery", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
不幸的是或幸运的是,上面的解决方案并不优雅,因为我必须创建 XML 文件并将其保存到我的网络服务器,然后从绝对路径将其加载到 SWFobject...
当我尝试保存文件...
Access to the path 'C:\inetpub\vhosts\example.com\httpdocs\images\76df249e-83c3-413d-8664-c6f7b289c32c\data.xml' is denied.
那么我该怎么做才能使它工作呢? 我可以绕过绝对相对路径将内存中的 XML 文件加载到 SWFobect 中吗?
如果是这样我该怎么办?
我确信您不会在每个查询中创建文件并将它们保存在网络服务器中。
Can i load an in memory XML, returned by a linq to SQL query, to an SWF object?
And here comes the long version.
The purpose is loading an in-memory XML file, to an SWFobject via a querystring.
Currently i read and load the XML file from an absolute path.
var flashvars = {xmlPath: "xml/" + GetQueryString("x") + ".xml" };
var params = { allowFullScreen: "true", wmode: "transparent" };
var attributes = {};
swfobject.embedSWF("main.swf", "gallery", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
Unfortunately or fortunately the solution above is not elegant since i have to create and save the XML file to my webserver and then load it to the SWFobject from an absolute path...
Which gives me errors like the following, when i try to save the file...
Access to the path 'C:\inetpub\vhosts\example.com\httpdocs\images\76df249e-83c3-413d-8664-c6f7b289c32c\data.xml' is denied.
So what can i do to make it work?
Can i load an in-memory XML file to an SWFobect bypassing the absolute-relative paths?
If so how can i do it?
I am sure you do not create files in every query and save them in web-server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将整个 xml 嵌入到 flashvars 中。
Embed whole xml in flashvars.