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
(added info on sizing using flash filter (?d=widthxheight))
 
(51 intermediate revisions by 14 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.


If you have the multimedia filter 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. However, you can control display size by adding the following parameters to the link to specify size: ?d=widthxheight eg ?d=800x600 is 800 pixels wide 600 pixels high.
==General instructions for insertion==
If you have the [[Filters|filter]] for the Flash [[Multimedia plugins|multimedia plugin]] enabled then simply linking to the file in an [[HTML in Moodle|HTML]] area such as a [[Label|label]], [[HTML block]] or [[Course sections#Editing_sections|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"<br>  codebase=<br> "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"><br>  <param name="movie" value="http://yoursite.org/file.php/2/movie.swf" /><br>  <param name="quality" value="high" /> <embed width="600" height="400" <br> src="http://yoursite.org/file.php/2/movie.swf" quality="high" <br> type="application/x-shockwave-flash" <br> 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 [http://moodle.org/mod/forum/discuss.php?d=29588 Size of embedded Flash] forum posts for some hacks.
 
===Update 2008===
The following code works in IE7 and Firefox 3:
 
<pre>
<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" />
</pre>
 
==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 Pages|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


There are also other ways to achieve sizing control. See the forum posts below for some hacks.
4. Paste the HTML code that will play the flash file in front or after your words (see below for an example:
: <nowiki><a href="http://localhost/IT_Pro.swf">http://localhost/IT_Pro.swf</a></nowiki>


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
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. 


<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: 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" />
</object></nowiki>


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==
This is not a comprehensive list nor an endorsement of any product.
*[http://www.openoffice.org/ Open Office, an open source program] can export-create a Flash swf file in Impress, the presentation module.  Very basic output.
*[http://www.adobe.com/products/flash/ Adobe/Macromedia Flash site] "The" serious program, now owned by Adobe and part of their Creative Suite.
*[http://www.debugmode.com/wink/ Wink] freeware program. Basic output functions, steps up from OO Impress but not even close to Adobe Flash.
*[http://osflash.org/projects Open Source Flash Organization] list of projects probably best viewed by developers, not teachers
*CamStudio (open source) [http://camstudio.org camstudio.org]
*Jing (free, but not open source) [http://www.jingproject.com jingproject.com]


==See also==
==See also==
*[[Filters (administrator)]]
 
*[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://www.macromedia.com Macromedia]
*[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
*[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]]


[[Category:Administrator]]
[[fr:Flash]]
[[Category:Teacher]]
[[ja:Flash]]
[[pl:Flash]]
[[ru: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