【发布时间】:2011-05-07 17:38:01
【问题描述】:
运行使用 flex 创建的游戏时出错。 我知道对此有一些疑问,但我的情况很奇怪。我创建了一个在我的计算机上运行良好的简单打字游戏,但是当我尝试将其在线部署到 facebook 时,我得到了这些错误。我使用来自 adobe 的教程中的代码 http://www.adobe.com/devnet/facebook/articles/flex_fbgraph_pt4.html 将我的 flex 游戏部署到 facebook
这是错误信息:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at FacebookUserStatusWeb/init()
at FacebookUserStatusWeb/___FacebookUserStatusWeb_Application1_creationComplete()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at mx.core::UIComponent/set initialized()
at mx.managers::LayoutManager/doPhasedInstantiation()
at mx.managers::LayoutManager/doPhasedInstantiationCallback()
这里是 init() 函数的 sn-p:
protected var text1:String="Text to be typed"; //hard-coded temporarily
protected const TIMER_INTERVAL:int = 10;
protected var t:Timer = new Timer(TIMER_INTERVAL);
protected var topURL:String=ExternalInterface.call('top.location.toString');
protected function init():void
{
t.addEventListener(TimerEvent.TIMER, updateTimer);
ProblemText.text = new String(text1);
Facebook.init("<my app id>",loginHandler);
currentState = (topURL) ? "loggedout": "loggedoutonfacebook";
}
一些注意事项: 1.my app id 是我不想显示的 facebook app id 2.ProblemText 是一个富文本,我放置了要由播放器键入的段落。 3.我已经删除了Application1_creationComplete()方法,但它仍然出现在错误列表中
而且我对前两个以外的错误感到好奇。他们的意思是什么? 啊,如果有帮助,我可以再贴一些代码
【问题讨论】:
-
堆栈跟踪通常包含行号;有没有安装调试播放器?
-
绝对比我在下面的回答中建议的“跟踪”kludge 更可取 =)
标签: apache-flex actionscript-3 facebook