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.
A SWF is a type of extra-budgetary fund that operates outside the annual government budget process. SWFs have traditionally been created to achieve a macroeconomic goal (e.g., fiscal stability; save for future generations; help mitigate the Dutch disease).
If Direct Linking is restricted, Publishers can use their own domain or site and create their own landing page that they send visitors to first, before sending them to the Advertiser's site. The conversion rate is usually higher as a result of Direct Linking Better customer journey as there is no need for a landing page
In terms of both physical memory and disk-space usage, it is much more efficient to load the system libraries into memory only once. Dynamic linking allows this single loading to happen. Every dynamically linked program contains a small, statically linked function that is called when the program starts.
While the idea of using a SWF to invest domestically may resonate with government officials and politicians in low-income, resource-rich countries—particularly at this time of low commodity prices and surging fiscal deficits among oil and mineral exporters—there are strong arguments against using SWFs for this purpose.
Upsides for linking directly to SWF file:
Downsides:
In short, for a complicated application - always use the HTML. For a simple animation movie you can go either way.
You also lose external control of the SWF. When it's embedded in HTML you can use javascript to communicate with the SWF. If the SWF is loaded directly that may not be possible.
Your 100+ lines quote seems pretty high to me. The HTML that FlashDevelop generates for embedding a SWF is only around 35 lines, with an include of a single swfobject.js file. You shouldn't need to touch the js file, and at the most would only have to tweak the HTML in very minor ways to get it to do what you want.
In my experience not all browsers handle this properly. I'm not really sure why (or which browsers) but I've mistakenly sent links like this to clients on occasion and they've often come back confused. I suspect their browser prompts them to download the file instead of displaying it properly.
One upside I can think of is being able to specify GET parameters in the direct URL to the SWF, which will then be available in the Flash app (via Application.application.parameters
in Flex, not sure how you'd access them in Flash CS3). This can of course be achieved by other means as well if you have an HTML wrapper but this way it's less work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With