Amy and Alex, Thanks very much for your suggestions. What I did to fix it is:
In the routine to create the "snapshot": 1) remove the BG image 2) load the background image source into an image control using the loader context 3) put the loader context image control at child position 0 4) take the snapshot 5) remove the loader context image 6) restore the BG image Thanks again, Rich On Sat, Mar 14, 2009 at 1:22 AM, Alex Harui <[email protected]> wrote: > One possibility would be to subclass flash.display.Loader and supply > that as the backgroundImage “class” then have it load the image with a > custom URL > > > > Alex Harui > > Flex SDK Developer > > Adobe Systems Inc. <http://www.adobe.com/> > > Blog: http://blogs.adobe.com/aharui > > > > *From:* [email protected] [mailto:[email protected]] *On > Behalf Of *rdibona > *Sent:* Friday, March 13, 2009 3:44 PM > *To:* [email protected] > *Subject:* [flexcoders] Re: canvas backgroundimage loadercontext > > > > Thanks for the reply. > > Assuming that I am willing to take the risk of the server going down (the > images are stored on Amazon S3 so they are pretty safe), how can I have a > backgroundimage check the policy file, using LoaderContext or otherwise? > > This is an app that has been working great for over 2 years and only with > one of the latest releases of flash did this break so I am scrambling to try > and fix it. The reason I can't really do it as an image with a child index > of 0 is because the user can click things and drag them around and I don't > want them to accidentally drag the background image -- I'd have to write a > bunch of code to work through that scenario so I'd like to exhaust all other > options first. > > Thanks again, > > Rich > > --- In [email protected] <flexcoders%40yahoogroups.com>, Alex > Harui <aha...@...> wrote: > > > > I'd avoid loading foreign content as the backgroundImage. If that server > goes down, your app will look very different. > > If you really want to, then it might be easier to put an Image behind all > of the other children and not use backgroundImage > > > > Alex Harui > > Flex SDK Developer > > Adobe Systems Inc.<http://www.adobe.com/> > > Blog: http://blogs.adobe.com/aharui > > > > From: [email protected] <flexcoders%40yahoogroups.com> [mailto: > [email protected] <flexcoders%40yahoogroups.com>] On Behalf Of > rdibona > > Sent: Friday, March 13, 2009 11:15 AM > > To: [email protected] <flexcoders%40yahoogroups.com> > > Subject: [flexcoders] canvas backgroundimage loadercontext > > > > > > Hi there, > > > > I have an application where I take a "snapshot" of a Canvas with various > other images on it using the bitmapdata.draw method. I had to change my code > to use a LoaderContext for each image load to avoid security errors, i.e.: > > > > var lc : LoaderContext; > > var img : Image; > > > > img = new Image(); > > lc = new LoaderContext(true); > > img.loaderContext = lc; > > img.load(src); > > > > This has worked fine. However, I cannot figure out how to avoid a > security error when setting the backgroundImage style for a canvas, as it > expects a URL directly with no opportunity to specify another image as the > value. It does say you can specify a class, but how do you cast an image > into a compatible class? The images I am dealing with are dynamically loaded > at run-time so there is no opportunity to use the Embed directive. > > > > Thanks, > > > > Rich > > > > >

