Copy link to clipboard
Copied
Adobe, can you please provide us with the code to load multiple swf files for ios. Please provide examples. The code below loads multiple swfs, but the swfs stall, so this does not seem to be a solution.
Code description: A flash file made up of 4 frames with forward and back buttons that navigate from frame to frame. The code loads three different swf files in frames 2, 3 and 4.
Frame 1:
var myLoader:Loader;
var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
if(myLoader == null){myLoader = new Loader(); addChild(myLoader); }
else {myLoader.unload();}
Frame 2:
Frame 3:
Frame 4:
Copy link to clipboard
Copied
Hi Conner,
On iOS the method "unload" doesn't work (is no-op) and therefore in your app the same loader is loading all the swfs. Can you please share a sample app(with sources) of your project with me @nimisha1@adobe.com so that I can reproduce the issue locally?
Thanks,
Nimisha
Copy link to clipboard
Copied
I downloaded AIR SDK 3.6 beta and overlay it in FlashBuilder 4.7.
I export release build with some swf files, which included in package content.
When application started i am trying to load swf file like written in this article.
Unfortunately, it result to 'Uncompiled ActionScript' error.
Please tell me, could i load and get access to external swf with action script at runtime?
Are there any special requirements for compiling external swf?
Thanks.
Copy link to clipboard
Copied
Are you using swf-version=19? Also are you packaging secondary SWF with the root SWF?
Copy link to clipboard
Copied
Is necessary use "swf-version=19" for compile loadable secondary swf?
What does it mean: "packaging secondary SWF with the root SWF"?
My code:
var loader:Loader = new Loader();
var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
var file:File = File.applicationDirectory.resolvePath("swfs/second.swf'");
loader.load(new URLRequest(file.url), loaderContext);
cont.addChild(loader); // "cont" is UIComponent in main application (s:Application)
Copy link to clipboard
Copied
Hi Alex,
Following are the answers for your questions:
>>Is necessary use "swf-version=19" for compile loadable secondary swf?
No, swf-version=19 applies only to the root SWF (main application SWF) not to secondary SWF and secondary SWF can have any swf-version which is supported by AIR.
>>What does it mean: "packaging secondary SWF with the root SWF"?
This means that the "swfs/second.swf" is getting packaged with the main application but since you're using FB then this must be getting packaged.
Your code is correct and it should work. If it is still not working then please let me know.
Copy link to clipboard
Copied
Hi Nimisha1 and everybody
how i can applies the rootSWF on swf-version-19 (i use Flash cs6)
thank you brothers
Copy link to clipboard
Copied
If you are using AIR 3.6 (overlaid the sdk in CS 6)then swf getting generated must be of version 19.
Copy link to clipboard
Copied
Yes i use air 3.6
but on ipad , I can apply the swf for the first time and action script in file can use normally
but when I download another swf, I can't download the old swf
I don't know why it happened?
What shoud I do?
thank you
Copy link to clipboard
Copied
but when I download another swf, I can't download the old swf
Does that mean you're loading one secondary SWF and then other secondary SWF and then again first secondary SWF?
If yes then this won't happen as reloading on AIR iOS is prohibited. You can get more details about this feature at http://blogs.adobe.com/airodynamics/2012/11/09/packaging-and-loading-multiple-swfs-in-air-apps-on-io...
Thanks!
Copy link to clipboard
Copied
thank you Nimisha1
also you can import external swc in air for ios run time?
if i set merge into code that can import normally
var mc:nameSWC = new nameSWC();
addChild(mc);
but when i set Type: External , I can't import it
Copy link to clipboard
Copied
The external SWC is the SWC which can be loaded at runtime so you can't merge it's code at compile time.
To use it's code you don't have to import it in to your project while just link it through ->Project->Properties->Actionscript BuildPath->Add SWC and after importing set Link Type: external. but to provide it at Runtime you have to package it with the IPA and SWC can't be packaged with the IPA.
So here in this case just build a Native extension for this swc with no native implementation and then package it with the IPA.
Copy link to clipboard
Copied
thank you very much Nimisha1
I'll try it.
Copy link to clipboard
Copied
Hi Nimisha1,
i don't understand that can i do to generate SWF with swf-version 19 compiler option into Adobe Flash Professional CS6.
I have create an iOS app with AIR 3.6.0.5990 sdk and i want to use the Load secondary SWF with ActionScript code inside.
i have include into "include File project" my .swf but when i finish to compile the prj i receive a warning:
ActionScript code contained in externally loaded SWF file will be ignored in iOS devices.
Why?
Thanks.
Copy link to clipboard
Copied
The error message can be ignored, and was removed in later builds.
Copy link to clipboard
Copied
Thanks for letting us know about it.This is a tooling issue (CS6). We'll look into this.
For now please ignore the warning as the multiple SWFs are now supported on the iOS.
Thanks,
Nimisha
Copy link to clipboard
Copied
Hi Nimisha1,
ok i will ignore this warinig but i don't understand when i load an external SWF
the application crash.
this is my code:
...
var swf_name:String="iDGIMobile_UI2.swf";
...
if (swf_name!=null) {
var myLoader:Loader = new Loader();
var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain); // , null);
var file:File = File.applicationDirectory.resolvePath(swf_name);
myLoader.load(new URLRequest(file.url), loaderContext); // load the SWF file
this.addChild(myLoader);
}
Thanks.
Copy link to clipboard
Copied
Hi,
Can you please log a bug @bugbase.adobe.com with a sample project (which includes source code, swfs and all the assets used in app) with which bug is reproducible?
Also please share a bug number here so that we can take a look at it.
-Nimisha
Copy link to clipboard
Copied
Hi Nimisha1,
You said:
On iOS the method "unload" doesn't work (is no-op) and therefore in your app the same loader is loading all the swfs
In this blog post http://blogs.adobe.com/airodynamics/2012/11/09/packaging-and-loading-multiple-swfs-in-air-apps-on-io... it says that:
The behavior of Loader.unload() and Loader.unloadAndStop() on iOS is below. When either of these functions is called the following will happen:
- The contentLoaderInfo property of the Loader object will become null
- Any assets that are loaded with the secondary SWF will be unloaded.
- Any references to AS classes in the loaded SWF remain in memory, and new objects of those AS classes can be created. This is different from the behavior on other platforms.
Therefore my question is can you confirm the correct behaviour of what is supposed to happen. Is it that nothing gets unloaded like you said or is it that the bytecode will not get unloaded but the assets inside the SWF will get unloaded?
Thanks
Copy link to clipboard
Copied
As the blog mentions the behavior of "unload" method is that assets inside the SWF will get unloaded and similarly an asset SWF(having no ABC code) will get unloaded while any ABC code or any SWF containing ANC code will not get unloaded.
I hope this helps.
Copy link to clipboard
Copied
Hi Nimisha1,
i send you all the project to bug@bugbase.adobe.com with this subject:
Load external SWF crash into iOS project use AIR SDK 3.6.0.5990
I hope you help me.
Thanks
Andrea
Copy link to clipboard
Copied
Hi Andrea,
You have to send your project at nimisha1@adobe.com and also please provide some details about the issue that you're facing.
-Nimisha
Copy link to clipboard
Copied
Hi Everyone,
Reloading of pure asset SWFs(having no ABC code) is now allowed on iOS , please download the AIR 3.7 build from here to use this functionality :
http://labs.adobe.com/downloads/air.html
While reloading the pure asset SWF please make sure your SWF doesn't contain any ABC code otherwise it won't get reloaded.
Please share your feedback with us!
Thanks,
Nimisha
Copy link to clipboard
Copied
Hi Nimisha,
i tried to compile my prj with Adobe AIR 3.7 Beta SDK but i have the same problem.
My application crash when i try to load an external swf into iOS application.
I don't known what can i do.
Thanks,
Andrea
Copy link to clipboard
Copied
Hi Andrea,
Please refer this blog http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-sec ondary-swfs-for-air-apps-on-i... for using this new feature "External hosting of secondary SWFs on iOS".
If you still face the problem then please let us know.
-Nimisha