Skip to main content
Lars Laborious
Legend
October 15, 2014
Answered

AIR 15 crash using readGraphicsData()

  • October 15, 2014
  • 1 reply
  • 748 views

Hi,

It seems like using the Graphics class's readGraphicsData() method, makes IOS apps built with AIR version 15.0.0.302 crash when testing on iPhone 5S, (I haven't tried this for Android). It works in earlier versions of AIR (at least 13 and 14).

Have any of you used this feature in you apps?

This topic has been closed for replies.
Correct answer Pravendra

I just made it work by not using the "Enable faster packaging" feature


We have actually fixed this issue and it would be available in next beta build.

Thanks

1 reply

Participating Frequently
October 15, 2014

We have tried to reproduce the issue using below code:

package

{

  import flash.display.GraphicsPathCommand;

  import flash.display.IGraphicsData;

  import flash.display.Shape;

  import flash.display.Sprite;

  import flash.events.MouseEvent;

  public class ReadGraphicsDataExample extends Sprite

  {

  private var original:Shape;

  private var copy:Shape;

  public function ReadGraphicsDataExample()

  {

  original = new Shape();

  original.x = 50;

  original.y = 100;

  addChild(original);

  drawSquare();

  copy = new Shape();

  copy.x = 250;

  copy.y = 100;

  addChild(copy);

  stage.addEventListener(MouseEvent.CLICK, drawCopyOnClick);

  }

  private function drawCopyOnClick(event:MouseEvent):void

  {

  copy.graphics.clear();

  var xPos:Number = original.x;

  var yPos:Number = original.y;

  original.x = 0;

  original.y = 0;

  var result:Vector.<IGraphicsData> = original.graphics.readGraphicsData(false);

  original.x = xPos;

  original.y = yPos;

   // re-draw

  copy.graphics.drawGraphicsData(result);

  }

  private function drawSquare():void

  {

  var squareCommands:Vector.<int> = new Vector.<int>(5, true);

  squareCommands[0] = GraphicsPathCommand.MOVE_TO;

  squareCommands[1] = GraphicsPathCommand.LINE_TO;

  squareCommands[2] = GraphicsPathCommand.LINE_TO;

  squareCommands[3] = GraphicsPathCommand.LINE_TO;

  var squareCoordinates:Vector.<Number> = new Vector.<Number>(8, true);

  squareCoordinates[0] = 0;

  squareCoordinates[1] = 0;

  squareCoordinates[2] = 50;

  squareCoordinates[3] = 0;

  squareCoordinates[4] = 50;

  squareCoordinates[5] = 50;

  squareCoordinates[6] = 0;

  squareCoordinates[7] = 50;

  original.graphics.beginFill(0x003366);

  original.graphics.drawPath(squareCommands, squareCoordinates);

  }

  }

}

When I click on square, it easily read data from graphics and produce the same square.

I am not able to reproduce the issue as no crash happen.

Could you please provide a sample app or code so that we can easily figure out the cause for same.

-Pravendra

Lars Laborious
Legend
October 15, 2014

I used the exact same example, but it crashes on my iphone 5 (I reported the wrong iPhone model earlier). I've tried both the GPU and CPU render mode, high and standard resolution, fullscreen and not.  AIR version 15.0.0.302.

Lars Laborious
Legend
October 15, 2014

And I use Flash Professional CC 2014 to export the ipa.