Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't think there is any difference in terms of security. Remember, MXML gets converted to ActionScript by the <em>mxmlc</em> compiler before the actual compilation commences, so a declarative SWFLoader (or any other declarative element, for that matter) is just a short-hand way of creating something instead of coding it by hand. You can use the <code>-compiler.keep-generated-actionscript</code> mxmlc argument to see what kind of code gets generated from your MXML.</p> <p>And the reason you're not seeing a runtime error from the <code>loader2.source = source;</code> line in that example is that since the previous line of code invokes an error, the execution of that function stops there. Try commenting out the line where you call <code>loader1.load(source)</code> and you'll see the next line throw this kind of a SecurityError:</p> <pre><code>SecurityError: Error #2148: SWF file http://example.com/test.swf cannot access local resource file:///Users/username/Desktop/picture.jpg. Only local-with-filesystem and trusted local SWF files may access local resources. at flash.display::Loader/_load() at flash.display::Loader/load() at mx.controls::SWFLoader/loadContent() at mx.controls::SWFLoader/load() at mx.controls::SWFLoader/commitProperties() at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/validateProperties() at mx.managers::LayoutManager/doPhasedInstantiation() at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2() at mx.core::UIComponent/callLaterDispatcher() </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload