制作 iphone 应用程序时是否可以嵌入或加载 SWF(Apple 允许) [英] Is it possible to embed or load SWFs when making iphone apps (Is it allowed by Apple)

查看:26
本文介绍了制作 iphone 应用程序时是否可以嵌入或加载 SWF(Apple 允许)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对在为 iphone 制作应用程序时是嵌入 swf 还是加载它们感到有些困惑.有谁知道每种方法的优点是什么(最好使用)?我知道嵌入 swf 应该比加载它们快一点,但仅此而已吗?

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?

另外,这很重要,我读到 Apple 会拒绝任何带有外部 swfs 的应用程序??真的是这样吗?如果是这样,嵌入或加载所述 swfs 会解决这个问题吗?

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?

提前致谢

经过一番搜索,发现 Apple 在加载外部 swfs 时确实存在问题,您仍然可以这样做,但是您的 swfs 不需要附加任何动作脚本,这里是一个链接 http://whizzkid74.blogspot.com/2010/12/air-for-iphone-loading-external-swf.html 然而,它没有说明任何关于嵌入 swfs 的内容,所以我的问题是:你可以在 iphone 上编写应用程序时嵌入 swfs 吗??

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 澄清一下,当我说外部 SWF 时.我的意思是在您的本地系统上找到的 SWF,但您需要将它们添加到您的程序中,因为它们包含您需要的 MovieClips 或 Sprites 等.我不是说您需要从网站或在线资源下载 SWF.(希望澄清事情)

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 更改了问题的标题...问题已解决,感谢所有帮助并祝大家新年快乐 =D

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

推荐答案

答案是肯定的,您可以嵌入 SWF,但这不是唯一的方法.您还可以使用与主 SWF 相关的所有内容的普通 Loader 方法:

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;

有一个警告:在编译期间(在Air for iOS 设置",在包含的文件"列表中),您必须列出要加载的 SWF,它们将被编译到 IPA.

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.

所以,不,您不能调用外部 SWF,但您当然可以使用 embed 标签或使用(可能称为)IPA 嵌入访问其他 SWF.

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.

自从我第一次回答这个问题以来,问题和标题发生了一些变化,这里是一个更通用的总结.Apple 不允许像在网站上使用 Flash Player 那样加载本地 SWF.无法在 i 设备中使用相对"或本地"引用加载 SWF(或其他任何内容)除非将内容编译到应用程序中.这不适用于某些类型的远程"SWF 加载,也不适用于 Actionscript本机"编码,但这不是(原始)问题的内容.

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.

这篇关于制作 iphone 应用程序时是否可以嵌入或加载 SWF(Apple 允许)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