General plugins

Flash module add-on: Size of Embedded Flash

 
Picture of Alan Wolf
Flash module add-on: Size of Embedded Flash
 

    I'm trying to embed some flash based questions into the Book Module. I can get the flash embedded, and the questions work (they're just survey questions for reinforcing concepts and not tied in as a Scorm package), but I can't figure out how to change the size of the flash presentation (It's too small for my purposes).  How do I change the size of the flash presentation?
     Since I'm doing this within the Book Module, I assume that the Flash Module would not be what I need to explore.  My reading indicates that there is a size function in the Flash Module- I need that sizing for the flash embedded in the Book module.
     Many thanks for any help you can provide. 

   

 
Average of ratings: -
Picture of Helen Foster
Re: Flash module add-on: Size of Embedded Flash
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersTestersTranslators
Hi Alan,

To change the size of your flash movie you may add code (in text mode), rather than linking to the movie e.g. movie size 600 x 400

<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>
 
Average of ratings: -
Ralf Krause - Germany
Re: Flash module add-on: Size of Embedded Flash
Particularly helpful MoodlersPlugin developersTranslators
Hi Helen,
if you change this inside the file ./filter/mediaplugin/filter.php then you will get all flsh animations with the new size 600*400. If you try to change the size by putting in this code into a quiz your site will only work with Firefox but not with Internet Explorer. The mediaplug filter kills your code.
Ralf
 
Average of ratings: -
Picture of julian inglis
Re: Flash module add-on: Size of Embedded Flash
 
I'm trying to use flash in my quiz section as well as other parts of my course, and I need them to be different sizes. From what I understand, it is impossible to have different sized flash media in different parts of the course?!

As mentioned, it works fine with Firefox if you specify the size, but not IE.  Despite my ardent  wish that  everyone in the world throw out  IE and embrace Firefox, I don't think I would  be able to get  all my students to agree.

There must be some way around this. Why does it work with FF and not IE?  Anyone have any suggestions.
 
Average of ratings: -
Picture of Carlos Alarco
Re: Flash module add-on: Size of Embedded Flash
 
Alan or anyone else that can give me a hand.
I have tried to embed an .flv into a HTML block with no success.
If I make it a link, it works fine ... but not as a player embeded and playable from
the main page inside the HTML block.

Here is my code:

<object width="330" height="250" align="middle" id="test" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
<param value="sameDomain" name="allowScriptAccess" />
<param value="http://moodle.uvsc.edu/file.php/5/flv/test.swf" name="movie" /><param value="high" name="quality" /><param value="#000000" name="bgcolor" /><embed width="330" height="250" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowscriptaccess="sameDomain" name="test" bgcolor="#000000" quality="high" src="http://moodle.uvsc.edu/file.php/5/flv/test.swf" />
</object>


Thanks!
 
Average of ratings: -
Picture of mike cockburn
Re: Flash module add-on: Size of Embedded Flash
 
Hi Carlos,
You need to allow object embed tags in your site setup - allowobjectembed.
Better yet, you should try turning on the Multimedia Plugin - see filters. This may be a better option for you.
When you finally get Object embed tags working > make sure your audience can view your presentations in IE. There have been some problems with using that browser with the usual means.

We found this was resolved via installing flash files using the Multimedia Plugin.

Best Regards,

Mike
 
Average of ratings: -
Picture of Carlos Alarco
Re: Flash module add-on: Size of Embedded Flash
 
Mike,

Thanks for the info, the Multimedia plugin is already enabled. I set allowobjectembed to yes but still no go.
I can get it to work via by using an iFrame, but not the using the code.
I'll tinker arounf with it some some more.
Any other suggestions?

Thanks

Carlos
 
Average of ratings: -
Picture of mike cockburn
Re: Flash module add-on: Size of Embedded Flash
 
Carlos,
When you use the multimedia plugin you don't use the Object & embed tags. You link to the file and the plugin does the rest.
Have you tried this?
You need to get that link to screen seen below in Jamie's discussion of 5th Jan.

From Moodle Docs:
"Insert the URL of the multimedia resource into your text (which can be the URL of a file in the course files area). When displayed a suitable player will be provided. Moodle detects the media type using the filename extension, so you should ensure that the file contents match the extension correctly."

You may have already been there and done this Carlos, I'm just checking that you are across this.

Best Regards
Mike
 
Average of ratings: -
Picture of Carlos Alarco
Re: Flash module add-on: Size of Embedded Flash
 
