Flash播放器停留在第1帧调用函数后, [英] Flash player stuck at Frame 1 after calling a function

查看:232
本文介绍了Flash播放器停留在第1帧调用函数后,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作在一个闪光CS6和我有一个麻烦:调用功能后,玩家冻结在第1帧中按Ctrl + Enter preVIEW这并不happend,但是当我玩.swf文件发表(使用Flash Player,或者在网页浏览器中打开它,并不重要)是当问题开始。

I'm working in a flash CS6 and I'm having a trouble: After calling a function, player freezes at frame 1. This not happend during Ctrl+ENTER preview, but when I play the .swf file published (using flash player or opening it on a web browser, doesn't matter) is when the problem begin.

这是在code:

import flash.display.MovieClip;
var code:int = 0
var temp:int = 0; 
var _xmlURL:String = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=368335%20and%20u=%27c%27";
var _xmlData:XML;

function loadXML(xmlURL:String):void {
    var loader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest(_xmlURL);
    loader.load(request);
    loader.addEventListener(Event.COMPLETE, loadData);
}

function loadData(event:Event):void{
    _xmlData = new XML(event.currentTarget.data);

    var dataG:XMLList = _xmlData.results.channel.item.elements();

    code = dataG[5].@code;
    temp = dataG[5].@temp;

    trace(code);
    trace(temp);
}

loadXML(_xmlURL);

我不习惯使用AS3,我不,如果我使用它的权利知道。

I'm not used to use as3, I don't know if I'm using it right.

正如你所看到的,code读取使用的URLLoader及其方法.load外部XML文件。

As you can see, the code reads an external xml file using "URLLoader" and its method ".load".

感谢您的帮助。

顺便说一句,我已经试过玩出版的的.swf文件中的其他电脑(XP,七,8),最近才刚刚安装与Windows一(7件)。

BTW, I've already tried to play the published ".swf" file in other PCs (xp, seven, 8), one of them with Windows recently installed (seven).

推荐答案

最有可能的(因为你在加载资源来自互联网,当你测试工作),这必须与您的应用程序的安全设置。

Most likely (because you're loading in resources from the internet, and it works when you test), this has to do with the security settings of your application.

转到您的发布设置文件 - >发布设置

您会看到一个下拉列表标记本地回放安全性。确保这项设置为接入网络只,而不是默认的接取当地唯一

You'll see a drop down labelled Local playback security. Ensure this is set to access network only and not the default acess local only.

这挂断了很多人,当他们第一次开始使用闪光灯。

This hangs up a lot of people when they first start using flash.

它总是好的做法也听不只是为完成事件对你的装载机,也为错误事件,如:

It's always good practice too, to listen not just for the COMPLETE event on your loaders, but also for error events such as:

loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandlerFunction);
loader.addEventListener(IOErrorEvent.NETWORK_ERROR, ioErrorHandlerFunction);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandlerFunction);

在你的情况下,它可能引发安全错误。

In your case, it's probably throwing a security error.

这篇关于Flash播放器停留在第1帧调用函数后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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