Alexander,

I don't know if your question is still up-to-date. I do not have much
experience in AS3 external content loading, but this should be similar
to AS2.0.... 

You can load any images without any security grants from any domain
you like. The restriction is added to objects that are related to the
container were you load your content.

In case of using external domain images a good idea is loading them
into a nested container, which has a Sprite or MovieClip parent. To
resize the image you can resize its parent container.

 Stage -> some_container[MC] -> image_parent_container[MC] -> drop_zone[MC]

The drop_zone is were you load the external content, e.g. an image.
The image_parent is completely accessible to your code so you can
scale it, fade it, mask it etc. If the parent container holds only
your drop_zone, then any operation on its size will be mapped to the
drop_zone.

hth
g


Friday, December 25, 2009 (7:11:51 PM) Alexander Farber wrote:

> Oh, I think I start to understand:
> my Event.INIT callback _is_ being called.

> But once it tries to access Loader.content
> for resizing the loaded image,
> then I get the SecurityError.


> On Fri, Dec 25, 2009 at 6:22 PM, Alexander Farber
> <alexander.far...@gmail.com> wrote:
>> I have an AS3 game hosted at my site http://preferans.de
>> which displays resized avatars of gamers. It works ok.
>>
>> To attract more users, I've added support for the users of
>> http://vkontakte.ru (the russian Facebook clone, 50 mio. users)
>> to play at my site without additional registration.
>>
>> The http://vkontakte.ru/crossdomain.xml of course
>> doesn't list my site or any wildcards and never will.
>>
>> Still I'm able to load vkontakte.ru avatars with
>> Loder.load() and I see the loading progress by
>> monitoring ProgressEvent.PROGRESS events.
>>
>> However the other events - IOErrorEvent.IO_ERROR,
>> SecurityErrorEvent.SECURITY_ERROR and
>> Event.INIT are never called and so I can't resize them.
>>
>> And also I get the error message in the FP10:
>>
>> SecurityError: Error #2123: Security sandbox violation:
>> Loader.content: http://preferans.de/Pref.swf cannot access
>> http://cs4161.vkontakte.ru/u62184775/a_9b2f2703.jpg. No policy files
>> granted access.
>>       at flash.display::Loader/get content()
>>       at User/handleInit()
>>
>> Can anyone please explain what's happening to me?
>>
>> 1) Why can I still load unresized images, eventhough
>>     my site isn't listed in crossdomain.xml?
>>
>> 2) Why isn't SecurityErrorEvent.SECURITY_ERROR
>>    being called?
>>
>> 3) Can I somehow try/catch the error message?
>>     I don't know where to put it around.
>>
>> I use LoaderContext(true) and even understand that
>> the crossdomain.xml is mostly for situations when
>> corporate users are surfing outside their intranets.
>> I've read, but don't understand the Adobe doc
>> http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/system/LoaderContext.html#checkPolicyFile
>> good enough...
>>
>> My complete code is at: http://pastebin.com/m3a4732ce
>>
>> Thank you
>> Alex
>>

> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders






_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to