Mike,

Thanks for your input.
I have created a link to the file inside the html block and it puts a link which when clicked opens up another window and it plays it fine.

What I want is that the .swf file, interface included, plays inside the HTML block.
Here is a picture of what we have done using an iframe
iframe inside a HTML block on main page

and here is the code.

<iframe style="width: 400px; height: 300px;" src="http://moodle.uvsc.edu/file.php/5/flv/robot.swf">
</iframe>
Works greats

When I try it as a link inside the HTML block I get this.
flash movie via URL link

note the "test" link, this opens up the flash movie inside another window, which is what I don't want.

Any thoughts, ideas ..ect...

Cheers,

Carlos
 
Average of ratings: -
Picture of Ruth Ruane
Re: Flash module add-on: Size of Embedded Flash
 
Hi I have searched without success. Where do I find site setup - allowobjectembed to turn this on. I am not using embedded flash to show movies here is the code I am using

and it works fine, just cannot adjust the size. It is too small. I tried object embed tags and regular size tags but nothing worked. Any help would be cool. Ruth
 
Average of ratings: -
Picture of Andrew Hu
Re: Flash module add-on: Size of Embedded Flash
 
Hi,

I think you will find this is controlled by 2 factors.

1. The themes CSS, open styles_layout.css and search for Modules: Resource it's around line 4083 in mine but I've modified the CSS. The different sizes for all resources are listed here change
.resourcecontent object {
height:480px;
width:600px;
}

to a size larger than your swf or the same size.

Realize this will be applied to all resources using the embed tag.

2. Go to and open mod/resource/type/file/resource.class.php
Around line 665 you will see

} else if ($resourcetype == "flash") {

This is were the html is written to display the Flash swf using embed tag.

Your param should read
param name="scale" value="aspect"
change it to
param name="scale" value="noscale"

This is probably not as good as linking to the html file with the Flash embedded and then you can control it completely on a case by case but it is much harder to pass session variables via Javascipt
 
Average of ratings: -
Picture of Jamie Pratt
Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Core developersDocumentation writersPlugin developers
Hi all,

This has been a much requested feature so I thought I'd spend a few minutes working on a way to allow the user to control the size of embedded .swf files.

Attached is a patch for the multimedia plugin to allow a user to set the required size to display a Flash .swf file.

I've replaced the yellow code below with the green code in filter/mediaplugin/filter.php  (if you're going to make the changes manually remove the minuses and pluses from the lines).

I've tested this on my site.

I'll post instructions for use in a reply to this post.

