This is generally true, but given that loaderContext wont ever change
the issue is whether it gets initialized before or after the image tag
is instatiated. If it is intialized first then I would think you dont
need the bindable tag. But again, I am not sure, which is why I
caveated it.

Regards,
Hank

On 11/3/06, Agent RR-007 <[EMAIL PROTECTED]> wrote:
> I think that everytime you include the "{" and "}" it requires a
> [Bindable] keyword in the scripts to be linkable. Hope that I am right on
> this one.
>
> Always trust your Agent,
>
> RR-007
>
> On Fri, November 3, 2006 12:07 pm, hank williams said:
> > Yes,  I did find the solution.
> >
> > You need to define a loadercontext. Create a loader context variable in
> > you
> > script section.
> >
> >             [Bindable]
> >             private var loaderContext:LoaderContext;
> >
> > NOTE: I'm not sure that it needs to be bindable but thats what my code
> > has,
> > so to be safe I am showing it.
> >
> > Then, in some initialization code, initialize the variable
> >
> >            loaderContext = new LoaderContext(true);
> >
> > Finally, when loading the graphic into an <mx:image> object, you must
> > define
> > a loaderContext and use the loader context that you just created, as
> > below.
> >
> >
> >            <mx:Image  id="picture"
> >                   loaderContext="{loaderContext}"
> >                   verticalAlign="middle"
> >                   horizontalAlign="middle"
> >                   source="{picture_http}" width ="200" height="200">
> >            </mx:Image>
> >
> > Hope this helps.
> >
> > Regards,
> > Hank
> >
> > On 11/3/06, Andrew D. Goodfellow <[EMAIL PROTECTED]> wrote:
> >>
> >> I literally just hit this problem now too. Did you ever receive a
> >> solution
> >> Hank? Anyone else?
> >>
> >> -Andy
> >>
> >> On 9/26/06, hank williams < [EMAIL PROTECTED]> wrote:
> >>
> >> >   I have a flex screen that I want to capture into a bitmap using the
> >> > technique that Andrew Trice described earlier this week.
> >> >
> >> > it works as so:
> >> >
> >> > <codeExample1>
> >> >
> >> > private function
> >> > getUIComponentBitmapData(target:UIComponent):BitmapData{
> >> > var bd : BitmapData = new BitmapData( target.width, target.height );
> >> > var m : Matrix = new Matrix();
> >> > bd.draw(target,m);
> >> > return bd;
> >> > }
> >> > </codeExample1>
> >> >
> >> > I am feeding that function a UIComponent that contains an image that
> >> > looks like this:
> >> >
> >> > <codeExample2>
> >> >
> >> > <mx:Image id="picture"
> >> > verticalAlign="middle"
> >> > horizontalAlign="middle"
> >> > source="{model.picture_http}" width ="200" height="200"/>
> >> >
> >> > </codeExample2>
> >> >
> >> > The problem is that the model.picture_http is on another domain.
> >> > The error I get is as follows:
> >> >
> >> > <error>
> >> > SecurityError: Error #2122: Security sandbox violation:
> >> > BitmapData.draw:
> >> > http://localhost:8080/elroyServer/songmail/songmail-debug.swf cannot
> >> > access
> >> http://storage.elroynetworks.com/092233720368547758070000000044.
> >> > A policy file is required, but the checkPolicyFile flag was not set
> >> > when this media was loaded.
> >> > </error>
> >> >
> >> > This seems to suggest that I need a crossdomain.xml file, which is
> >> > fine. I have that, and I believe it is in the right place. The problem
> >> > is I am supposed to set a checkPolicyFile flag. The doc's explain how
> >> > to do this, but not in the context of Flex. The docs say:
> >> >
> >> > <docs>
> >> > When you load the image using the load() method of the Loader class,
> >> > you can specify a context parameter, which is a LoaderContext object.
> >> > If you set the checkPolicyFile property of the LoaderContext object to
> >> > true, Flash Player checks for a cross-domain policy file on the server
> >> > from which the image is loaded. If there is a cross-domain policy
> >> > file, and the file permits the domain of the loading SWF file, the
> >> > file is allowed to access data in the Bitmap object; otherwise, access
> >> > is denied.
> >> >
> >> > You can also specify a checkPolicyFile property in an image loaded via
> >> > an <img> tag in a text field. For details, see Loading SWF files and
> >> > images using the <img> tag in a text field.
> >> > </docs>
> >> >
> >> > I dont know how one would use the "load() " command from MXML.
> >> > Moreover, I would really like an MXMLish way to deal with cross domain
> >> > issues.
> >> >
> >> > Has anybody dealt with this?
> >> >
> >> > Hank
> >> >
> >>
> >>
> >>
> >
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to