Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8259173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:47:52+00:00 2026-06-08T02:47:52+00:00

Is there a way within Flex to draw an <s:Ellipse> and use it to

  • 0

Is there a way within Flex to draw an <s:Ellipse> and use it to mask an image? Here is an <s:Ellipse> that I have written:

<s:Ellipse id="imageFrame" width="150" height="150" rotation="325" top="50" left="50">
    <s:stroke>
        <s:LinearGradientStroke weight="5">
            <s:GradientEntry color="0x000000"/>
            <s:GradientEntry color="0xFFFFFF"/>
            <s:GradientEntry color="0x000000"/>
        </s:LinearGradientStroke>
    </s:stroke>
</s:Ellipse>

… that looks like this:

enter image description here

I would like to load an image using the <s:Image> component, place it inside of the ring, and mask the image so that only the hole in the center is displaying the image, much like a picture frame.

Can that be done, or is that not possible since the “hole” in the center of the ellipse is just invisible fill?

Thank you for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:47:53+00:00Added an answer on June 8, 2026 at 2:47 am

    One approach would be to mask an image by drawing a circle on the graphics of a SpriteVisualElement display object.

    mask

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   backgroundColor="0x0">
    
        <fx:Script>
            <![CDATA[
                override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                {
                    super.updateDisplayList(unscaledWidth, unscaledHeight);
    
                    var g:Graphics = imageMask.graphics;
                    g.clear();
                    g.beginFill(0xff);
                    g.drawEllipse(50, 50, 150, 150);
                    g.endFill();
                }
            ]]>
        </fx:Script>
    
        <s:Image id="image"
                 mask="{imageMask}"
                 source="http://www.artyfactory.com/art_appreciation/art_movements/art%20movements/cubism/still_life_with_mandolin.jpg" />
    
        <s:SpriteVisualElement id="imageMask" />
    
        <s:Ellipse id="imageFrame"
                   width="150"
                   height="150"
                   rotation="325"
                   top="50"
                   left="50">
            <s:stroke>
                <s:LinearGradientStroke weight="5">
                    <s:GradientEntry color="0x000000" />
                    <s:GradientEntry color="0xFFFFFF" />
                    <s:GradientEntry color="0x000000" />
                </s:LinearGradientStroke>
            </s:stroke>
        </s:Ellipse>
    
    </s:Application>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way within Flex 4 to design a skin such that it
Is there a way to uncheck/check a checkbox within a webpage that is loaded
Is there a way to call functions within a class upon instantiation of that
Is there a way within Flex Mobile 4.6 to access the main application from
Is there a way within a Flex Mobile application to listen for events with
Is there a way within ActionScript 3.0 to: Get all URLRequests() that are made
is there any way to catch any error within Flex application and send it
Is there any way within Visual Studio 2010 to have different windows and panes
is there an easy way within TextMate that I can select a string, hit
Is there any way within the iOS SDK for an app to delete itself?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.