Jamie

     if (empty($CFG->filter_mediaplugin_ignore_swf)) {
-        $search = '/<a(.*?)href=\"([^<]+)\.swf\"([^>]*)>(.*?)<\/a>/is';
-
-       
$replace  = '\\0<p class="mediaplugin swf"><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
-       
$replace .= '
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
';
-        $replace .= ' width="400" height="300" id="mp3player">';
-        $replace .= " <param name=\"movie\" value=\"\\2.swf\" />";
-        $replace .= ' <param name="quality" value="high" />';
-        $replace .= ' <param name="AllowScriptAccess" value="never" />';
-        $replace .= " <embed src=\"\\2.swf\" ";
-       
$replace .= '  quality="high" width="400" height="300"
name="flashfilter" AllowScriptAccess="never" ';
-        $replace .= ' type="application/x-shockwave-flash" ';
-        $replace .= ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
-        $replace .= '</embed>';
-        $replace .= '</object></p>';
+       
$search =
array('/<a(.*?)href=\"([^<]+)\.swf\"([^>]*)>(.*?)<\/a>/is',
+                                   
'/<a(.*?)href=\"([^<]+)\.swf\?w=([0-9]*?)&h=([0-9]*?)\"([^>]*)>(.*?)<\/a>/is',
+                                   
'/<a(.*?)href=\"([^<]+)\.swf\?h=([0-9]*?)&w=([0-9]*?)\"([^>]*)>(.*?)<\/a>/is');
+
+       
$replace  = array('\\0<p class="mediaplugin swf"><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
+                           
. '
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
'
+                           
. ' width="400" height="300" id="mp3player">'
+                           
. " <param name=\"movie\" value=\"\\2.swf\" />"
+                           
. ' <param name="quality" value="high" />'
+                           
. ' <param name="AllowScriptAccess" value="never" />'
+                           
. " <embed src=\"\\2.swf\" "
+                           
. '  quality="high" width="400" height="300" name="flashfilter"
AllowScriptAccess="never" '
+                           
. ' type="application/x-shockwave-flash" '
+                           
. ' pluginspage="http://www.macromedia.com/go/getflashplayer">'
+                           
. '</embed>'
+                           
. '</object></p>',
+                           
+                           
'\\0<p class="mediaplugin swf"><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
+                           
. '
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
'
+                           
. ' width="\\3" height="\\4" id="mp3player">'
+                           
. " <param name=\"movie\" value=\"\\2.swf\" />"
+                           
. ' <param name="quality" value="high" />'
+                           
. ' <param name="AllowScriptAccess" value="never" />'
+                           
. " <embed src=\"\\2.swf\" "
+                           
. '  quality="high" width="\3" height="\4" name="flashfilter"
AllowScriptAccess="never" '
+                           
. ' type="application/x-shockwave-flash" '
+                           
. ' pluginspage="http://www.macromedia.com/go/getflashplayer">'
+                           
. '</embed>'
+                           
. '</object></p>',
+                           
+                           
'\\0<p class="mediaplugin swf"><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
+                           
. '
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
'
+                           
. ' width="\\4" height="\\3"  id="mp3player">'
+                           
. " <param name=\"movie\" value=\"\\2.swf\" />"
+                           
. ' <param name="quality" value="high" />'
+                           
. ' <param name="AllowScriptAccess" value="never" />'
+                           
. " <embed src=\"\\2.swf\" "
+                           
. '  quality="high" width="\4" height="\3" name="flashfilter"
AllowScriptAccess="never" '
+                           
. ' type="application/x-shockwave-flash" '
+                           
. ' pluginspage="http://www.macromedia.com/go/getflashplayer">'
+                           
. '</embed>'
+                           
. '</object></p>');
+                           
 
         $text = preg_replace($search, $replace, $text);
     }




 
Average of ratings: Useful (1)
Picture of Jamie Pratt
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Core developersDocumentation writersPlugin developers
In order to control the size and height of the embedded Flash .swf file you supply the width and height as parameters in the .swf url. You can add the width and height required to the url as follows :

http://localhost/moodle_15_stable/file.php/1/pfs.swf

Add width and height :

http://localhost/moodle_15_stable/file.php/1/pfs.swf?w=800&h=600

You can of course use the file browser pop up menu as normal and then add the required width and height to the url after you have browsed to the file you want to link to. See screen shot attached.

 
Average of ratings: Useful (2)
Picture of Jamie Pratt
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Core developersDocumentation writersPlugin developers
I tested this on ie and firefox.

Also tested with and without slasharguments turned on.

All seems to work fine.

You can reverse the h and w parameters ie :

?w=800&h=600

or

?h=600&w=800

Have the same result.

 
Average of ratings: -
Picture of Jamie Pratt
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Core developersDocumentation writersPlugin developers
If you think this should be put in Moodle 1.6 vote for it at the bug tracker :

Bug #4540


 
Average of ratings: -
Picture of N Hansen
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
 
I've found that the html editor eats the embedded flash lately. I can add embedded Flash but then when I open what ever has to embedded Flash in it again with the html editor to edit it, the Flash disappears. Do you know anything about this Jamie?
 
Average of ratings: -
Picture of Jamie Pratt
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Core developersDocumentation writersPlugin developers
Sorry N, no.

You have got allow object embedding turned on I guess. I wonder if the html editor itself is stripping embed / object tags??
 
Average of ratings: -
Picture of Helen Foster
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersTestersTranslators
Yes, the HTML editor can be rather over-zealous in stripping out tags. A workaround would be to simply not use the HTML editor. wink
 
Average of ratings: -
Picture of Jamie Pratt
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Core developersDocumentation writersPlugin developers
This is now in 1.6 dev and so will be included in the next release of Moodle. Syntax will be ?w=800&h=600 or ?h=600&w=800

Jamie
 
Average of ratings: -
Picture of Đinh Lư Giang
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
 
Really good job!
Thanks a lot, Jamie!
Giang
 
Average of ratings: -
Picture of Jamie Pratt
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Core developersDocumentation writersPlugin developers
We decided to use Andy's code rather than mine since there was a problem with xhtml compliance with urls with ampersands in them (ampersands should be replaced with &amp; in URLs in xhtml). So now the syntax will be ?d=widthxheight eg d=800x600 is 800 pixels wide 600 pixels high.
 
