Flash module add-on: Embed flash files in HTML

Flash module add-on: Embed flash files in HTML

by Lorena de la Flor -
Number of replies: 18

Hi,

I am trying to include a flash (swf) file into a web resource. I copy the html code directly into the html editor (with the <> option pressed) but I get an error when the page is shown on the web.

I suppose that for any security reason it is not allowed to include flash files directly in the content pages. I have seen this flash module. If I install it it will solve my problem? or it is for another thing.

I don´t need at this moment any registration of the behaviour of the student inside the flash, I just need to show the animation.

If it is not with this module, how can I include a normal flash inside an HTML in a content resource?

Thank you for your help,

Lorena.

Average of ratings: -
In reply to Lorena de la Flor

Re: Flash module add-on: Embed flash files in HTML

by Kristian Besley -
Hi Lorena,

This can be done, but it's not a simple case of referring to the SWF file locally. I've tested this from an absolute URL and it works fine.

Firstly, go into the Files window (Administration block>Files) and then find the location of the SWF file you intend to use (in Firefox, right-click on the SWF file and select Properties) and copy the location.

Then use this full location in the Flash embed code. Here's my example:

<object width="320" height="240" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,15,0">
  <param name="movie" value="http://servername/moodle/file.php/77/camera_vector.swf" />
  <param name="quality" value="high" />
  <embed width="320" height="240" src="http://servername/moodle/file.php/77/camera_vector.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" />
</object>

There might be another way to do this which isn't absolute, but I'm sure this will do the job for now.

Hope this helps,

Kris



In reply to Kristian Besley

Re: Flash module add-on: Embed flash files in HTML

by Domenico Pontari -

In a wiki page I tried to add these lines:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="550" HEIGHT="400" id="myMovieName">
<PARAM NAME="movie" VALUE="myFlashMovie.swf">
<PARAM NAME="quality" VALUE="high">
<PARAM NAME="bgcolor" VALUE="#FFFFFF">
<EMBED src="
http://learning.elis.org/file.php/16/oratorio.swf" quality="high" bgcolor="#FFFFFF" WIDTH="550" HEIGHT="400"
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="
http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>

but it doesn't work.

Any suggestion?

Thanks,

Fair

In reply to Domenico Pontari

Re: Flash module add-on: Embed flash files in HTML

by Kristian Besley -

Hi,

A couple of things stand out. Here's the most severe:

You have a location pointed in your embed tag but not in your object code. For all browsers you need the same info in both places. Like this:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0
"
WIDTH="550" HEIGHT="400" id="myMovieName">
<PARAM NAME="movie" VALUE="http://learning.elis.org/file.php/16/oratorio.swf">
<PARAM NAME="quality" VALUE="high">
<PARAM NAME="bgcolor" VALUE="#FFFFFF">
<EMBED src="
http://learning.elis.org/file.php/16/oratorio.swf
" quality="high" bgcolor="#FFFFFF" WIDTH="550" HEIGHT="400"
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="
http://www.macromedia.com/go/getflashplayer
">
</EMBED>
</OBJECT>

If you are testing in Firefox, I'd wager that the movie would appear. Otherwise in IE it won't.

Kris

In reply to Kristian Besley

Re: Flash module add-on: Embed flash files in HTML

by Patrick Hodgkins -

Thanks Kris,

Your code did the trick (in IE7 anyway). I can now produce some Flashy courses!

Pat

In reply to Domenico Pontari

Embed flash files in HTML

by Jeet Thakur -
Hi,
This file run but first of all you have to open this file in dreamviewer then double click on this file and you will get a play button below click on this button after this it will run properly without problem.

Good day

smartasjet@yahoo.co.in
In reply to Kristian Besley

Re: Flash module add-on: Embed flash files in HTML

by Marcela Harris -
Hi Kris, thanks sooooo much for your help!
Kisses from Argentina!
Marcela.
In reply to Lorena de la Flor

Re: Flash module add-on: Embed flash files in HTML

by Just H -
Hi Lorena

I have a Flash piece running in a course. All I did was "add a resource", "link to a file or website" and entered the url of the swf file (can link to html page I embedded it in but prefered to just go straight to swf file) that I had uploaded into the course folder in moodledata.

Hope that helps somehow.

Regards
H
In reply to Just H

Re: Flash module add-on: Embed flash files in HTML

by Angela Jackson -

Harry,

Have you experienced an issue where the Flash file does not play in IE, but plays in Firefox?  We have that problem.  Anybody know the fix for that?

Angela

In reply to Angela Jackson

Re: Flash module add-on: Embed flash files in HTML

by Just H -
Hi Angela

Sorry but can't say I have. Only have half a dozen or so at the moment but have had no feedback that there is an issue with IE.

