直接链接到SWF,有什么缺点? [英] Linking directly to a SWF, what are the downsides?

查看:161
本文介绍了直接链接到SWF,有什么缺点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,Flash和Flex应用程序使用 object 嵌入标记的组合嵌入在HTML中,或者更常用的是使用JavaScript。但是,如果您直接链接到SWF文件,则它将在浏览器窗口中打开,而不会在地址栏中查看,您无法判断它是否未嵌入HTML,其大小设置为100%宽度和高度。考虑到嵌入填充浏览器窗口100%的Flash或Flex应用程序所需的HTML,CSS和JavaScript的开销,直接链接到SWF文件的缺点是什么代替?有什么好处?

我可以想到一个好处和三个缺点:你不需要100多行HTML,JavaScript和CSS,否则需要,但你没有插件检测,没有版本检查,你失去了你最好的SEO选项(逐步增强)。
$ b $ p更新在100多行中,我只是表示嵌入SWF所需的代码数量是相当多的(我的意思是包括像SWFObject这样的库),它只是用来显示SWF,这可以在没有直接链接到SWF文件:

解决方案




  • 访问速度更快

  • 即使在点击链接之前, html& js文件(您不会使用CSS来显示100%的Flash动画)



缺点:$ b​​
$ b


  • 您无法控制电影默认值。

  • 您不能使用自定义背景颜色,透明度等。 b $ b
  • 无法使用flashVars将数据从HTML发送到影片

  • 无法使用fscommand从影片到页面
  • 电影比例永远不会与用户窗口的宽高比相同。
  • 无法弥补浏览器不兼容的问题(下一个新的浏览器出现了,您遇到了麻烦) / li>
  • 没有SEO

  • 没有页面标题,如果您希望用户书签正确,则不好。 ,下载链接等。

  • 如果您的SWF连接到外部数据源,您可能会遇到跨域问题。 重命名SWF文件也会重命名链接。对于版本管理不利。



简而言之,对于一个复杂的应用程序 - 总是使用HTML。对于一个简单的动画电影,你可以采取任何方式。


Usually Flash and Flex applications are embedded on in HTML using either a combination of object and embed tags, or more commonly using JavaScript. However, if you link directly to a SWF file it will open in the browser window and without looking in the address bar you can't tell that it wasn't embedded in HTML with the size set to 100% width and height.

Considering the overhead of the HTML, CSS and JavaScript needed to embed a Flash or Flex application filling 100% of the browser window, what are the downsides of linking directly to the SWF file instead? What are the upsides?

I can think of one upside and three downsides: you don't need the 100+ lines of HTML, JavaScript and CSS that are otherwise required, but you have no plugin detection, no version checking and you lose your best SEO option (progressive enhancement).

Update don't get hung up on the 100+ lines, I simply mean that the the amount of code needed to embed a SWF is quite a lot (and I mean including libraries like SWFObject), and it's just for displaying the SWF, which can be done without a single line by linking to it directly.

解决方案

Upsides for linking directly to SWF file:

  • Faster access
  • You know it's a flash movie even before you click on the link
  • Skipping the html & js files (You won't use CSS to display 100% flash movie anyway)

Downsides:

  • You have little control on movie defaults.
  • You can't use custom background colors, transparency etc.
  • You can't use flashVars to send data to the movie from the HTML
  • Can't use fscommand from the movie to the page
  • Movie proportions are never the same as the user's window's aspect ratio
  • You can't compensate for browser incompetability (The next new browser comes out and you're in trouble)
  • No SEO
  • No page title, bad if you want people to bookmark properly.
  • No plugin information, download links etc.
  • If your SWF connects to external data sources, you might have cross domain problems.
  • Renaming the SWF file will also rename the link. Bad for versioning.

In short, for a complicated application - always use the HTML. For a simple animation movie you can go either way.

这篇关于直接链接到SWF,有什么缺点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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