Average of ratings: -
Picture of Helen Foster
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersTestersTranslators

"We decided to use Andy's code rather than mine..."

That's not right - the code was developed collaboratively! Thanks Jamie! smile

 
Average of ratings: -
Picture of Geoffrey Rowland
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Plugin developers
Hi,
I just wanted to state my real appreciation for this very informative thread big grin. particularly the contributions from Jamie, Helen & Andy. I have stolen your tricks and used them to modify Dan Stowell's Jmol filter to allow the flexible display of molecular structures in Moodle. See this thread for more info. Keep up the good work! 
 
Average of ratings: Useful (1)
Art Lader
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
 
Average of ratings: -
Picture of Helen Foster
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersTestersTranslators

Hi Jamie,

Great minds think alike (or at least quite similarly)! wide eyes Here's what we're using (thanks to Andy smile)

	$search = array(
            '/<a(.*?)href=\"([^<]+)\.swf\?d=([\d]{1,3}%?)x([\d]{1,3}%?)\"([^>]*)>(.*?)<\/a>/is',
            '/<a(.*?)href=\"([^<]+)\.swf\"([^>]*)>(.*?)<\/a>/is'
        );
        
        $replace = array();
            
        $replace[0]  = '\\0<p class="mediaplugin swf"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
        $replace[0] .= ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
        $replace[0] .= ' width="\\3" height="\\4" id="mp3player">';
        $replace[0] .= " <param name=\"movie\" value=\"\\2.swf\" />";
        $replace[0] .= ' <param name="quality" value="high" />';
        $replace[0] .= ' <param name="AllowScriptAccess" value="never" />';
        $replace[0] .= " <embed src=\"\\2.swf\" ";
        $replace[0] .= '  quality="high" width="\\3" height="\\4" name="flashfilter" AllowScriptAccess="never" ';
        $replace[0] .= ' type="application/x-shockwave-flash" ';
        $replace[0] .= ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
        $replace[0] .= '</embed>';
        $replace[0] .= '</object></p>';
 
        $replace[1]  = '\\0<p class="mediaplugin swf"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
        $replace[1] .= ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
        $replace[1] .= ' width="400" height="300" id="mp3player">';
        $replace[1] .= " <param name=\"movie\" value=\"\\2.swf\" />";
        $replace[1] .= ' <param name="quality" value="high" />';
        $replace[1] .= ' <param name="AllowScriptAccess" value="never" />';
        $replace[1] .= " <embed src=\"\\2.swf\" ";
        $replace[1] .= '  quality="high" width="400" height="300" name="flashfilter" AllowScriptAccess="never" ';
        $replace[1] .= ' type="application/x-shockwave-flash" ';
        $replace[1] .= ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
        $replace[1] .= '</embed>';
        $replace[1] .= '</object></p>';
    
        $text = preg_replace($search, $replace, $text);

It enables you to specify the dimensions of the flash movie by adding ?d=500x400 to the swf file URL for a movie with dimensions 500x400. It allows upto 3 characters for the width and the height, plus an optional % symbol at the end.

Perhaps something similar could be done for mpeg, avi files etc?

 
Average of ratings: Useful (1)
Picture of Jamie Pratt
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Core developersDocumentation writersPlugin developers
Andy's code looks like a slightly superior solution to me, mine doesn't allow use of the percent sign. I guess it would be nice to have a similar method to control all embedded media in the media plug in including flvs.
 
Average of ratings: -
Picture of Helen Foster
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersTestersTranslators
Jamie, please note: Andy made use of your solution to improve his code. wink
 
Average of ratings: -
Picture of Jamie Pratt
Re: Patch for Multimedia Plugin Allows Size of Embedded Flash to be Adjusted
Core developersDocumentation writersPlugin developers
By the way how did you get that nice dashed outline round your code Helen?
 
Average of ratings: -
Picture of Helen Foster
Re: styling code
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersTestersTranslators
Hi Jamie,

The code is styled using <pre style="border:1px dashed #2F6FAB; padding:1em; background-color:#F9F9F9;">...</pre> (the same as code in MoodleDocs e.g. Header logo) smile
 
Average of ratings: Useful (1)
Picture of Jamie Pratt
Re: styling code
Core developersDocumentation writersPlugin developers
Thanks Helen.
 
