Embedding the swf (gallery flash file) onto a html page using swfobject (2.1) To learn more about swfobject go here: http://code.google.com/p/swfobject/wiki/documentation
Prepare: Put the following files (to be uploaded) in the same directory as your html page: |
|---|
You need to add two code blocks on your html page when using swfobject 2.1: 1. Add the first code block inside the <body></body> tags of your page, where you want the gallery to appear. Give your flash gallery to be embedded a unique id. Example: myContent. |
|---|
| <div id="myContent"> <h1>Alternative content</h1> <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p> </div> |
|---|
2. Add the second code block inside the <head></head> tags of your page: For basic embedding (no fullscreen, flashplayer 8 can be targeted) |
|---|
<script type="text/javascript" src="swfobject.js"></script> |
|---|
Blue = path to swf file, your unique id (can be any name), desired width, desired height, flashplayer version required. |
|---|
To enable fullscreen mode ( flashplayer 9.0.28.0 or higher must be targeted) Update the second code block to enable fullscreen mode, by adding a params object: |
|---|
| <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> var params = {}; params.allowFullScreen="true"; swfobject.embedSWF("G06_Standalone.swf","myContent","500","380","9.0.28.0", false, false, params); </script> |
|---|
Blue = Create params object and set allowFullScreen to true. |
|---|
Add flashvars to control color of initial loading sequence Update the second code block by adding flashvars objects: |
|---|
<script type="text/javascript" src="swfobject.js"></script> var flashvars = {}; |
|---|
Blue = Create flashvars object and set colors (hex value, but no prefix!) for initial loadingsequence. |
|---|
ADVANCED: (Add additional flashvars to control paths and names of required files, setting up multiple galleries) You can use flashvars to control paths and names of required files. Useful if making multiple galleries, or if you need for a required folder/file to be somewhere else on your server. Flashvars are: setupXmlPath = G_setup.xml Add like below: |
|---|
<script type="text/javascript" src="swfobject.js"></script> var flashvars = {}; |
|---|
"newPath/../..newPath/newName.xml"; = set the new path and name for the file/folder. So for instance, if you wanted another gallery on the page, the easiest thing for you to do is simply copy and rename G_images.xml, and then use imagesXmlPath flashvar to direct the next embedded gallery to the new xml. |
|---|