2 Replies Latest reply on Mar 6, 2009 5:47 AM by JeffryHouser

    Add a Watermark

    Rico ledaouf Level 1

      I would like to create a watermark component in Flex, like those that we can see in commercial products (i.e. transparent letters with grey surroundings).

      How can I do this?

      I've already tried to add a scalable image over my application, but doing so prevents my below components to receive mouse events (mouse click for example). I tried to add a label in the middle of the application but the above proble!m still occurs plus I cannot make my label letters transparent and the label scaling is hard to do.

      Any help will be appreciated.

        • 1. Re: Add a Watermark
          robbyk87 Level 1
          Hey Rico - I know just the thing for ya,

          Basically just before your </mx:Application> (the last tag) add something like this:

          <mx:HBox height="100%" width="100%" backgroundAlpha="0.2" backgroundColor="0x000000" id="watermark" visible="true" mouseFocusEnabled="false" mouseEnabled="false" mouseChildren="false"horizontalAlign="center" verticalAlign="middle" horizontalCenter="0" verticalCenter="0">//this displays the watermark fullscreen - i.e covering everything but still lets the user click through it.
          <mx:Image source="{watermark}"/>//This is your image or swf or whatever

          Hope this helps!
          • 2. Re: Add a Watermark
            JeffryHouser Level 4

            You could try putting the watermark under everything, not over it. Most Flex Components are partially transparent so your watermark should show through.

            Robbyk87 introduced me to a few interesting properties in regards to mouseFocus. I'll have to check those out.