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

  • Home
  • SEARCH
  • 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 6758167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:44:48+00:00 2026-05-26T13:44:48+00:00

I am dynamically creating a canvas, and I need a background image within the

  • 0

I am dynamically creating a canvas, and I need a background image within the canvas. The canvas is created as it accepts drag drop but the background image does not show up.

The trigger for the canvas is:

buttonNew.addEventListener("click",addCanvas);

The canvas code is:

private function addCanvas(oEvent:Event):void
            {
                caNew = new Canvas();
                caNew.id = "cart"
                caNew.name = "Shopping Cart";
                caNew.x = 100;
                caNew.y = 450;
                caNew.width = 200;                          
                caNew.height = 146;             
                caNew.setStyle("backgroundImage",cart_icon); 
                //caNew.setStyle("backgroundColor","#98AEEF");
                this.addChild(caNew);
                caNew.addEventListener(DragEvent.DRAG_ENTER, dragAcceptShop);
                caNew.addEventListener(DragEvent.DRAG_DROP, dragDropShop);

                laNew = new Label();
                laNew.id = "contain"
                laNew.text = "Shopping Cart";
                laNew.x = 100;
                laNew.y = 450;
                laNew.width = 120;                          
                laNew.height = 50;
                this.addChild(laNew);

            }

What am I doing wrong? As if I use backgroundImage it works fine and only the colour works.

  • 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-26T13:44:49+00:00Added an answer on May 26, 2026 at 1:44 pm

    You didn’t specify which version of the Flex SDK you were using, but backgroundImage is not an available style in the Spark theme. Spark is the default theme for Flex 4 (and later) projects. Check out all available sytles.

    One option is to add an Image component as the first child on the canvas.

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

Sidebar

Related Questions

Using DTS I'm dynamically creating an access database. After the file is created (which
i am dynamically creating radio using jquery as shown belown. but they value only
I am dynamically creating divs within a jquery accordion that are loaded with data
I am dynamically creating classes which contain spring beans, however the beans are not
I'm dynamically creating option elements for a drop down menu using Javascript and would
So I am dynamically creating an image and I wish to get the image
I am having dynamically creating remove label. All have same class but different Ids.
I am working on a Drag and Drop Editor that is creating items and
I am dynamically creating a table which places a dynamically created radiobuttonlist in each
I'm creating an drawing application with HTML5 canvas but is having problems with positioning.

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.