Average of ratings: -
Picture of Cordell Jones
Re: Flash module add-on: Size of Embedded Flash
 
Alan, this is the html code for embedding one of my flash files in a book module. I presume by changing the 720x400 the flash size would change.

<object width="720" height="400" align="middle" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
<param value="sameDomain" name="allowScriptAccess" />
<param value="http://www.quicklearners.com/case/retail_case.swf" name="movie" />
<param value="high" name="quality" />
<param value="#ffffff" name="bgcolor" />
<embed width="720" height="400" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowscriptaccess="sameDomain" bgcolor="#ffffff" quality="high" src="http://www.quicklearners.com/case/retail_case.swf" />
</object>
 
Average of ratings: -
Picture of Steven Diaz
Re: Flash module add-on: Size of Embedded Flash
 

Hi, i saw Helen's code and seems works fine but i can't adjust the size by percentaje %, anyone else tryit ???, and let me know if this is a IE trouble or how is the correct way to use it

Thanks n' greetings.

 
Average of ratings: -
Picture of Saurabh Gupta
Re: Flash module add-on: Size of Embedded Flash
 

Can anyone please explain in plain simple english, what's the solutions?

 
Average of ratings: -
Matt Bury
Re: Flash module add-on: Size of Embedded Flash
Particularly helpful MoodlersPlugin developers
OK everyone, embedding Flash is a fairly straightforward task if you have some decent documentation. Adobe.com has plenty of resources and tutorials for beginners so that's a good place to start.

The de facto embed method for Flash nowadays is to use SWFObject. It's even included as the default method in Flash Professional CS4. Unfortunately, this method requires code to be placed in the section of web pages which, as you may well be aware, is a bit difficult to do with Moodle.

However, you can use some of the tools available from the SWFObject project home site, hosted on Google Code, to create standards compliant (more or less) embed code that'll work in Moodle. The key word to look out for is the "static" embed method, not the "dynamic" one which requires an external Javascript file.

Anyway, start reading here and see where it takes you: http://code.google.com/p/swfobject/

I particularly recommend either the swfobject_generator_1_2_air.zip (requires an install) or the HTML version swfobject_generator_1_2_html.zip for beginners. They're wizards that'll give you exactly the embed code you need without writing a single line of code. It even allows you to pass in custom FlashVars parameters to embedded Flash files.

Remember that only the static embed method works in Moodle. smile

Good luck!

Matt
 
Average of ratings: -
Picture of emerson loustau
Re: Flash module add-on: Size of Embedded Flash
 
I'm trying to add a resource in which I link to an uploaded .swf file. By default, the swf is shrunken down, and I've been reading through all the past solutions in this forum and none of them seem to work? I'm using Moodle 1.9x, so I'm surprised that adding ?d#x# to the end of my swf file location isn't working. In fact, it appears as if the link is broken when I do this. Any advice would be much appreciated.
 
Average of ratings: -
Picture of Amy Groshek
Re: Flash module add-on: Size of Embedded Flash
Core developersTesters
What exactly do you mean, "shrunken down"? The dimensions of the swf are changed? Would probably help if we can see your embed/link code and maybe also the swf file.

-A
 
Average of ratings: -
Picture of emerson loustau
Re: Flash module add-on: Size of Embedded Flash
 
What I mean by "shrunken" is that my swf file is 1000X500px but when I link to it in Moodle it appears at (what I assume is the default 400X300) much smaller size. I'm using the direct link method, in which I "add a resource" and select "link to file" and then select the uploaded swf file. So there is no embed code. Just the file address in the text box. Here's a direct link to one of the swfs I'm trying to use:
http://www.onkwawenna.info/people_counting-doubles.swf
(It's over 100k so I can't attach it.)

When I click "update resource" and add "?d=1000X500" to the end of the file name the resource only shows a broken link. No swf at all.
 
Average of ratings: -
Picture of Amy Groshek
Re: Flash module add-on: Size of Embedded Flash
Core developersTesters
Hi there,

I think that's probably different from what's being discussed above. My understanding is that the default Flash player/Add a resource has some default settings that you have to alter PHP to change.

What I would probably do is select "Create an HTML page" and then enter something like this:



-A
 
Average of ratings: -
Picture of emerson loustau
Re: Flash module add-on: Size of Embedded Flash
 
I tried composing an HTML page and when I try the...
<a href="SWFFILE.swf"></a>
...method, nothing shows up. I've used this method with mp3s in the past and it's worked great, but for some reason the swf file doesn't open. It's just the empty link.
 
