|
-
Jan 1st, 2010, 12:05 AM
#13
Re: Minimizing Javascript use
As Samba said, the JavaScript you provided there to embed Flash is completely unnecessary... meaning, JavaScript has nothing to do with Flash and is not required to embed Flash within a page. JavaScript is not the method I would ever suggest one would use to embed Flash, either.
The AC_FL_RunContent() JavaScript function is something that exists solely to create the HTML mark-up required to display Flash content without actually putting the mark-up in the HTML. I tried to explain this to you a little previously (in another thread), but generally it seems you skim through posts without getting too much from them...
As Samba mentioned, this function was originally created by Adobe for their Flash publishing software to get around the "Click to activate" thing in IE. Because the page did not actually have an <object> that was created at run-time, and instead had an <object> that was created after run-time via JavaScript, it circumvented the "feature" added to IE. This "feature" has since been removed, but you can read all about this function here if you'd like.
Another reason one might use this JavaScript function nowadays is for validation. The original way of embedding Flash files using the <embed> tag doesn't validate. This is because the <embed> tag was never a part of any HTML standard. To get the code to validate, however, only the following mark-up is required:
HTML Code:
<object type="application/x-shockwave-flash" data="path/to/file.swf" width="X" height="Y">
<param name="movie" value="path/to/file.swf" />
</object>
This does produce a flaw when loading Flash SWF files in IE, though. IE needs to completely load any <object> files before displaying them when you use this code, while other browsers will stream them while they're loading. This isn't an issue for most Flash files (most Flash files are generally small), but will produce a problem for anything large. There is a workaround, and you can also read more about this method of embedding Flash and the workaround itself here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|