|
We have a deferred bug on this. I’ll
make sure management sees it again to re-triage and see how it goes in Flex 2. Matt From: Some more information on this issue and
possibly a bug or undocumented restriction in the Flash player… Investigating this further, I have traced
the source of my problem to inaccurate reporting of Image.percentLoaded. It appears
that images loaded from a remote server always report ‘0’ for
percentLoaded. The following example illustrates this issue: <?xml version="1.0"
encoding="utf-8"?> <mx:Application
xmlns:mx="http://www.macromedia.com/2003/mxml"> <mx:Script> var localPath =
"http://localhost:8080/images/sample.jpg"; var remotePath =
"http://192.168.1.115:8080/images/sample.jpg"; function
handleComplete(event) {
trace("loading complete: (" + event.target.percentLoaded + "%)
" + event.target.source); } </mx:Script> <mx:Image
id="localImage" source="{ localPath }" toolTip="{
localImage.source }"
complete="handleComplete(event)"/> <mx:Image
id="remoteImage" source="{ remotePath }" toolTip="{
remoteImage.source }"
complete="handleComplete(event)"/> </mx:Application> In the above example, localhost and
192.168.1.115 are my local machine. My debug log traces: loading complete: (100%)
http://localhost:8080/images/sample.jpg loading complete: (0%)
http://192.168.1.115:8080/images/sample.jpg It appears that you can not rely on
Image.percentLoaded in your Flex app if you are loading external images. Is
this a known issue? Google didn’t turn up anything obvious. Alon From: Has anyone learned any more about this
issue or come up with a solution? I am experiencing a very similar problem:
images loaded from another domain are generating Security Sandbox Violations of
the form: *** Security Sandbox Violation *** SecurityDomain 'http://host1/foo' tried to
access incompatible context
'http://host2/bar/thumbnail?width=40&height=52&id=pap' It does not appear to be the mere loading
of these images that causes this warning. It is applying effects and accessing
properties. This is true even if I wrap the Image in another component like a Canvas
that I then act on. Usually, the behavior of the app does not
work when this error is produced but sporadically, in the same application
instance with the same images, the behavior does work while still generating
these errors. Very puzzling. Alon From: Kristopher
Schultz [mailto:[EMAIL PROTECTED] I'm trying to load some images from a different domain than
the one my Flex app lives on. When I do, the debugger prints out a bunch of
errors like this: *** Security Sandbox Violation *** SecurityDomain 'http://myserver.com/index.mxml?debug=true'
tried to access incompatible context 'http://otherserver.com/someImage?wid=30' (Note, the image is dynamically generated and the URL
should not include ".jpg") Despite the errors, my images still seem to load in
successfully, both through the Flex Builder IDE and when viewed directly in IE.
Or so I thought. The weird thing I've discovered is that if my image paths
are brought into my Flex app via an XML file, then I do get the errors above,
but the images do load successfully. However, if my image paths come in as a
result of a remote object call, I get the same errors and my images DON'T load
successfully. I've double checked the exact path's that are being used in both
situations by tracing out the path immediately before it is used as the value
for the "source" property of the <mx:Image> tag and it is
EXACTLY the same in both cases. So I have questions. First, why do I get those error
messages? Secondly, if there really is a security sandbox violation, why do the
images load successfully under the conditions I mentioned above? And finally,
how do I prevent these violations from occurring in the first place? Thanks for any insight you can provide. Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123
|

