SWFObject and Ajax (xmlhttprequest)
xmlhttprequest) script can simply copy the markup over to the new HTML page. Be sure to use
request.responseText in your
If you want to push the boundaries a little more, you can use xmlhttprequest to load data about a SWF from an external XML file (including any variables that need to be passed into the SWF using flashvars).
- Create the page you'd like to load a SWF into
- Create the SWF
- Create an XML file containing the information needed for the SWF, including any optional parameters you'd like to pass via FlashVars. This includes the SWF file path, width, height, minimum version of Flash Player, etc.
- Add an
xmlhttprequestto the requesting page. The
xmlhttprequestwill load the
- When the data has been extracted, it's used to populate an instance of SWFObject, which is then used to write the SWF to the page.