开发者

How do I put things above an mx:HTML element?

How do I put things above an mx:HTML element? No matter where I place the code it's always under the <mx:HTML> element. Can this even be done?

Example:

<mx:Canvas x="50" y="50" width="50" height="50" backgroundColor="#ff0099"/>
<mx:Label x="150" y="50" color="#ffffff" text="CAN YOU SEE ME?"/>    
<mx:HTML x="0" y="0" width="500" height="500" location="http://www.google.com/"/>
<mx:Canvas x="50" y="50" width="50" height="50"开发者_开发百科 backgroundColor="#ff0099"/>
<mx:Label x="150" y="50" color="#ffffff" text="CAN YOU SEE ME?"/>


Above works perfectly fine. In AbsoluteLayout, things are added in order and hence first and second item are hidden behind the bigger HTML. But the Canvas and Label afterwards are very much visible on top of HTML. Run and see it yourself with the below code sample (mostly yours):

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                       xmlns:s="library://ns.adobe.com/flex/spark" 
                       xmlns:mx="library://ns.adobe.com/flex/mx">
    <s:Panel>
        <mx:Canvas x="50" y="50" width="50" height="50" backgroundColor="#ff0099"/>
        <mx:Label x="150" y="50" color="#000000" text="CAN YOU SEE ME?"/>    
        <mx:HTML x="0" y="0" width="500" height="500" location="http://www.google.com/"/>
        <mx:Canvas x="50" y="50" width="50" height="50" backgroundColor="#ff0099"/>
        <mx:Label x="150" y="50" fontSize="32" color="#654321" text="CAN YOU SEE ME?"/>

    </s:Panel>
</s:WindowedApplication>


Normally the elements are rendered in the order they're added in the container. From my test, the canvas and label you have after the HTML element are displayed over it, but the text is displayed with white color (color="#ffffff"), so you won't see it because of that...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