This content has been marked as final. Show 12 replies
If you have transparency set to true in the xml descriptor file, try setting it to false. Let us know if that fixes it. It does in my case with flash 9 content.
With older flash and transparency set to true, you will perhaps hear the flash (and get a right-click flashplayer dialog), but not see any flash display.
And yes, apparently this bug made it into 1.0 (unconfirmed).
There are some limitations in 1.0 on the display of both SWF and PDF in HTML. See, for example, http://livedocs.adobe.com/air/1/devappsflash/help.html?content=ScriptingHTMLContainer_2.ht ml#1058666. Look for the heading "Considerations when loading SWF or PDF content in an HTML page".
Oliver Goldman | Adobe AIR Engineering
...heading "Considerations when loading SWF or PDF content in an HTML page".
Where we read:
Note: The runtime cannot display SWF or PDF content in transparent windows.
Man, that bites. Transparent windows frees us to create custom chrome. What do I have to do to put this on top of the priority list? What are the odds of having this significant limitation removed in a (near) future release?
Submit your use cases for this feature at www.adobe.com/go/wish.
Oliver Goldman | Adobe AIR Engineering
Thank you, Oliver.
I filed a feature request. Seeing that it is in the doc's, I didn't think it would qualify as a bug...
I have also submitted the above as a feature request. Although I really consider this a bug since it places an artificial constraint on application development and harms Adobe in the long run by discouraging FLASH use in HTML based AIR applications.
I have tried to work around this limitation by creating a floating window to overlay over my transparent window in which to host my FLASH applet.
But I have found no way to parent the floating window's NativeWindow to my transparent window ensuring the relationship between the 2 windows remains constant with respect to z-order and position.
I can get close by setting the floating window to 'alwaysInFront' and then listening to events from the transparent window in order to show/hide/move the floating window when needed but the illusion is not good enough.
You don't need to create a separate window. You can add the flash content as a peer of the HTMLLoader component that displays the HTML.To do this, load the SWF file using the Loader component, then use window.nativeWindow.stage.addChild(theLoader) to display the SWF over the HTML. (The HTMLLoader, which is added to the native window automatically in an HTML-based application, is just another Flash display object.)
Thanks Admiral Brodnack!
I could have sworn that I tried this approach previously, but I tried it again and voila, it worked!
Here is a code snippet for anyone else that may be interested:
var swfLoader = new air.Loader();
I found this thread in the archives & rather than starting a new topic on this, I hope people reading/following this thread could chime in...
I have a html/js application that uses transparent windows, and have added a swf to the nativeWindow stage via the method that anemitoff12 posted above & positioned the swf to where I want it to appear in the AIR window. That said, I can see elements of the swf appearing outside of the SWFs stage -- I assume it's expanding to the stage size of the AIR stage (which is larger than the swf itself to account for the chrome & other elements)?
Is there a way to constrain the SWF that I've added to the nativeWindow stage to stay within a certain xy size (basically what you get when you specify the height/width attribute of the HTML embed tag within the context of a web page)?
I believe that to constrain the loaded SWF into a particular region of the window stage you can either create a clipping mask (see the mask property in http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/?flash/display/DisplayObject.htm l), or scale the content using the scaleX and scaleY properties.
I'm finding that in AIR 1.5 we still cannot display swf content embedded in html in transparent windows...I've filed it as a bug this time around, hoping that in doing so it may surface higher up than feature requests.
I would really, really like to see this significant limitation disappear in the near future.
Ok, just asked the same question again... why transparency and HTMLLoader don't work together...
the reason I love HTMLLoader is that it gives you extra security as opposed to addChild(swf), because if swf has Flash components, it tries to access the stage and a security exception occurs.
It would really help if Adobe resolved this issue.