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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:44:50+00:00 2026-05-14T21:44:50+00:00

I’ve used the graphics package before, but not sure if this can be done.

  • 0

I’ve used the graphics package before, but not sure if this can be done. I’m trying to create a dog ear effect programmatically with flex. Can it be done? If not possible, what other options or libraries do I have.

  • 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-14T21:44:50+00:00Added an answer on May 14, 2026 at 9:44 pm

    You can get away with the undocumented drawRoundRectComplex() for a trendy rounded corners version:

    graphics.drawRoundRectComplex(x, y, width, height, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
    

    It’s the actionscript version of the Rectangle Primitive Tools from the Tools Panel.

    Surely you can get your head around the Graphics class, as @Robusto suggested.
    Meanwhile, here’s a simple 45 angled version:

    var dogEars:Sprite = getDogEars45(200,100,15,0x009900,0x007700);
    dogEars.x = dogEars.y = 50;
    addChild(dogEars);
    
    
    function getDogEars45(width:Number,height:Number,cornerSize:Number,baseFill:Number,highlightFill:Number):Sprite{
        var rect:Sprite = new Sprite();
        var base:Shape = new Shape();
        base.graphics.beginFill(baseFill);
        base.graphics.lineTo(width-cornerSize,0);
        base.graphics.lineTo(width,cornerSize);
        base.graphics.lineTo(width,height);
        base.graphics.lineTo(0,height);
        base.graphics.lineTo(0,0);
        rect.addChild(base);
        var corner:Shape = new Shape();
        corner.graphics.beginFill(highlightFill);
        corner.graphics.lineTo(cornerSize,cornerSize);
        corner.graphics.lineTo(0,cornerSize);
        corner.graphics.lineTo(0,0);
        corner.graphics.endFill();
        rect.addChild(corner);
        corner.x = width-cornerSize;
        return rect;
    }
    

    Here’s how the rough(45 angled) version should look like:

    dog ears

    Update:
    Had a few minutes to play with this, here is some code for rounded versions, for documenting:

    var dogEarsRounded:Sprite = getFlippedCornerRect(200,150,25,0x009900,0x00CC00);
    dogEarsRounded.x = dogEarsRounded.y = 150;
    addChild(dogEarsRounded);
    
    var dogEarsRounded2:Sprite = getFlippedCornerRoundedRect(200,150,15,35,0x990000,0xCC0000);
    dogEarsRounded2.x = dogEarsRounded2.y = 200;
    addChild(dogEarsRounded2);
    
    var dropShadow:DropShadowFilter = new DropShadowFilter(2,30,0,.5,2,2);
    dogEarsRounded.filters = dogEarsRounded2.filters = [dropShadow];
    
    function getFlippedCornerRect(width:Number,height:Number,cornerSize:Number,mainFill:int,cornerFill:int):Sprite{
        var result:Sprite = new Sprite();
        var topRight:Shape = new Shape();
        topRight.graphics.beginFill(mainFill);
        topRight.graphics.lineTo(width-cornerSize,0);
        topRight.graphics.lineTo(width,cornerSize);
        topRight.graphics.lineTo(width,height);
        topRight.graphics.lineTo(0,height);
        topRight.graphics.lineTo(0,0);
        topRight.graphics.endFill();
        result.addChild(topRight);
        var corner:Shape = new Shape();
        corner.graphics.beginFill(cornerFill);
        corner.graphics.curveTo(0,cornerSize,cornerSize,cornerSize);
        corner.graphics.lineTo(0,0);
        corner.graphics.endFill();
        result.addChild(corner);
        corner.x = width-cornerSize;
        return result;
    }
    
    function getFlippedCornerRoundedRect(width:Number,height:Number,rectRadius:Number,cornerSize:Number,mainFill:int,cornerFill:int):Sprite{
        var result:Sprite = new Sprite();
        var topRight:Shape = new Shape();
        var hw:Number = width * .5;
        var hh:Number = height* .5;
        topRight.graphics.beginFill(mainFill);
        topRight.graphics.lineTo(hw-cornerSize,0);
        topRight.graphics.lineTo(hw,cornerSize);
        topRight.graphics.lineTo(hw,hw);
        topRight.graphics.lineTo(0,hw);
        topRight.graphics.lineTo(0,0);
        topRight.graphics.endFill();
        topRight.x = hw;
        result.addChild(topRight);
        var corner:Shape = new Shape();
        corner.graphics.beginFill(cornerFill);
        corner.graphics.curveTo(0,cornerSize,cornerSize,cornerSize);
        corner.graphics.lineTo(0,0);
        corner.graphics.endFill();
        result.addChild(corner);
        corner.x = width-cornerSize;
        var topLeft:Shape = new Shape();
        topLeft.graphics.beginFill(mainFill);
        topLeft.graphics.drawRoundRectComplex(0, 0, hw, hh, rectRadius, 0,0,0);
        topLeft.graphics.endFill();
        result.addChild(topLeft);
        var bottomLeft:Shape = new Shape();
        bottomLeft.graphics.beginFill(mainFill);
        bottomLeft.graphics.drawRoundRectComplex(0, 0, hw, hh, 0, 0,rectRadius,0);
        bottomLeft.graphics.endFill();
        bottomLeft.y = hh;
        result.addChild(bottomLeft);
        var bottomRight:Shape = new Shape();
        bottomRight.graphics.beginFill(mainFill);
        bottomRight.graphics.drawRoundRectComplex(0, 0, hw, hh, 0, 0,0,rectRadius);
        bottomRight.graphics.endFill();
        bottomRight.x = hw;
        bottomRight.y = hh;
        result.addChild(bottomRight);
        return result;
    }
    

    With a soft drop shadow, looks ok:

    dog ears rounded

    You can fill the corner with a nice linear gradient, you can modify the function so you can choose which corners are rounded, and which aren’t, discretely animate it, etc. Have fun!

    I understand dog ears now, just wondering what ever happened to folded corner 😛

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

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I used javascript for loading a picture on my website depending on which small
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have some data like this: 1 2 3 4 5 9 2 6
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put

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.