RE: [flexcoders] Security Sandbox Violation when loading image
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=40height=52id=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] Sent: Friday, March 25, 2005 10:42 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Security Sandbox Violation when loading image 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 www.resource.com -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] Security Sandbox Violation when loading image
Hi, It should work without having to convert into to the AS2 type class as you did. If you simply do: results[0].price results[1].price this should get you the price of the first product and seconds products. I assumed "results" is the name of the object that contains the results of the RO call. Jimmy Gianninas Software Developer - Optimal Payments Inc. From: Kristopher Schultz [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 12:49 PMTo: flexcoders@yahoogroups.comSubject: RE: [flexcoders] Security Sandbox Violation when loading image Well, I figured out why I was experiencing different behavior when pulling data in from an XML file vs. pulling it in via a remote object. My remote object method call was returning an Array of objects which on the Java side were instances of a simple data object class I had created called com.myclient.Product. These objects had three properties: label(String), imageId(String), and price(Double) which were accessible through appropriately named getter methods. When stepping through the debugger in Flex Builder, I could see these objects were coming through just fine with the appropriate property names and values, but when I tried to pass each object to my custom display component it was not displaying them, even when the same display component had no problem displaying similar data Objects if they were created in the AS code. So I went ahead and created an .as class called com.myclient.myapp.Product and associated it with the Java class using the following static variable invocation: static var regClass = Object.registerClass("com.myclient.Product", com.myclient.myapp.Product); After doing that, everything worked just fine. So my questions are, why did I have to create that ActionScript class to get things to work? Is there a way to pass back a generic AS Object from a remote object call? Would passing back objects of type java.util.Map be the answer? Which is the better practice, passing back a java.util.Map to be converted to an untyped Object or creating .as classes for each typed Object that can be retured from a remote object call. Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.com 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. Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] Security Sandbox Violation when loading image
You shouldnt have had to create an AS class, Im not sure why it wouldnt have worked. The regular object should have had the data you needed. Best practice is to create the class though. Matt From: Kristopher Schultz [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 9:49 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Security Sandbox Violation when loading image Well, I figured out why I was experiencing different behavior when pulling data in from an XML file vs. pulling it in via a remote object. My remote object method call was returning an Array of objects which on the Java side were instances of a simple data object class I had created called com.myclient.Product. These objects had three properties: label(String), imageId(String), and price(Double) which were accessible through appropriately named getter methods. When stepping through the debugger in Flex Builder, I could see these objects were coming through just fine with the appropriate property names and values, but when I tried to pass each object to my custom display component it was not displaying them, even when the same display component had no problem displaying similar data Objects if they were created in the AS code. So I went ahead and created an .as class called com.myclient.myapp.Product and associated it with the Java class using the following static variable invocation: static var regClass = Object.registerClass(com.myclient.Product, com.myclient.myapp.Product); After doing that, everything worked just fine. So my questions are, why did I have to create that ActionScript class to get things to work? Is there a way to pass back a generic AS Object from a remote object call? Would passing back objects of type java.util.Map be the answer? Which is the better practice, passing back a java.util.Map to be converted to an untyped Object or creating .as classes for each typed Object that can be retured from a remote object call. Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.com 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. Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] Security Sandbox Violation when loading image
Well, I figured out why I was experiencing different behavior when pulling data in from an XML file vs. pulling it in via a remote object. My remote object method call was returning an Array of objects which on the Java side were instances of a simple data object class I had created called com.myclient.Product. These objects had three properties: label(String), imageId(String), and price(Double) which were accessible through appropriately named getter methods. When stepping through the debugger in Flex Builder, I could see these objects were coming through just fine with the appropriate property names and values, but when I tried to pass each object to my custom display component it was not displaying them, even when the same display component had no problem displaying similar data Objects if they were created in the AS code. So I went ahead and created an .as class called com.myclient.myapp.Product and associated it with the Java class using the following static variable invocation: static var regClass = Object.registerClass("com.myclient.Product", com.myclient.myapp.Product); After doing that, everything worked just fine. So my questions are, why did I have to create that ActionScript class to get things to work? Is there a way to pass back a generic AS Object from a remote object call? Would passing back objects of type java.util.Map be the answer? Which is the better practice, passing back a java.util.Map to be converted to an untyped Object or creating .as classes for each typed Object that can be retured from a remote object call. Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.com 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. Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[flexcoders] Security Sandbox Violation when loading image
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 www.resource.com Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] Security Sandbox Violation when loading image
Im not an expert at this by any stretch. The security sandbox violation when dealing with images/movies generally occurs because the SWF that did the loading (myserver.com/index.mxml) tries to access properties of the loaded movie (otherserver.com/someImage, and yes I realize it may not be a SWF). Im not sure why properties youd be trying to access though, maybe depth swapping or something? Maybe the Flex app does it on its own. I wonder if Manish ran into this with the map example J As for it working with XML and not with RemoteObject, that does strike me as strange. The only thing I can think of would be that somehow establishing a connection to your source server prevents the SWF from thinking that it should be allowed to contact the other server. Do you own the other server? Any chance you could try putting a crossdomain.xml file on there (see technotes for info on crossdomain). Sorry, not very useful I know, Matt From: Kristopher Schultz [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 10:42 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Security Sandbox Violation when loading image 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 www.resource.com Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] Security Sandbox Violation when loading image
On Fri, 25 Mar 2005 20:32:14 -0800, Matt Chotin [EMAIL PROTECTED] wrote: wonder if Manish ran into this with the map example J The map sample loads images from the same host, but the flickr/delicious sample loads them directly from flickr.com. http://www.flexauthority.com/Samples/delicious/WhatsCooking.mxml I tried running fdb with this, and yes it does show that error message for every image it loads. [trace] *** Security Sandbox Violation *** [trace] SecurityDomain 'http://localhost:8100/test/delicious/WhatsCooking.mxml?re compile=truedebug=true' tried to access incompatible context 'http://photos3.fl ickr.com/6430573_f536dcde22_m.jpg' Then I found this: http://www.visible-form.com/blog/85.html I tried doing allowDomain() in my app's initialize handler, but it doesn't seem to help. I don't know much about this whole security/sandbox thing, but maybe some on the list who knows can suggest something based on what I found out so far. Manish Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * 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/