Not sure, whether you are setting the width and height of the image you
are loading dynamically.
Also pushing it in to the backgroundelements array would not work, it
should be assigned like this
 
chart.backgroundelements = AnArray;
 
Thanks
-Sunil

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of EddieBerman
Sent: Friday, February 01, 2008 9:12 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Chart Bug? Setting a backgroundElement bitmap
at runtime



Let me just clarify the specific bit of code that I assumed would 
work, but isn't. At runtime, way after creationComplete(), I create 
an mx:Image object, load a .jpg into it from my local file system, 
and then push it onto the backgroundElements array. I've also tried 
simply setting it as the sole member of that backgroundElements 
array. The only thing I know for certain is that when I test the .jpg 
loading by adding that mx:Image to the canvas, it displays correctly. 

Since I'm not having success, I'm wondering if this is a chart bug. 
Or - if there's another (or rather, a correct) way to accomplish this 
goal. I couldn't find any mention of this method in the Flex LiveDocs.

Thanks again.

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "EddieBerman" 
<[EMAIL PROTECTED]> wrote:
>
> Flex 3 newbie here with a problem I can't seem to solve by myself. 
> 
> I've been unable to set a backgroundElement bitmap with an image 
> loaded at runtime. 
> 
> I can accomplish it without problem using either:
> 
> 1) an mx:Image with a predefined @Embed source property within 
> mx:backgroundElements tags (as is well documented)
> 
> and/or
> 
> 2) AS3 code to explicitly push an Embed'd image (also well 
> documented).
> 
> But - I can't seem to set an image that I load at runtime. I load 
the 
> image and (to test it) display it in an mx:Image object that I 
create 
> at the same time. Then, either I don't know exactly what type of 
> object to push into the backgroundElements array, or Flex doesn't 
> support this. I've tried using bitmaps, images, etc, but nothing 
> seems to work. I also can't find any documentation for this method.
> 
> Can anyone point me to either a reference, or suggest a way to 
> accomplish this? 
> Much appreciated.
> -Eddie
>



 

Reply via email to