3 Replies Latest reply on Jun 18, 2012 1:18 PM by stu.pot

    Using Stage3D on Flash11 ActiveX ocx, running in a Direct3D app


      Hi, I have a Direct3D9 app that uses the Flash ActiveX control to render Flash .swf content.  This works for normal flash content but I can't get it working with Stage3D content.


      Does anyone know if this is possible?  Someone else is also trying the same here - http://forums.adobe.com/message/3981927#3981927


      Here's some more detail:

      - I am using flash11c.ocx (I have also tried the the beta Flash32_11_2_202_18.ocx)

      - The reference .swf I am using is from here (http://airtightinteractive.com/demos/flash/stage3d/cubes01/), I have tried several other swf's, still no result.

      - The reference .swf plays fine in the stand alone Flash Player11 (is this also called the Projector?), which must also be using the same ActiveX control.



      The problem is simply I get a black screen, with WMode set to 'direct', which is what everything I find says I must do.


      Interestingly, if I set WMode to 'gpu' I get a grey screen, but the little performace statistic graph gets partially drawn top-left (no data, just labels) and I can interact with it a little bit (dragging).


      If I set WMode to 'transparent' or 'opaque' or 'window' I get a black screen with a fully drawn graph, the data is plotting and the DRIV entry says n/a (no view), which sounds right.


      I suspect that there's some error occuring when Stage3d initialises it's Direct3D device (maybe because I'm also using a Direct3D device), are there any logs being produced that the FlashPlayer outputs?  Or how do I go about debugging the Stage3D?


      Or maybe there's some other parameters other than the WMode that must be set correctly for Stage3D to work.  Somehow the stand alone player is using the same component and working!

        • 1. Re: Using Stage3D on Flash11 ActiveX ocx, running in a Direct3D app
          Charbs09 Adobe Employee

          Hello stu,

          The standalone/projector player doesn't using the ActiveX plugin, it uses its own contained player runtime.  I think you are correct it sounds like an error is getting thrown upon context3D creation.  Make sure you add an Event.ERROR listener to the stage before requesting the context3d:

          stage.stage3Ds[0].addEventListener( ErrorEvent.ERROR, handleError );


          Also if you get that far it would you should turn on context3D.enableErrorChecking = true in case there are some other failures down the pipeline.  Unfortunately embedded ActiveX plugin in custom apps is not officially supported, but I'd like to help you with any debugging if I can.




          1 person found this helpful
          • 2. Re: Using Stage3D on Flash11 ActiveX ocx, running in a Direct3D app
            stu.pot Level 1

            Hi Charbs, thanks for the reply.


            I've done a bit more investigation, my application doesn't display any content if I set wmode to direct, even when I try and play a very simple .swf that in no way will be using stage3D.


            I'm now assuming that setting direct wmode forces the .ocx to attempt rendering using Direct3D regardless of whether I use any Stage3D or not.  It would be interesting to find out if it is possible to set wmode to direct, and disable any use of Direct3D, although I suspect that setting wmode to direct would at least use Direct3D as its viewport regardless of any type of display generated by the swf.


            I will investigate the Event.ERROR suggestion, but I'm not a Flash/AS programmer at all, I wouldn't know wher to start so this might take a while - unless any of you helpful souls might knock something up to output/log any error messages from a simple stage3d swf?


            Also, I suspect that how I currently capture the display output and then transfer that to my own Direct3d texture/surface might not be compatible with how direct mode works.  Is there any in depth  technical documentation for how the ocx or projector handle direct wmode?

            • 3. Re: Using Stage3D on Flash11 ActiveX ocx, running in a Direct3D app
              stu.pot Level 1

              I had a quick poke at this again recently, I now think the problem is because I was using a windowless ocx container, and the 'direct' wmode doesn't like that.  I tried a simple windowed ATL example and it successfully handled the stage3D .swf.  I also had a look at the NSAPI approach, which I hadn't come across before, which opens up possibilities in more ways than one.


              When I get a chance I'll rewrite my non ATL code... I'll report back... maybe this year!