flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: SecurityError when using img tag in HTML text
Date Thu, 18 Sep 2014 16:44:36 GMT


On 9/18/14 1:10 AM, "Evyatar Ben Halevi-Arbib" <evyatarbh@gmail.com> wrote:

>Hello,
>
>We upgraded from Adobe Flex 4.5.1 to Apache Flex 4.12.1 and noticed a
>problematic issue.
>It renders HTML pretty well, considering the limitations, but since the
>upgrade we often encounter the following exception being thrown when using
>the img tag -
>
>SecurityError: Error #2122: Security sandbox violation: Loader.content:
>http://mydomain.com/Client/myapplication.swf cannot access
>http://differentdomain.com/image.png. A policy file is required, but the
>checkPolicyFile flag was not set when this media was loaded.
>at flash.display::Loader/get content()
>at
>flashx.textLayout.elements::InlineGraphicElement/loadCompleteHandler()[/Us
>ers/aharui/git/flex/master/flex-tlf/textLayout/src/flashx/textLayout/eleme
>nts/InlineGraphicElement.as:703]
>
>I tried investigating this and found that in TLF 2.0 a similar issue was
>handled in build 203, where it say "Fix 2758185 Unhandled securityerror in
>InlineGraphicElement Loader.load call".
>This can be found in the following document -
>https://svn.apache.org/repos/asf/flex/tlf/branches/3.0/ReleaseNotes.txt
It would take some digging to figure out what that fix was.  It may not be
related to this problem.

Your problem is because the code at line 703 of InlineGraphicElement.as
looks like this:

if(graphic is Loader && Loader(graphic).content != null &&
Loader(graphic).content.hasOwnProperty("setActualSize") &&
(!widthIsComputed() || !heightIsComputed()) )


I think it should be:

if(graphic is Loader &&
Loader(graphic).contentLoaderInfo.childAllowsParent &&
Loader(graphic).content != null &&
Loader(graphic).content.hasOwnProperty("setActualSize") &&
(!widthIsComputed() || !heightIsComputed()) )

Maybe you can give that a try (monkey-patch the file) and let us know.


-Alex


Mime
View raw message