Note: You are currently viewing documentation for Moodle 2.3. Up-to-date documentation for the latest stable version is available here: Flash.

Flash

From MoodleDocs

This page requires updating for Moodle 2.3. Please do so and remove this template when finished.


Flash content can easily be included in your courses.

General instructions for insertion

If you have the filter for the Flash multimedia plugin enabled then simply linking to the file in an HTML area such as a label, HTML block or section description will also display the Flash file inline. At the moment all flash files will play at the same size site-wide by default.

You can use HTML code and the object tag to set individual movie sizes which will work with most browsers except Microsoft's Internet Explorer.

<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">
<param name="movie" value="http://yoursite.org/file.php/2/movie.swf" />
<param name="quality" value="high" /> <embed width="600" height="400"
src="http://yoursite.org/file.php/2/movie.swf" quality="high"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>
TIP: If using the .swf filter you can control display size by adding the following parameters to the end of the link to specify size: ?d=widthxheight (for example ?d=600x400 where the image is 600 pixels wide 400 pixels high). You can use up to 3 characters for the width and the height, plus an optional % symbol at the end.
TIP: There are also other ways to achieve sizing control. See the Size of embedded Flash forum posts for some hacks.

Update 2008

The following code works in IE7 and Firefox 3:

<embed width="600" height="400" type="application/x-shockwave-flash" 
src="http://YOURSITE.com/path/to/your/swffile/swf" 
id="myFlashId" bgcolor="#ffffff" quality="high" wmode="opaque" />

Insert captivate into Moodle

See Adobe captivate for exporting a SCORM file and bringing that into Moodle.

Insert flash into a lesson page

Inserting a Flash file into a lesson page (either a content or question page) is similar to the above.

Simple example

1. Place a swf file on your server that can be found with a URL address

For example, place the file "IT_Pro.swf" in the web root. This might be in your htdocs or www folder of your webserver

2. Go to a Lesson page in edit mode. If you want text to appear above or below the flash object, place your words in the content area, then

3. Use the "Toggle the HTML source" icon to switch to TEXT MODE

4. Paste the HTML code that will play the flash file in front or after your words (see below for an example:

<a href="http://localhost/IT_Pro.swf">http://localhost/IT_Pro.swf</a>

5. Set the jumps on the lesson page

6. Save the page.

Example that sizes flash display window

You can use some object code to control the display size of the swf file. Here is some code used on a localhost to display an image in a 600x400 pixel frame in a Branch Table page. The file is in the same location as the simple example above.

TIP: This was tested in Moodle 1.9.9 .

<object height="400" width="600" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> <param value="http://localhost/IT_Pro.swf" name="movie" /> <param value="high" name="quality" /> <embed height="400" width="600" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" src="http://localhost/IT_Pro.swf" /> </object>

Notice that both the file location and frame size appears 2 times in the code. Be sure to change both for best results.

TIP: You can play a swf file uploaded into your course. For example, in the course Files, a folder Lesson01 was created and the IT_Pro.swf file place there. By clicking on the swf file name, you should see a popup window with the playing swf file. Copy the URL address at the top. For example here is the URL for the file on a localhost that is located in the course Files, in a folder called "Lesson01":
http://localhost/moodle199/file.php/3/Lesson01/IT_Pro.swf

You can plug that value into the above code to get:

<object height="400" width="600" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> <param value="http://localhost/moodle199/file.php/3/Lesson01/IT_Pro.swf" name="movie" /> <param value="high" name="quality" /> <embed height="400" width="600" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" src="http://localhost/moodle199/file.php/3/Lesson01/IT_Pro.swf" /> </object>

Possible code tweak needed in Lesson

Based upon Lesson forum discussions, in Moodle 1.9.9 (and probably earlier versions),the ./mod/lesson/view.php code was tweaked so the line

format_text($page->contents, FORMAT_MOODLE, $options).

was changed to:

format_text($page->contents, FORMAT_HTML, $options).

And of course the Site administration >Modules>Filters> Manage filers "Multi media" should be active and under Multi Media Plugins "swf files" enable.

Some external links to Flash file generating programs

This is not a comprehensive list nor an endorsement of any product.

See also