Skip to main content
Known Participant
May 14, 2012
Question

iphone vector as bitmap

  • May 14, 2012
  • 4 replies
  • 785 views

Hello!

I am trying to adapt a flash game developed for the browser to the iphone.

The game is similar to the old windows game where you have a pannel whith hundreds of cells and you have to dicover where are the bombs without activate it.

I had a big amount of vectors that represent each cell in the game, the problems comes when I try tu run it in the iphone, is to slow, imposible to reder all the cells.

I tried using cacheAsBitmap, cacheAsBitmapMatrix but doesn´t work.

Someone could give me a clue and put me on the right way to run it on the iphone.

I am working with flash CS5.5

Thanks a lot

This topic has been closed for replies.

4 replies

Colin Holgate
Inspiring
May 14, 2012

Make sure to try Direct as your renderMode, and don't do any cacheasbitmap or cachseasbitmapmatrix.

Vie BoneAuthor
Known Participant
May 14, 2012

Yes, thanks!

It works much better.

But it carry on working a bit slowly and you have to click more than one to trigger the click event.

I found a code that draws a grid and work very smoothly. The problem is that I have to do each cell interactive, to hide it, or to color it. This is the code:

var bmpd:BitmapData = new BitmapData(2, 2, false, 0x000000);

// Create a rectangle, 1x1 pixels

var rect:Rectangle = new Rectangle(0, 0, 1, 1);

// Place the rectangle inside the bitmap data object

// Give it a color... Black.

bmpd.fillRect(rect,0xFF0000);

var mc:MovieClip = new MovieClip();

// Create a new bitmap fill based on the bitmap data object

// And allow it to repeat

mc.graphics.beginBitmapFill(bmpd, null, true);

mc.graphics.drawRect(0, 0, 320, 480);

mc.graphics.endFill();

Do you think is a better way? How can i make each cell interactive?

Apologies for my english and thanks so much

Colin Holgate
Inspiring
May 14, 2012

Why are you using a different technique, instead of just taking the web version and using it exactly as it was?