我用它来显示callstack:
throw new Error("show me");但我想打印一个更长(更深)的堆栈,因为当前的堆栈没有显示我需要的内容。
发布于 2012-08-27 23:00:53
如果您在Error.getStackTrace()中看不到更多内容,可能是因为堆栈中没有更多内容。除了私有的内部播放器调用,比如Render等。
看看调用堆栈中最深的项,它可能是某种类型的事件处理程序。如果是这样,你就不能再深入挖掘了。
发布于 2012-08-27 21:58:33
您可以获取字符串形式的堆栈跟踪,并将其记录到文件中或在文本字段中显示。
var e:Error = new Error();
var trace:String = e.getStackTrace();
someTextField.text = trace;编辑:使用Flash Develop我抛出了一个错误,并且能够看到堆栈跟踪的17个以上的步骤:
Error
at Main/func14()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:100]
at Main/func13()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:93]
at Main/func12()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:88]
at Main/func11()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:83]
at Main/func10()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:78]
at Main/func9()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:73]
at Main/func8()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:68]
at Main/func7()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:63]
at Main/func6()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:58]
at Main/func5()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:53]
at Main/func4()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:49]
at Main/func3()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:44]
at Main/func2()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:39]
at Main/func1()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:34]
at Main/onCreationComplete()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:29]
at Main/___Main_Application1_creationComplete()[C:\Users\SGU\Desktop\barisu\misc\flex4test\src\Main.mxml:5]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
at mx.core::UIComponent/set initialized()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:1818]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:842]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]https://stackoverflow.com/questions/12143357
复制相似问题