Not too sure but I would have thought that as long as IE had the relevant Flash Player installed then it should work.

Hope you figure out what the problem is.

regards
Harry
In reply to Angela Jackson

Re: Flash module add-on: Embed flash files in HTML

by Kristian Besley -

Hi Angela,

I did post a reply in the thread you created about this... (or was it for someone else?!?)

When one can see the swf but the other can't, it is usually to do with the markup.

Specifically, it is the <embed> and <object> markup. You (might) have your <embed> markup pointing to the swf in one location, whilst your <object> markup is pointing to the swf somewhere else where it doesn't exist.

IE uses <object> and Firefox (and everything else) uses <embed>.

I'd strongly recommend you check both are pointing to the correct location. If it was you I replied to elsewhere, then your IE <objetc> markup was pointing to the swf in the same folder, whilst the swf was in a subfolder (correctly located in the firefox <embed> markup).

Kris 

Average of ratings: Useful (1)
In reply to Angela Jackson

Re: Flash module add-on: Embed flash files in HTML

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Angela,

The most likely cause of Flash not playing in IE is an error in the object tag. (All other browsers use the embed tag.)
e.g. <object width="600" height="400" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">

Please check the discussion Using Flash for an example of a problem with the classid attribute.
In reply to Helen Foster

Re: Flash module add-on: Embed flash files in HTML

by Kristian Besley -

Easiest way to check what the problem is is to post the html code or a link to the webpage.

Kris

In reply to Angela Jackson

Embed flash files in HTML

by Jeet Thakur -
Hi,
Open your file in Dreamviewer then double click on the *.swf file and click on given below play button. It will run properly on any browser. After all it not run then install ActiveX control.

Bye

smartasjet@yahoo.co.in
In reply to Jeet Thakur

Re: Flash module add-on: Embed flash files in HTML

by Matt Bury -
Picture of Plugin developers
Hi,

If all you want to do is display a .swf file, this activity module will do it without any problems at all. It's also particularly easy to use and you don't have to write a single line of code: http://code.google.com/p/moodle-swf/
Average of ratings: Useful (1)
In reply to Angela Jackson

Re: Flash module add-on: Embed flash files in HTML

by yonney atsu -

I seems to have a problem opposite to yours. I have two swf buttons on my frontpage. They displays fine in IE but donnot show at all in the other browsers.

Has anybody experience this too or better still any solution.

Below is the swf code

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="684" height="254" id="FlashID">
  <param name="movie" value="http://www.cornwallnhsmoodle.co.uk/NEWCFT_EMBLEM.swf" />
  <param name="play" value="true" />
  <param name="bgcolor" value="#ffffff" />
  <!--[if !IE]>-->
  <object type="application/x-shockwave-flash" data="http://www.cornwallnhsmoodle.co.uk/NEWCFT_EMBLEM.swf" width="684" height="254">
   <param name="play" value="true" />
   <param name="bgcolor" value="#ffffff" />
  <!--<![endif]-->
   <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>
  <!--[if !IE]>-->
  </object>
  <!--<![endif]-->
 </object>

In reply to yonney atsu

Re: Flash module add-on: Embed flash files in HTML

by Matt Bury -
Picture of Plugin developers

Hi,

A quick update. The SWF Activity Module is on: http://code.google.com/p/swf-activity-module/

@Yonney, if you want to embed a .swf on a front page, I'd custom code a Moodle block. That way, the HTML embed code doesn't go through Moodle's text filters and it'll work independently of Moodle admin settings.

In reply to Matt Bury

Re: Flash module add-on: Embed flash files in HTML

by luigi falco -

Hi all,

i was promoted few dyas ago to administrator of an e-learning course... i think this course use an old version of moodle. i need to embed an swf file on a text page but it's impossible... i'm not in front of server now and i can't access to mod directory to upload the swf activity module so... iit's stil possible to do it by editing the code like it's showed in this video?

http://ethosconsultancynz.ning.com/video/how-to-embed-an-swf-into-a

if yes i need the code... thak you for replies... smile

 

luigi

 

In reply to luigi falco

Re: Flash module add-on: Embed flash files in HTML

by Matt Bury -
Picture of Plugin developers

Hi Luigi,

There's lots of tools, resources and tutorials on how to embed Flash here:

http://code.google.com/p/swfobject/

It's not actually possible to use Javascript embed methods in Moodle web pages but the SWFObject generator can generate static HTML code that'll work without the SWFObject JS code being present. Beware though, Moodle has a habit of "messing with" Flash embed code and URLs so it may not always work. That's one of the reasons for using a dedicated Flash module or filter in Moodle.

I hope this helps!