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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:38:29+00:00 2026-05-25T19:38:29+00:00

<?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 minWidth=640 minHeight=480> <s:layout> <s:BasicLayout/> </s:layout> <fx:Script> <![CDATA[

  • 0
<?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" minWidth="640" minHeight="480">
    <s:layout>
        <s:BasicLayout/>
    </s:layout>
    <fx:Script>
        <![CDATA[
            import flash.display.Shape;
            import flash.display.Sprite;

            import mx.core.UIComponent;

            import spark.core.SpriteVisualElement;
            private var rectangle:Sprite = new Sprite();
            private var insterter:UIComponent = new UIComponent();
            private var theme:SpriteVisualElement = new SpriteVisualElement();
            private function main():void
            {

                rectangle.graphics.lineStyle(1,0x0000FF,1.0);
                rectangle.graphics.drawRect(0,0,200,50);
                theme.addChild(rectangle);
                this.addElement(theme);  //tried canvas.addElement
                const WIDTH:int = 20;
                const HEIGHT:int = 20;

                /*var grid:Array = new Array();
                for(var y:int = 0; y < HEIGHT; y++) {
                    var row:Array = new Array();
                    for (var x:int = 0; x < WIDTH; x++) {
                        row.push(/*random object*//*);
                    }
                /   grid.push(row);
                            }*/

            }

        ]]>
    </fx:Script>
    <!--<spark:Canvas id="canvas" x="34" y="10" width="90%" height="90%" textAlign="center">

    </mx:Canvas>-->
</s:Application>

Basically this is not working. I used this question to improve – still nothing.
Why doesnt this Flex App draw a simple rectangle?

  • 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-25T19:38:29+00:00Added an answer on May 25, 2026 at 7:38 pm

    Why don’t you just use UIComponent.graphics drawing abilities, instead of creating three different objects ?

    var uic:UIComponent = new UIComponent();
    
    this.addElement(uic);
    
    uic.width = uic.height = 50;
    uic.graphics.lineStyle(1,0x000000);
    uic.graphics.drawRect(0,0,50,50);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<?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 width=1501 height=960 minWidth=955 minHeight=600> <fx:Declarations> <!-- Place
So I have such code for my application <?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
Here's what I have so far, <?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 minWidth=955
I have something like this: <?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 creationComplete=init()> <fx:Declarations>
Starting from a totally empty MXML application: <?xml version=1.0 encoding=utf-8?> <mx:Application xmlns:mx=http://www.adobe.com/2006/mxml layout=absolute >
Consider the following radio button example. <?xml version=1.0 encoding=utf-8?> <mx:Application xmlns:mx=http://www.adobe.com/2006/mxml> <mx:Script> <![CDATA[ private
this is the code, i am using flex builder 4.5, <?xml version=1.0 encoding=utf-8?> <s:Application
I created an App.config file in my WPF application: <?xml version="1.0" encoding="utf-8" ?> <configuration>
I got very basic question. Why this is not working?! <?xml version=1.0 encoding=utf-8?> <s:Application
I have an XML file that looks like <?xml version='1.0' encoding='UTF-8'?> <root> <node name=foo1

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.