Note: You are currently viewing documentation for Moodle 2.5. Up-to-date documentation for the latest stable version of Moodle may be available here: Flash.

Flash: Difference between revisions

From MoodleDocs
(→‎Insert flash into a lesson page: put in an example that works on my localhost :))
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Working with media}}{{Update}}
Flash content can easily be included in your courses.
Flash content can easily be included in your courses.


Line 22: Line 24:


==Insert captivate into Moodle==
==Insert captivate into Moodle==
See [[Adobe captivate]] for exporting a SCROM file and bringing that into Moodle.
See [[Adobe captivate]] for exporting a SCORM file and bringing that into Moodle.


==Insert flash into a lesson page==
==Insert flash into a lesson page==
Inserting a Flash file into a [[Lesson Pages|lesson page]] (either a branch or question page) is similar to the above.
Inserting a Flash file into a [[Lesson Pages|lesson page]] (either a content or question page) is similar to the above.
===Simple example===
===Simple example===
1. Place a swf file on your server that can be found with a URL address
1. Place a swf file on your server that can be found with a URL address
Line 41: Line 43:
===Example that sizes flash display window===
===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.   
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 . 


<nowiki><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" />
<nowiki><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" />
Line 46: Line 50:


Notice that both the file location and frame size appears 2 times in the code.  Be sure to change both for best results.
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":
:<nowiki>http://localhost/moodle199/file.php/3/Lesson01/IT_Pro.swf</nowiki>
You can plug that value into the above code to get:
:<nowiki><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></nowiki>
===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==
==Some external links to Flash file generating programs==
Line 57: Line 74:


==See also==
==See also==
*[[Flash_module]] How to install a Flash plugin module.
 
*[[Files]] for teachers
*[[Filters]] part of the administration block
*[http://moodle.org/mod/forum/discuss.php?d=37119 Multimedia plugin vs object embed] forum discussion
*[http://moodle.org/mod/forum/discuss.php?d=37119 Multimedia plugin vs object embed] forum discussion
*[http://moodle.org/mod/forum/discuss.php?d=29588 Size of embedded Flash] forum discussion
*[http://moodle.org/mod/forum/discuss.php?d=29588 Size of embedded Flash] forum discussion
*[http://code.google.com/p/swf-activity-module/ SWF Activity Module] - A user friendly Flash embed method ideal for learning interactions also provides framework for pushing grades into Moodle's grade book
*[https://github.com/matbury/SWF-Activity-Module1.9 SWF Activity Module for Moodle 1.9] - A user friendly Flash embed method ideal for learning interactions also provides framework for pushing grades into Moodle's grade book
*[http://code.google.com/p/moodle-mplayer/ Media Player module] A user friendly Flash video embed method which also supports YouTube.com and a whole host of interactive plugins
*[http://code.google.com/p/moodle-mplayer/ Media Player module] A user friendly Flash video embed method which also supports YouTube.com and a whole host of interactive plugins
*[https://github.com/matbury/SWF-Activity-Module2.5 SWF Activity Module for Moodle 2.5+] - An entirely free and open source replacement for both the SWF Activity Module and Media Player module for Moodle 2.5 and later.
* [[Screencasts]]
* [[Screencasts]]
[[Category:Administrator]]
[[Category:Teacher]]


[[fr:Flash]]
[[fr:Flash]]

Latest revision as of 21:03, 19 September 2013

This page requires updating. 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