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 6554289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:40:56+00:00 2026-05-25T12:40:56+00:00

I am searching for a way to have my spritevisualelement have round corners so

  • 0

I am searching for a way to have my spritevisualelement have round corners so that it is displayed in a circular shape.

The SpriteVisualElement contains a Video Stream from FMS to display but I do not want it to be rectangular.

Somebody got a hint for me?

<s:BorderContainer
          borderColor="0x000000"
          borderAlpha="50"
          cornerRadius="150"
          borderWeight="3"
          x="161"
          y="10"
          >
<s:SpriteVisualElement id="vid" width="480" height="320"/>
          </s:BorderContainer>
<s:SpriteVisualElement id="vid_self_preview" x="710" y="373" width="90" height="60"/>

But the Container keeps being in the background and the whole remote Video which is displayed in the “vid” (=id) is in the foreground.
How can I set the Container to be in Foreground? then just setting whole application background would do the job.

  • 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-05-25T12:40:56+00:00Added an answer on May 25, 2026 at 12:40 pm

    Sounds like a perfect use case for an Alpha Mask.

    Try this:

    import spark.core.MaskType;
    
    private function addMask():void {
      var vidMask:SpriteVisualElement = new SpriteVisualElement();
    
      // first mask the entire thing transparent
      vidMask.graphics.beginFill(0x000000, 0);
      vidMask.graphics.drawRect(0,0,480,320);
      vidMask.graphics.endFill();
    
      // then draw the rounded rectangle (or whatever) that you want to show
      vidMask.graphics.beginFill(0x000000, 1); //color doesn't matter
      vidMask.graphics.drawRoundRect(0,0,480, 320, 200, 200); // choose 
      vidMask.graphics.endFill();
    
      addElement(vidMask); //the mask has to be on the Display List
      vid.mask = vidMask; // attach the mask to the sve
      vid.maskType = MaskType.ALPHA; // choose alpha masking
    }
    

    And in your MXML:

    <s:SpriteVisualElement id="vid" width="480" height="320" addedToStage="addMask()">
    

    UPDATE

    Actually, now that I thought about it some more, my initial answer is misleading. You really only need to have a Clipping Mask (not an Alpha one), since there is no gradation in the opacity. You can update the addMask function as follows:

    private function addMask():void {
          var vidMask:SpriteVisualElement = new SpriteVisualElement();
    
          // draw the rounded rectangle (or whatever) that you want to show
          vidMask.graphics.beginFill(0x000000, 1); //color doesn't matter
          vidMask.graphics.drawRoundRect(0,0,480, 320, 200, 200); // the last two effect the roundness
          vidMask.graphics.endFill();
    
          addElement(vidMask); //the mask has to be on the Display List
          vid.mask = vidMask; // attach the mask to the sve
          vid.maskType = MaskType.CLIP; // choose clip masking
        }
    

    Unless you do end up using a graded opacity in your mask, this method would be preferable, since it should simplify the compositing the player has to carry out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program that is searching a maze to find the best way
I have 200+ Google video codes and am searching for a way of collecting
I am searching for a way to have something like that : return HttpResponseForbiddenRedirect(reverse(view_name))
I have been searching for days for a way to always display just one
i am searching a way to get Numerical gradient from the matrix. The same
I'm searching for a way to extract all text elements from a matplotlibfigure including
I'm searching for a way to create a menu in an iPhone app that
i have some customers with a particular address that the user is searching for:
I have been searching for way to perform a linq query to get an
Im searching for a way to have 2 divs as columns where div on

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.