『 Plug-in “WP-Al-SWFObject” embeds Flash on WordPress 』

2009 年 5 月 18 日

This entry is English version of the Japanese one. I’m sorry I’m not good at English. If you find any mistakes, please let me know.

WP-Al-SWFObject
I made the plug-in to embed on the entry of WordPress easily, so it introduces it. This is powerful plug-in for embedding swf on WordPress. It is possible to specify parameters more in detail than WP-SWFObject.

Download
How to use
・How to use (In a location other than the entry)
Control panel
Examples
Version of SWFObject used
License

- Download
>>Download (Enblish)
>>Download (Japanese)

- How to use

  1. The wp-al-swfobject folder is created by defrosting downloaded zip, and you up-load the folder to the wp-content/plugins directory of the server.
  2. The WP-Al-SWFObject plug-in is made effective from set screen -> plug-in of WordPress.
  3. Describe the following codes at the position in which you want to embed swf. Please replace [ /embedSWF] with [/embedSWF].
[embedSWF]swf, width, height, align, version, expressInstall, flashvars, params, attributes[ /embedSWF]

The parameter of the deficit is indispensable, and other parameters is optional (It is possible to omit it).

  • swf(indispensable) ・・・ The path to embedded swf
  • width(optional) ・・・ The width of swf.  If you omit it, the default value specified on a control panel is used.
  • height(optional) ・・・ The height of swf. If you omit it, the default value specified on a control panel is used.
  • align(optional) ・・・ The position of swf. You can choose from the “left”, the “right”, or the “center”.
    If you omit it, the value isn’t specified especially.
  • version(optional) ・・・ The version of necessary FlashPlayer. It becomes 9.0.0 when omitting it.
  • expressInstall(optional) ・・・ The path to express-install-swf. It is displayed when the player doesn’t meet the requirement. SWFObject default “expressInstall.swf” is displayed when omitting it.
  • flashvars(optional) ・・・ The flashvars a.k.a the variable that html passes swf. It is described by the format {name1:”value1″, name2,”value2″}.
  • params(optional) ・・・ The parameters when swf is embedded is described by flashvars and the same format.
  • attributes(optional) ・・・ The attributes on html when swf is embedded is described by flashvars and the same format.

・How to use (In a location other than the entry)
If you want to paste swf to the outside of the entry (For example, header and sidebar), you can call the following php function in where you want to paste swf.

<?php wp_al_swfobject_echo('[embedSWF]swf, width, height, align, version, expressInstall, flashvars, params, attributes[/embedSWF]'); ?>

- Control panel
The default value of each parameter can be set from the plug-in Control panel.
The default value is applied to all swf embedded by WP-Al-SWFObject.
The priority level when the same variable is set in two or more parts becomes the following.

Settings in [embedSWF] tag > {name1:”value1″, name2:”value2″} at Control panel > Supplementary setting in control panel(only params can be set).

It is overwrited by the variable with a high priority level. Moreover, for flashvars and params and attributes, the superscription is judged individually in each variable.

For instance, when the following code is set from Control panel,

aaa:"30", bbb:"50"

flashvars (aaa=”50″, bbb=”30″) is passed to all embedded swf by using WP-Al-SWFObject. Under such a condition, as follows is done and swf is embedded.

[embedSWF]hoge.swf,,,,,,{aaa:"10"}[ /embedSWF]

In this case, because variable aaa is alse specified with flashvars in [embedSWF] tag, the default value is not applied to variable aaa. In a word, this swf will receive flashvars as aaa=”10″, bbb=”50″.

- Example
It embeds without specifying the option (Be set it to 300 in width and 50 in height on the Control panel).

[embedSWF]hoge.swf[ /embedSWF]

This movie requires Flash Player 9.0.0

 

Next, width and height are embedded specifying it.

[embedSWF]hoge.swf, 200, 100[ /embedSWF]

This movie requires Flash Player 9.0.0

 

Next, it makes to right adjust, and flashvars is passed.

[embedSWF]hoge.swf, 200, 100, right,,,{aaa:"10"}[ /embedSWF]

This movie requires Flash Player 9.0.0

 

Next, the id and the name attribute of html are added.

[embedSWF]hoge.swf, 200, 100,,,,{},{},{id:"sample", name:"sample"}[ /embedSWF]

This movie requires Flash Player 9.0.0

 

Next, all parameters are specified (Flashplayer 9.0.0 or later is required. When the player version is low, http://hogehoge.jp/alt.swf is displayed. The variable named aaa=10 is passed to swf. The context menu is not given. The connection between html and swf is always permitted. The id and the name attribute of html is sample).

[embedSWF]hoge.swf, 400, 360, center, 9.0.0, http://hogehoge.jp/alt.swf, {aaa:"10"}, {menu:"false", allowScriptAccess:"always"}, {id:"sample", name:"sample"}[ /embedSWF]

This movie requires Flash Player 9.0.0

 

- Version of SWFObject used
You can switch the version of SWFObject on COntrol panel (It is 2.1 in default).
It corresponds to version from 1.5 to 2.2. But, Callback method that is the new features included of 2.2, and the attributes of 1.5 cannot be specified at current version.

- license
GPL license. Because WP-SWFObject that is origin of WP-SWFObject is GPL license.

« 
» 

Leave a Reply