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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:58:57+00:00 2026-05-23T09:58:57+00:00

Maybe it is a bad habit which I still have since Flash Professional, but

  • 0

Maybe it is a bad habit which I still have since Flash Professional, but I’m trying to add a simple Sprite or/and Bitmap I just created to an empty Application and it’s not happening.

<?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" minHeight="600" 
               creationComplete="application1_creationCompleteHandler(event)">

    <fx:Script>
        <![CDATA[
            import mx.core.FlexGlobals;
            import mx.core.UIComponent;
            import mx.events.FlexEvent; 


            protected function application1_creationCompleteHandler( event : FlexEvent ) : void
            {
                var s:Sprite = new Sprite();
                s.graphics.beginFill( 0xFF0000, 0.5 );
                s.graphics.drawRect( 0, 0, 100, 100 );
                s.graphics.endFill();

                this.addChild( s );
            }

        ]]>
    </fx:Script>
</s:Application>

Could someone tell me what I am doing wrong and help me correct it?

  • 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-23T09:58:58+00:00Added an answer on May 23, 2026 at 9:58 am

    Try putting your sprite in UIComponent or SpriteVisualElement.
    This works for me:

    <?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" minHeight="600"
                   creationComplete="test()">
    
        <fx:Script>
            <![CDATA[
                import spark.core.SpriteVisualElement;
    
                private function test():void
                {
                    var sprCont:SpriteVisualElement = new SpriteVisualElement();
                    sprCont.horizontalCenter = 0;
                    sprCont.verticalCenter = 0;
    
                    var spr:Sprite = new Sprite();
                    spr.graphics.beginFill(0xFF0000);
                    spr.graphics.drawCircle(0,0, 100);
                    spr.graphics.endFill();
    
                    sprCont.addChild(spr);
                    addElement(sprCont);
                }
            ]]>
        </fx:Script>
    </s:Application>
    

    For some reasons the ‘s:Application’ tags are not shown, but they are there.
    HTH,
    FTQuest

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

Sidebar

Related Questions

I have tried to upload .png and .jpg but profile picture looks bad. Maybe
Maybe it's a bad idea, but I wrote a subclass for JMenuItem to add
Maybe I'm having a really bad day, but could someone possibly help me to
Can EF really be this bad? Maybe... Let's say I have a fully loaded,
Maybe this was a case of bad programming, but it is manifesting itself with
Ok maybe this is simple but... given this: arr = (a..z).to_a arr => [a,
maybe my google-fu is just letting me down today, but i have not been
Maybe this is a bad practice, but from the documentations that I read I
Maybe I've picked a totally inappropriate/bad example. What I have is a user control
Maybe a bad topic, but given the following code, do i need to free(player->name)

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.