Average of ratings: -
Picture of Amy Groshek
Re: Flash module add-on: Size of Embedded Flash
Core developersTesters
I tested it on my server, using the URL to your file, and it does work. Are you sure that you have changed the admin setting to allow embedded swfs?

Site Administration > Modules > Filters > Multimedia Plugins
 
Average of ratings: -
Picture of emerson loustau
Re: Flash module add-on: Size of Embedded Flash
 
That was it! The swf filter was turned off. (I guess there's some potential security threat if a student writes a swf movie that destroys the world?) I fixed that and now the movie shows up and I can control the size using: ?d#X#
THANKS!!
 
Average of ratings: -
Matt Bury
Re: Flash module add-on: Size of Embedded Flash
Particularly helpful MoodlersPlugin developers
Hi Emerson,

This might be a bit hacky but I think there's a way to fool Moodle and stop the broken link think from happening. Try:

http://www.onkwawenna.info/people_counting-doubles.swf?d=1000x500&swf=f.swf

The "&xxx=swf.swf" part should tell Moodle's filters that it's a Flash file and to embed it accordingly - I think the filter only looks at the letters after the last "." for the file extension type. If the Flash file behaves strangely, try changing the "xxx" part of the string - Flash files read this as a FlashVar and it might conflict with a variable that some files are expecting. I think it's unlikely that any Flash files will be expecting xxx, unless they're porn!

I hope this helps!

Matt

P.S. I just clicked on the link and it works! If you don't want it to be publicly accessible you can put it in the course files directory and link to it there:

http://www.onkwawenna.info/file.php/[courseid]/people_counting-doubles.swf?d=1000x500&swf=f.swf

Make sure that the path to file.php is correct and that [courseid] is the correct course number, i.e. /moodle/course/view.php?id=9 means that it's /9/.

P.P.S. Let me know if you need any help with Flash - I'm a Flash developer.
 
Average of ratings: -
Picture of emerson loustau
Re: Flash module add-on: Size of Embedded Flash
 
This is a cool idea! Here's the results I got...

When I link to the site-external copy of the swf it works! I actually didn't even need the swf=f.swf trick. It just worked.

When I try to link the the site-internal copy of the swf, I can't get it to work no matter what I do. If I point to the swf using the "browse" button it works, showing an abbreviated path (for me its: /swf/counting_people-doubles.swf because I have a subfolder for swfs). When I add the ?d1000x500 it breaks. When I try it with the additional &swf=f.swf it still doesn't work. I even tried going to the file under the "files tab" and choosing "copy link location" (which gives a much long link with many &s, see below) and then adding both the endings and neither works.

So it seems like there is something specific to the paths within the "files" directory that's going wrong. Any ideas?

ps: Matt, I would LOVE to talk to you about a glitch in the flashcard module that makes audio cards not work in IE. I think I know exactly what's wrong, but I lack the programming skills to resolve it. If your willing, let's start a thread in the Flashcard module forum.

"copied link" = http://onkwawenna.info/moodle/file.php?file=%2F2%2Fswf%2Fcounting_people_doubles.swf
 
Average of ratings: -
Matt Bury
Re: Flash module add-on: Size of Embedded Flash
Particularly helpful MoodlersPlugin developers
In my experience, Moodle has been capricious about that it will and won't let happen with regards to embedding and filters. I save my self a lo of trouble and just use embed code and absolute URLs.

There's a Flash embed project that provides some really handy tools for generating embed code:

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

The AIR generator is particularly good and it's worth installing Adobe AIR on your computer because there's so many great apps. coming out on it now. It's quickly becoming the new Java but it's more secure.
 
Average of ratings: -
Picture of emerson loustau
Re: Flash module add-on: Size of Embedded Flash
 
Great tip on the swfObject code! I've achieved the desired results by "composing a webpage" in moodle and using the HTML code generator to embed the swf file.

A tip to anyone else who tries this: the HTML code generator outputs the HTML for an entire HTML page. If you cut and past the whole thing into the HTML editor in moodle, the swf won't appear. However, if you go back and "update this resource" and inspect the HTML code again in the editor, it will have stripped out the extra code, and the second time it will appear properly.

Next I want to take Matt's suggestion to look into AIR. I hear it's great but I don't know anything about it. Any suggestions on where to begin?
 
Average of ratings: -