<p>Usually Flash and Flex applications are embedded on in HTML using either a combination of <code>object</code> and <code>embed</code> 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.</p>

<p>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?</p>

<p>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).</p>

<p><em>Update</em> 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.</p>

[{'answer_id': 54005, 'author': 'ujh', 'author_id': 4936, 'author_profile': 'https://Stackoverflow.com/users/4936', 'pm_score': 0, 'selected': False, 'text': '<p>Why would you need 100+ lines of code? Using something like <a href="http://code.google.com/p/swfobject/" rel="nofollow noreferrer">swfobject</a> reduces this amout quite some (and generally you don\'t want to do plugin detection, etc. by hand anyway).</p>\n'}, {'answer_id': 54007, 'author': 'Herms', 'author_id': 1409, 'author_profile': 'https://Stackoverflow.com/users/1409', 'pm_score': 2, 'selected': False, 'text': "<p>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.</p>\n\n<p>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.</p>\n"}, {'answer_id': 54125, 'author': 'grapefrukt', 'author_id': 914, 'author_profile': 'https://Stackoverflow.com/users/914', 'pm_score': 2, 'selected': False, 'text': "<p>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. </p>\n"}, {'answer_id': 54155, 'author': 'hasseg', 'author_id': 4111, 'author_profile': 'https://Stackoverflow.com/users/4111', 'pm_score': 1, 'selected': False, 'text': "<p>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 <code>Application.application.parameters</code> 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.</p>\n"}, {'answer_id': 109016, 'author': 'Eliram', 'author_id': 18790, 'author_profile': 'https://Stackoverflow.com/users/18790', 'pm_score': 4, 'selected': True, 'text': "<p>Upsides for linking directly to SWF file:</p>\n\n<ul>\n<li>Faster access</li>\n<li>You know it's a flash movie even before you click on the link</li>\n<li>Skipping the html &amp; js files  (You won't use CSS to display 100% flash movie anyway)</li>\n</ul>\n\n<p>Downsides:</p>\n\n<ul>\n<li>You have little control on movie defaults.</li>\n<li>You can't use custom background colors, transparency etc.</li>\n<li>You can't use flashVars to send data to the movie from the HTML</li>\n<li>Can't use fscommand from the movie to the page</li>\n<li>Movie proportions are never the same as the user's window's aspect ratio</li>\n<li>You can't compensate for browser incompetability (The next new browser comes out and you're in trouble)</li>\n<li>No SEO</li>\n<li>No page title, bad if you want people to bookmark properly.</li>\n<li>No plugin information, download links etc.</li>\n<li>If your SWF connects to external data sources, you might have cross domain problems.</li>\n<li>Renaming the SWF file will also rename the link. Bad for versioning.</li>\n</ul>\n\n<p>In short, for a complicated application - always use the HTML. For a simple animation movie you can go either way.</p>\n"}, {'answer_id': 404753, 'author': 'featureBlend', 'author_id': 50477, 'author_profile': 'https://Stackoverflow.com/users/50477', 'pm_score': -1, 'selected': False, 'text': '<p>Adobe should be ashamed of themselves with the standard embed, which defeats the puprose of convention over configuration.  Check ^swfobject (as mentioned above) or <a href="http://code.google.com/p/swfin/" rel="nofollow noreferrer">swfin</a></p>\n'}, {'answer_id': 7729919, 'author': 'avidweaver', 'author_id': 990018, 'author_profile': 'https://Stackoverflow.com/users/990018', 'pm_score': 0, 'selected': False, 'text': "<p>More advantages:</p>\n\n<ol>\n<li>Light weight look cuz you can get rid of the header with all the tool bars that seem to accumulate there and even the scroll bar is not needed.  This enhances the impact when you are trying to show a lot of action in a short flash.</li>\n<li>The biggie:  you get it in a window that you can drag larger or smaller and make the movie larger and smaller.  The player will resize the movie to fill the window you have.  This is great for things like group photos where everyone wants to enlarge to find themselves and their friends.  I've done this for a one frame Flash production!</li>\n</ol>\n\n<p>Downsides:\nAs with popups in general, if you are asking for multiple ones from the same site, and you want different size popups, the browsers tend to simply override the size you ask for in window.open and reuse whatever is up. You need to close any open popup so the window.open will do a fresh create.  It gets complicated, and I have not been able to get it to work across pages in a website.  Anyone who has done this successfully, pls post how!</p>\n"}]
['https://Stackoverflow.com/questions/53989', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1109/']