14

Is it possible to integrate or load SWFs when creating iphone applications (Is t...

 3 years ago
source link: https://www.codesd.com/item/is-it-possible-to-integrate-or-load-swfs-when-creating-iphone-applications-is-this-allowed-by-apple.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Is it possible to integrate or load SWFs when creating iphone applications (Is this allowed by Apple?

advertisements

I am a little confused on whether to embed swfs or load them when making apps for the iphone. Does anyone know what are the advantages of each (which is preferable to use)? I know that embedding swfs should be a little faster than loading them but is that all?

Also and this is kind of important, I read that Apple will reject any app with external swfs?? Is that indeed correct? If so, will embedding or loading said swfs solve this problem?

Thanks in advance

EDIT: after some searching around, turns that Apple does have problems with loading external swfs, u can still do it, but your swfs need not have any actionscript attached, here is a link http://whizzkid74.blogspot.com/2010/12/air-for-iphone-loading-external-swf.html It doesnt say anything about embedding swfs however, so my question is this: can u embed swfs when writing apps on the iphone??

EDIT To clarify, when i say external SWFs. I mean SWFs that are found on your system locally but you need to add them to your program since they contain MovieClips or Sprites etc... that u need. I didn't mean SWFs that you need to download from a website or an online source. (hope that clarifies things)

EDIT Changed the question's title...Problem solved, thanks for all the help guys and happy new year =D


The answer is yes, you can embed SWFs, but that is not the only way. You can also use normal Loader methods, with everything relative to the main SWF:

var myLoader:Loader = new Loader();
// iOS apps act as if the main SWF is in a folder
// and the other SWFs are in the same (or sub) folders.
var url:URLRequest = new URLRequest("loadedSWF.swf");
myLoader.load(url);
addChild(myLoader);
myLoader.x = 50;
myLoader.y = 30;

With one caveat: during compile time (in the "Air for iOS Settings", in the "Included files" list), you have to list the SWFs that you want to be loaded, and they will get compiled into the IPA.

So, no you cannot call to external SWFs, but you certainly can access other SWFs using the embed tag, or using (what might be called) IPA embedding.


Edit:

Since the question and title have changed a bit since I first answered this, here is a more generic summary. Apple does not allow loading local SWFs in the same way that you would be able to if using Flash Player on a website. There is no way to load an SWF (or anything else) using "relative" or "local" references in an i-device unless that content is compiled into the app. This does not apply to some types of "remote" SWF loading, and also does not apply to Actionscript "Native" coding, but that is not what the (original) question was about.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK