2

Before there was Stage 3D, I could simply capture the output of flash rendering engine with an in-place site and use it as a texture. But now, there is the Stage 3D which seems can't be rendered windowless...

Is there a way to capture the output of a the flash control running in direct mode? Or is there a way to let them render to a supplied surface?

BlueWanderer
  • 2,671
  • 2
  • 21
  • 36

1 Answers1

0

You can capture Stage3D buffer into BitmapData

Try method Context3D.drawToBitmapData()

    var renderedBitmapData:BitmapData = new BitmapData(viewWidth, viewHeight, true);
    renderContext.drawToBitmapData(renderedBitmapData);

    renderContext.present();

    //Add to stage
    bitmap = new Bitmap(renderedBitmapData);
    this.addChild(bitmap);
mizi_sk
  • 1,007
  • 7
  • 33
  • And how should I send the bitmap to the native host? – BlueWanderer Jun 03 '12 at 11:26
  • @BlueWanderer you have a native app with Flash plugin running inside rendering something and you want it displayed in the app, not in the plugin? – mizi_sk Jun 03 '12 at 11:28
  • right. I want to use the content of flash movieclip as animated texture. And it's easy without stage3d. Actually I've already given it up. Stage3d is not that useful for me here. – BlueWanderer Jun 03 '12 at 11:32
  • @BlueWanderer that you would need to convert movie clip into spritesheet texture, upload to Context3D, render, download the BitmapData... that is not the way to render flash MovieClip into bitmap :) – mizi_sk Jun 03 '12 at 11:37
  • @BlueWanderer maybe you should ask what you need to do, why exactly you wanted Stage3D inside you app – mizi_sk Jun 03 '12 at 11:38
  • My application can use movieclips as textures, but if a movieclip uses stage3d, it won't work. And I end up told the users never use stage3d with my application. lol – BlueWanderer Jun 03 '12 at 11:41