SWFLoader 的透明背景
我在 SWF 中创建了一个“正在加载”微调器。 我使用 SWFLoader 在我的主应用程序 SWF 中显示此微调器。 如何使 SWFLoader 透明? 目前,即使我设置了 backgroundAlpha="0"
,它也使用 Flex 的默认背景颜色。
我的微调器 SWF 的主 MXML:(请注意 backgroundAlpha
的使用)
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:Controls="Controls.*" width="30" height="30" backgroundAlpha="0">
<Controls:Spinner id="ctrlSpinner" /> <!-- spinner logic encapsulated in a component -->
</mx:Application>
我的应用程序 SWF 的主 MXML:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" height="801">
<mx:SWFLoader x="10" y="173" id="swfSpinner" autoLoad="true" scaleContent="true" >
<mx:source>SWFs/LoadingSpinnerApp.swf</mx:source>
</mx:SWFLoader>
</mx:Application>
请注意,微调器控件本身是透明的。 SWFLoader 的一些问题导致它忽略我的 backgroundAlpha 设置。 有任何想法吗?
I created a "Loading" spinner in a SWF. I display this spinner in my main application SWF using SWFLoader. How do I make the SWFLoader transparent? Currently it uses Flex's default background color even though I've set backgroundAlpha="0"
.
My spinner SWF's main MXML: (Note the use of backgroundAlpha
)
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:Controls="Controls.*" width="30" height="30" backgroundAlpha="0">
<Controls:Spinner id="ctrlSpinner" /> <!-- spinner logic encapsulated in a component -->
</mx:Application>
My application SWF's main MXML:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" height="801">
<mx:SWFLoader x="10" y="173" id="swfSpinner" autoLoad="true" scaleContent="true" >
<mx:source>SWFs/LoadingSpinnerApp.swf</mx:source>
</mx:SWFLoader>
</mx:Application>
Note that the Spinner control itself is transparent. There's just something about the SWFLoader that causes it to ignore my backgroundAlpha setting. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为你的问题出在 Spinner 组件中,你必须在其中设置背景颜色或 alpha,这会导致你的加载程序具有背景颜色。 如果你没有设置它,那么设置它,因为它可能默认为 1 的 alpha。当我执行以下操作时,我没有得到任何背景,但当我将 alpha 更改为 1 时,会出现黑色背景。
和
I think your problem is within the Spinner component you must be setting the background color or alpha in there and that's causing your loader to have a background color. if you not setting it then set it because it probably defaults to an alpha of 1. when I do the following I don't get any background but when I change the alpha to 1 the black background appears.
and
事实证明,我做的是正确的事情 - Flex 只是没有将我的微调器 SWF 的最新版本复制到我的主应用程序的垃圾箱中。 相反,它一直保留在我添加透明度之前构建的先前版本。
我手动将新的微调器 SWF 复制到主应用程序的 bin,然后它就工作了!
It turns out that I was doing the correct thing -- Flex just wasn't copying the latest version of my spinner SWF to the bin of my main app. Instead it had been holding on to a previous version built before I added the transparency.
I manually copied the new spinner SWF to the main app's bin and then it worked!