Skip to main content
abdulqadir7
Participant
March 14, 2018
Answered

Loading an External SWF File with Stage 3D in an AIR Application

  • March 14, 2018
  • 1 reply
  • 543 views

Hi,

I have been trying to create an Adobe Air application which can download a SWF file and run it. This SWF file uses Stage 3D rendering.

I am able to load an external SWF file through an object of Loader Class, but only the Display Object elements from the SWF show up in the AIR App (Eg: Text, buttons etc) and not the 3D objects.

To check if there is an issue with the 3D Rendering, i ran scout on the app with Telemetry and Stage3D recording enabled. On Scout, the Stage 3D rendering tab does display the 3D objects. I assume this means the 3D Rendering does work but for some reason the correct stage is not being passed to the containing AIR Application.

I have tried going through posts and have defined right app flags. Eg: renderMode is set to direct, depthAndStencil is set to enabled etc. Morever i do not get any errors related to Stage3D classes.

What is it that i might be doing wrong? And is what i am trying to do even possible?

This topic has been closed for replies.
Correct answer abdulqadir7

Is there a chance that your Air container application renders something on the background? Keep in mind that Stage3D content is always on the lowest level. That means you add the loaded swf as a child of the Air application, but Stage3D content of the child would still render *behind* the Air application. So if it has a background, Stage3D would not be visible. Other than that it should be straight forward. We do the same thing in our air apps as well and Stage3D content renders without problems in the loaded swfs.


I was trying somethings out with various background properties and looks like setting:

backgroundAlpha="0.0" as a WindowedApplication parameter or calling this.setStyle("backgroundAlpha","0.0") in the onApplicationStarted() method removes the white background and lets the 3D rendering to show up.

Marking the issue to answered now

1 reply

natural_criticB837
Legend
March 14, 2018

In your application.xml you might need to set:

<renderMode>direct</renderMode>

and, if you require the feature:

<depthAndStencil>true</depthAndStencil>

Here is the documentation:

Adobe AIR * Common settings

abdulqadir7
Participant
March 14, 2018

Hi!

Thanks for the response. I have already done that configuration in my application xml.
I get no errors related to Stage3D / Context3D. And on Adobe Scout, the Stage3D rendering tool does pick up the 3D rendering, but the AIR container appears blank.

natural_criticB837
Legend
March 14, 2018

Is there a chance that your Air container application renders something on the background? Keep in mind that Stage3D content is always on the lowest level. That means you add the loaded swf as a child of the Air application, but Stage3D content of the child would still render *behind* the Air application. So if it has a background, Stage3D would not be visible. Other than that it should be straight forward. We do the same thing in our air apps as well and Stage3D content renders without problems in the loaded swfs.