WordPress Quick Tips

Plugin: Easy Flash Embed

Embed Flash easily and standard compliant with SWFObject using only a [swf] shortcode!

In the text editor simply write something like:

[swf src="http://www.example.com/my-flash-file.swf" width=300 height=100]

The attributes src, width and height are required

Additional attributes includes:

  • params
  • flashvars

The attributes params, and flashvars should be written like “flashvar1=value&flashvar2=value” to function properly

To provide alternative content for people without Flash, simply put some text between the [swf] brackets, e.g.

[swf src="http://www.example.com/my-flash-file.swf" width=300 height=100]You must have Flash to view this file[/swf]

Installation

  1. Upload /easy-flash-embed/ to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Use the [swf] shortcode in the text editor as described in the description

Download

Download here

41 Responses to "Plugin: Easy Flash Embed"

Awesome plug-in. Super easy to use. One thing I noticed is that if you have multiple params the SWFObject embed codes includes the html char code for “&” in the param name.

Example:

[swf src="http://mysite.com/some.swf" width=530 height=410 params="wmode=transparent&quality=high&bgcolor=#F5F5F5"]

I get this output :

{“wmode”:”transparent”,”#038;quality”:”high”,”#038;bgcolor”:”#F5F5F5″}

Thanks again for an great WP plugin.

Thank you for your input.

It should be an easy fix, check for a 1.1 update later today!

It’s fixed and uploaded. Didn’t quite feel I needed to make it 1.1 though!

Hi Vincent

I’m trying to show a camtasia5-produced .swf video (I also have the .html & _controller.swf files, etc).

I’ve installed your plugin but don’t see a control button for inserting a video. So I’ve just inserted this code:
[swf src="http://www.myfile.swf" width=480 height=378]

I’ve also tried this with the _controller.swf file.

However, I can’t get a player controller skin around my .swf video – it presents just the same as before I used your plugin, without a controller , and just plays automatically.

Please could you clarify:
* how do I use the plugin for the above?
* how I can get the video to show with a controller skin?

Please forgive me if I’m missing a trick here!

Many Thanks

Make sure you know which .swf file to embed. I don’t know the specifics on embedding a Camtasia video, but if you have older embed-HTML look at the code for reference. Perhaps you’re missing some flashvars or params!

Hey there, trying to get your plugin to work. I have a swf hosted that is larger than I’d like, and the width/height params seem to crop not scale. How can I tell it to scale proportionally?

It also doesn’t appear to play the video, although the first frame/buttons appear onscreen.

How Flash files scale depends on the Flash file

I am having an issue embedding a flash slideshow with your plugin. I keep getting this error:

“Sorry, xml file not loaded”

Any suggestions? Is there a specific location I should place the xml file?

I think that’s a question for the Slideshow developer. It’s impossible for me to know!

Would it be possible for you to post the proper way to include a flashvar for swf file to read an xml file?

Again, that’s hard for me to do without knowing the specifics. But, if the variable name is “xmlFile” and the path to your XML-file is “/xmls/myfile.xml” you would include it like this:

[swf src="http://www.example.com/my-flash-file.swf" width=300 height=100 flashvars="xmlFile=/xmls/myfile.xml"]You must have Flash to view this file[/swf]

Again, this is not a working example since I don’t know the details of your flash file. I hope it helps!

Excellent! That is all I needed, thanks!

What’s the proper way to code the swf to not autoplay?

How to not autoplay what?

I want to embed the flash movie but I don’t want it to start playing when the browser window loaded. The user needs to click play first. I tried the play=false param but this shows a blank pane.

Ok, how does your shortcode look?

[swf src="http://mywebsite.com/wp-content/uploads/2010/03/mymovie.swf" width=300 height=200 params="play=false"]

It looks right! Perhaps it’s your flash file

how to make a button to play a flash after you turn off a false

Hi, I’m trying to embed a video in the header.php file. The video won’t show – just the text of the code. Am I missing something? Code I’m using is:

[swf src="http://www.eynp.com/spirtualawakening/images/BirdFlying3e.swf" width=300 height=100]You must have Flash to view this file[/swf]

Thanks, Karen

The plugin is supposed to be used within the content area.

Perhaps you could write
echo apply_filters( 'the_content', '[swf src="http://www.eynp.com/spirtualawakening/images/BirdFlying3e.swf" width=300 height=100]You must have Flash to view this file[/swf]' );

I seem to have the same problem as many above. The video just automatically plays when the post is loaded and there is no way to have the control bar on the bottom of the video.

I want the reader to have to click play to start the video. How can this be done?

[...] Plugin: Easy Flash Embed [...]

I am not very experienced in flash and hopefully you can answer this question.

I have WP3.1 and am using your plugin. I have an advertiser that supplied me wiht a SWF file and I have uploadaed it to my media library.

I have installed that location into your short code whihc is in a widget in the side bar. It displays properly

The question I have is that it says “click here for tickets” and I need to get the image “clickable”

How do I do that?

Anything that happens within the Flash-movie can’t be altered from WordPress. Hope you find help elsewere!

Hi,
I’m trying to place my flash file on a wordpress page and align it to the right hand side and let my body copy flow around it. Can you please help me with the shortcode to do this? I’ve tried a bunch of stuff and searched like crazy to try to find it, with no luck. Any help you can give would be appreciated.
Thanks!

That might be a tricky one. Perhaps edit in HTML-mode and wrap the [swf]-shortcode in a <div> that you float to the right.

Hi there,

Thanks for creating this great plugin. Its very useful. I do have 1 little problem though, I am embedding a swf in my wordpress page, this swf calls other swf’s loaded into a target. When using this plugin the files aren’t loaded into the target when I click a button.( I know this because it works with an iframe). The way I understand it is that the plugin is stopping the embedded swf from loading external swf’s. The main swf is in the same folder as the swf being called. I have tried using an absolute and a relative path in the swf , both don’t work.

Any ideas ?
I hope to hear from you.

Hi Charl,

What the plugin actually does is to convert your [swf]-shortcode to the swfobject scripts needed to embed a Flash file. So if you see any Flash file at all, the plugin is working. Please refer to swfobject documentation to see if any help can be found there. I know cross-domain calls can be a hassle, so a good idea would be to check if that could be the cause of the problem as well.

I do not think the plugin is the cause of your problems, but if it turns out to be, please let me know what caused it!

Hello, I have installed the plug-in and embedded a basic swf that only contains animation. All of my browsers have the latest flash plugin installed but when I view the source of the rendered page I only get this on three different browsers…

You must have Flash to view this file

The shortcodes seem to match what you have on this site…
[swf src="/assets/InstallVideo2.swf" width=566 height=395]You must have Flash to view this file[/swf]

Any ideas?

My code example was modified by WP. When I view the source of the rendered page I only get this on three different browsers…

div id=”efe-swf-1″ class=”efe-flash” — You must have Flash to view this file — div

Are you using a custom theme? If so, are you including the wp_head and wp_footer functions in your header and footer? They’re used to include the scripts.

thanks for this useful plugin.. but how can i allow swf to works with fullscreen button? i tried [swf src="http://www.blablabla.com/files/video/video_player.swf" allowfullscreen=true width=600 height=400 ]You must have Flash to view this file[/swf]

but it didn’t work …

omg.. sorry for the unuseful post.. i found my mistake .. this is the right one which works… [swf src="http://www.blablabla.com/files/video/video_player.swf" params="allowfullscreen=true" width=600 height=400 ]You must have Flash to view this file[/swf]

Great! Nice to see that you solved it yourself!

[...] SWF embeds we are using swf object and a WordPress plugin called Easy Flash Embed SWF files have to be hosted on a server and posted by using the following code: <div [...]

Is there a way to use this plugin with a script instead? I mean, not with WordPress but on another site or blog. I wish SWFObject was this easy…

Hi Vincent,

it´s possible to make a link in the shortcode inside ?

Hi, I don’t think I know what you mean?

Im trying to embed in wordpress a game that uses an .xml file for a config i tried this:
[swf src=/acroblast_flash/acroblast.swf" width=750 height=810 params="wmode=transparent" FlashVars="xmlFile=/acroblast_flash/sfs-config.xml][/swf]

But it does not work is this wrong? I can embedd the flash in an HTML file just fine and it works fine…….. Thanks!

You seem to be missing some quotes. The first one in the src-argument, and the last one in the flashvar-argument. Also, try to see if typing flashvars in all lower case might help.
[swf src="/acroblast_flash/acroblast.swf" width=750 height=810 params="wmode=transparent" flashvars="xmlFile=/acroblast_flash/sfs-config.xml"][/swf]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

About

WordPress Quick Tips is a blog supplying great tips about WordPress.

We hope to create a great knowledge resource for WordPress developers as well as serving a reminder for all the forgetful ones.

The blog is created and run by Vincent of Oakwood Creative

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 86 other followers

Follow

Get every new post delivered to your Inbox.

Join 86 other followers