How to install swf in website


/ Published in: ActionScript 3
Save to your folder(s)

Great


Copy this code and paste it in your HTML
  1. About how to install swf files in your website,here have some method for you to choose.
  2.  
  3. Method 1:
  4.  
  5. Add js code in <head> ... </head>:
  6.  
  7. <script type="text/javascript" src="swfobject/swfobject.js"></script>
  8.  
  9. Add div code for load swf file in <body> ... <body>:
  10.  
  11. <div id="preview_div">
  12. <script type="text/javascript">
  13. <!--
  14. var flashvars = {
  15. };
  16. var params = {
  17. scale: "noscale",
  18. menu: "false",
  19. bgcolor: "#000000"
  20. };
  21. var attributes = {
  22. id: "preview_swf",
  23. name: "preview_swf"
  24. };
  25. swfobject.embedSWF("preview.swf", "preview_div", "590", "300", "9", "swfobject/expressInstall.swf", flashvars, params, attributes);
  26. //-->
  27. </script>
  28. </div>
  29.  
  30. If you use the method,you need notice the xml file path.For example:
  31.  
  32. index.html -> xmlbaner.swf
  33. the swf files and the xml must the same path like load index path.
  34. service path files like
  35. root/ index.html
  36. root/ xmlbanner.swf
  37. root/ data.xml
  38. root/ image/...
  39.  
  40. Method 2:
  41.  
  42. <div id="preview_div">
  43. <iframe src="preview.swf " width="590" height="300" scrolling="no" frameborder="0" style="float:left; width:590px;">
  44. iframe>
  45. </div>
  46.  
  47. If you need the method,you don't worry the xml files path.
  48.  
  49. Method 3:
  50.  
  51. Add js code in <head> ... </head>:
  52.  
  53. <script src="js/AC_RunActiveContent.js" language="javascript"></script>
  54.  
  55. Add div code for load swf file in <body> ... <body>:
  56.  
  57. <div id="preview_swf">
  58. <script language="javascript">
  59. if (AC_FL_RunContent == 0) {
  60. alert("This page requires AC_RunActiveContent.js.");
  61. } else {
  62. AC_FL_RunContent(
  63. 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
  64. 'width', '590',
  65. 'height', '300',
  66. 'src', 'preview',
  67. 'quality', 'best',
  68. 'pluginspage', 'http://get.adobe.com/flashplayer/',
  69. 'align', 'middle',
  70. 'play', 'true',
  71. 'loop', 'true',
  72. 'scale', 'showall',
  73. 'wmode', 'window',
  74. 'devicefont', 'false',
  75. 'id', 'preview',
  76. 'bgcolor', '#000000',
  77. 'name', 'preview',
  78. 'menu', 'true',
  79. 'allowFullScreen', 'false',
  80. 'allowScriptAccess','sameDomain',
  81. 'movie', 'preview',
  82. 'salign', ''
  83. ); //end AC code
  84. }
  85. </script>
  86. <noscript>
  87. <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553541111" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="590" height="300" id="preview" align="middle">
  88. <param name="allowScriptAccess" value="sameDomain" />
  89. <param name="allowFullScreen" value="false" />
  90. <param name="movie" value="preview.swf" />
  91. <param name="quality" value="high" />
  92. <param name="bgcolor" value="#000000" />
  93. <embed src="preview.swf" quality="high" bgcolor="#000000" width="590" height="300" name="preview" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://get.adobe.com/flashplayer/" />
  94. </object>
  95. </noscript>
  96. </div>
  97.  
  98. If you use the method,you need notice the xml file path.For example:
  99.  
  100. index.html -> xmlbaner.swf
  101. the swf files and the xml must the same path like load index path.
  102. service path files like
  103. root/ index.html
  104. root/ xmlbanner.swf
  105. root/ data.xml
  106. root/ image/...
  107. From: http://activetofocus.com/blog/how-to-install-swf-in-website-28/

URL: http://activetofocus.com/blog/how-to-install-swf-in-website-28/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.