tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/640-robotlegs-game-with-airRobotlegs: Discussion 2012-09-14T14:19:40Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/187505632012-09-14T11:32:22Z2012-09-14T12:31:21ZRobotlegs game with AIR<div><p>Hello,</p>
<p>I don’t think that the issue you are encountering has
anything to do with robotlegs.<br>
You can try something like this:</p>
<pre>
<code>fileURL ='C:/Users/Astraport/AppData/Roaming/com.lll.slotsgametest.debug/Local Store/slots/slotfruit.swf';
var file:File;
file = File.applicationStorageDirectory.resolvePath(fileURL);
var fileStream:FileStream = new FileStream();
fileStream.open(file, FileMode.READ);
var bytes: ByteArray = new ByteArray();
fileStream.readBytes(bytes);
fileStream.close();
var loaderContext:LoaderContext = new LoaderContext();
loaderContext.allowLoadBytesCodeExecution = true;
loaderContext.applicationDomain=ApplicationDomain.currentDomain;
var swfLoader: SWFLoader = new SWFLoader();
swfLoader.loaderContext = loaderContext;
swfLoader.source = bytes;
moduleLoaderContainer.addElement(swfLoader);</code>
</pre>
<p>You should do a research on security restrictions,
SecurityDomain, loading swfs in AIR..</p>
<p>Here, using cross-domain policy files:<br>
<a href=
"http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS2db454920e96a9e51e63e3d11c0bf6167e-7fe9.html">
http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS2db454920e96a9e51e6...</a></p>
<p>hth<br>
Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/187505632012-09-14T12:13:01Z2012-09-14T12:31:21ZRobotlegs game with AIR<div><p>As Ondina says, for Air, secure loading is a little more complex
- basically in order to load a swf such that it has app-sandbox
privileges, it needs to be loaded as bytes, not using
swfloader.</p>
<p>Obviously that's dangerous, as Air apps can do a lot of damage
in the user's computer if abused. So, generally it's best to sign
the swfs to be loaded (packaged as Air) with the same key as the
main Air app doing the loading, and check those signatures on
loading, rejecting any that fail.</p>
<p>If this is relevant... let us know - I have a utility that
handles secure loading of swfs for air to give them in-app
privileges, it's on my github and I have a blog post that explains
how to use it.</p>
<p>hth,</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/187505632012-09-14T12:36:33Z2012-09-14T12:36:33ZRobotlegs game with AIR<div><blockquote>
<p>I have a utility that handles secure loading of swfs for air to
give them in-app privileges, it's on my github and I have a blog
post that explains how to use it.</p>
</blockquote>
<p>I’d like to try this utility, Stray! Link?</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/187505632012-09-14T12:41:21Z2012-09-14T12:41:21ZRobotlegs game with AIR<div><p>No problem :)</p>
<p><a href=
"https://github.com/Stray/Air-Secure-Module-Loading">https://github.com/Stray/Air-Secure-Module-Loading</a></p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/187505632012-09-14T12:42:29Z2012-09-14T12:42:29ZRobotlegs game with AIR<div><p>Many thanks:)</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/187505632012-09-14T13:57:04Z2012-09-14T13:57:06ZRobotlegs game with AIR<div><p>Thanks. I study it.</p></div>Astraporttag:robotlegs.tenderapp.com,2009-10-18:Comment/187505632012-09-14T14:19:16Z2012-09-14T14:19:16ZRobotlegs game with AIR<div><p>You're welcome.</p></div>Ondina D.F.