Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strike>As far as my knowledge goes there is no remote debugging with AIR and iOS possible. So you have to revert to creating a scrolling text field somewhere and show log/debug texts there.</strike></p> <p>Edit: See <a href="https://stackoverflow.com/questions/6930978/debugging-ios-air-content-on-the-device">Debugging iOS/AIR content on the device</a>.</p> <p>Edit2: Short tutorial video on debugging on iOS via Flash Prof CS5.5: <a href="http://www.youtube.com/watch?v=DanNBN89uhs" rel="nofollow noreferrer">http://www.youtube.com/watch?v=DanNBN89uhs</a></p> <p>You can use the uncaughtErrorEvents property (found in your main documents loaderInfo property) to catch any unhandled error and show it also in the text field (see <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/LoaderInfo.html#uncaughtErrorEvents" rel="nofollow noreferrer">http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/LoaderInfo.html#uncaughtErrorEvents</a>)</p> <p>There is also the possibility to define compiler constants to enclose debug log statements within actionscript so you can easily turn them on and off.</p> <p>I normally also test first the application on my windows before creating an iPad version of it. </p> <p>Final tip: remember that only your main swf can contain actionscript.</p> <p>Edit: </p> <p>Here is a example, try to add this code before any other actionscript is executed:</p> <pre><code>import flash.events.UncaughtErrorEvent; import flash.events.Event; import flash.text.TextField; import flash.text.TextFormat; import flash.text.TextFieldType; // ... // textLog contains errors var textLog: TextField; // make sure there is a uncaughtErrorEvents property (in case of older player) if (this.loaderInfo.hasOwnProperty('uncaughtErrorEvents')) { // listen for uncaught error events this.loaderInfo['uncaughtErrorEvents'].addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, handleUncaughtError); // make sure text field stays on top this.addEventListener(Event.ENTER_FRAME, handleEnterFrame); // create TextField at bottom using 1/5th of stage height textLog = new TextField(); textLog.width = this.stage.stageWidth; textLog.height = Math.floor(0.20 * this.stage.stageHeight); textLog.y = this.stage.stageHeight - textLog.height; textLog.multiline = true; textLog.wordWrap = true; textLog.defaultTextFormat = new TextFormat('_sans', 10); textLog.type = TextFieldType.DYNAMIC; textLog.background = true; textLog.backgroundColor = 0xCCCCCC; this.addChild(textLog); textLog.appendText('Catching errors\n'); } // show error and scroll to bottom line function handleUncaughtError(anEvent: UncaughtErrorEvent): void { textLog.appendText(anEvent.error + '\n'); textLog.scrollV = textLog.maxScrollV; } // make sure textLog stays on top of all other children function handleEnterFrame(anEvent: Event): void { if (this.getChildIndex(this.textLog) != this.numChildren - 1) { this.addChild(this.textLog); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload