Flashdevelop 发布问题

发布于 2024-09-27 20:23:58 字数 1683 浏览 9 评论 0原文

我创建了一个简单的 flash 对象,使用“navigatetoURL”将浏览器重定向到不同的网页,同时从外部接口调用获取执行 flash 文件嵌入的页面所具有的 javascript 的 URL。

我能够很好地构建一切,并且我创建的 html 页面(使用 swfobject.embedSWF 嵌入 flash 文件)运行良好并重定向浏览器。但是,当我移动所有功能所需的文件(.swf 文件、swfobject.js 和嵌入 flash 对象的 html 文件)时,网页不再重定向。仅显示一个空白区域(似乎是 flash 对象),并且没有任何内容被重定向。

Flashdevelop 中是否缺少任何编译选项以防止纠正此问题?

这是 actionscript 3 代码:

package 
{
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.net.navigateToURL;
 import flash.net.URLRequest;
 import flash.net.URLVariables;
 import flash.external.ExternalInterface;

public class FlashTest extends Sprite
{
 public function FlashTest()
 {
    var url:String = ExternalInterface.call("GetURL");
    var hash:String = ExternalInterface.call("GetHash");
    var new_url:String = url + hash;
    var request:URLRequest = new URLRequest(new_url);
    navigateToURL(request, "_self");

 }
}
}

HTML 代码:

<html>
<head>

<script src='js/swfobject.js' type='text/javascript'></script>
<script type='text/javascript'>
swfobject.embedSWF('Flashtest.swf', 'altContent', '100%', '100%', '10.0.0');
function GetURL()
{
   return 'http://www.cnn.com';
}

function GetHash()
{
  return '?hash=2398asb9s8234';
}

</script>
</head>
<body>
<div id='altContent'>
<h1>Flash_test</h1>
<p>Alternative content</p>
<p><a href='http://www.adobe.com/go/getflashplayer'><img 
src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' 
alt='Get Adobe Flash player' /></a></p>
</div>
</body>
</html>

I have created a simple flash object to redirect a browser to a different webpage using "navigatetoURL" while getting the URL from externalinterface calls to the javascript that the page doing the embedding of the flash file has.

I am able to build everything just fine and the html page I created (using swfobject.embedSWF to embed the flash file) runs fine and redirects the browser. However when I move the files that are needed for everything to function (the .swf file, swfobject.js, and the html file that embeds the flash object) the webpage does not redirect anymore. Just a blank space, which seems to be the flash object, is displayed and nothing is redirected.

Is there any compile option in Flashdevelop that I'm missing to prevent correct this?

Here is the actionscript 3 code:

package 
{
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.net.navigateToURL;
 import flash.net.URLRequest;
 import flash.net.URLVariables;
 import flash.external.ExternalInterface;

public class FlashTest extends Sprite
{
 public function FlashTest()
 {
    var url:String = ExternalInterface.call("GetURL");
    var hash:String = ExternalInterface.call("GetHash");
    var new_url:String = url + hash;
    var request:URLRequest = new URLRequest(new_url);
    navigateToURL(request, "_self");

 }
}
}

The HTML code:

<html>
<head>

<script src='js/swfobject.js' type='text/javascript'></script>
<script type='text/javascript'>
swfobject.embedSWF('Flashtest.swf', 'altContent', '100%', '100%', '10.0.0');
function GetURL()
{
   return 'http://www.cnn.com';
}

function GetHash()
{
  return '?hash=2398asb9s8234';
}

</script>
</head>
<body>
<div id='altContent'>
<h1>Flash_test</h1>
<p>Alternative content</p>
<p><a href='http://www.adobe.com/go/getflashplayer'><img 
src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' 
alt='Get Adobe Flash player' /></a></p>
</div>
</body>
</html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

秋日私语 2024-10-04 20:23:58

实际上,我在将 swf 添加到 HTML DOM 之前和/或 DOM 准备好之前启动 swf 时遇到了麻烦。请参阅 Adobe 自己的关于ExternalInterface.call 和 javascript 的文章已准备就绪
我还想看看allowScriptAccess 参数:

<script type="text/javascript">
   var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
   so.addVariable("allowScriptAccess", "always");
   so.write("flashcontent");
</script>

Actually, I've been in trouble with swf's being started before they are added to the HTML DOM and/or before the DOM is ready. Have a look at Adobes own article on ExternalInterface.call and javascript isReady.
I would also have a look at the allowScriptAccess parameter:

<script type="text/javascript">
   var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
   so.addVariable("allowScriptAccess", "always");
   so.write("flashcontent");
</script>
再见回来 2024-10-04 20:23:58

这实际上是一个Flash播放器的安全问题。如果您将文件移出 bin 文件夹并在本地运行它们,它们将不再起作用。

每次在 flashdevelop 中创建项目时,“bin”文件夹都会添加到 flash 播放器的例外列表中。
如果您将文件移动到另一个文件夹,那么它们将不再工作,因此在浏览器中打开 html 时会出现空白页面。

解决办法是手动修改flashplayer安全配置文件并添加新路径或者访问:
http://www.macromedia.com/support/documentation/en /flashplayer/help/settings_manager04.html
点击全局安全设置>始终允许>编辑地点>添加位置>浏览找到文件所在的新路径。

It's actually a flash player security issue. If you move the files out of the bin folder and run them local they won't work any more.

Each time you create a project in flashdevelop the "bin" folder is added to the exception list of the flash player.
If you move the files to another folder then they won't work anymore hence the blank page when opening the html in browser.

The solution is to manually modify the flash player security config file and add the new path or to visit:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
Click on Global Security Settings > Always Allow > Edit ocations > Add Location > Browse for the new path, where the files are located.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文