Loading ...
Sorry, an error occurred while loading the content.

Re: Chart Bug? Setting a backgroundElement bitmap at runtime

Expand Messages
  • EddieBerman
    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
    Message 1 of 2 , Jan 31, 2008
    • 0 Attachment
      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, "EddieBerman"
      <eddieberman2000@...> 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
      >
    • Sunil Bannur
      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
      Message 2 of 2 , Feb 1, 2008
      • 0 Attachment
        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:flexcoders@yahoogroups.com] 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@yahoogro ups.com, "EddieBerman"
        <eddieberman2000@ ...> 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:backgroundElemen ts 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
        >

      Your message has been successfully submitted and would be delivered to recipients shortly.