Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Additional params for uploaded flash

Go to End

23 Posts   5867 Views


Community Member, 42 Posts

3 December 2009 at 9:23am

Thank you, Banal!


Community Member, 119 Posts

4 December 2009 at 10:54pm

Banal has put this recipe/tutorial on

Nice one!


Community Member, 37 Posts

17 December 2009 at 12:16pm

Great idea, as I have been battling with the relative paths to my swfs for hours to no avail.

However, in your example Requirements::javascript('mysite/javascript/lib/swfobject.js'); does not seem to have any effect and swfobjects does not see to get included. (can't see "<script type="text/javascript" src="mysite/javascript/swfobject_new.js"></script>" anywhere)

Any ideas why?

Are you sure the code is working as is for you?




Community Member, 904 Posts

17 December 2009 at 8:18pm


Yes, the code is definitely working.
Why would it include swfobject_new.js, when you're telling it to load swfobject.js. Just a typo I guess.

Make sure you put the files in the correct folders, and maybe check using Firebugs "Net" Tab that the file loads. You don't have to use Requirements::javascript, you could put <script type="text/javascript" src="mysite/javascript/lib/swfobject.js"></script> in your template code just as well.


Community Member, 37 Posts

18 December 2009 at 8:30pm

Sorry. That was a copy paste mistake.

I had another page using the old swfobject so renamed the new version to swfobject_new.js.

On the other hand, it does work when I manually add the code in

Go figure.



Samba Sam

Community Member, 85 Posts

28 April 2010 at 4:13pm

Edited: 30/04/2010 2:03pm

Following Banal's example, I would like to play a swf file with an external flv (i.e., a swf file that will load the video from an external FLV file at runtime and will not embed anything in the swf file itself?. The question is what is the code I would use in my FlashPage.php to load both the swf and flv file through the CMS? The swfobject code in the template ss is the same as Banal's except I changed the variable name from FlashFile to swfFile.

I tried the following in my FlashPage.php, but it didn't work.

public static $has_one = array(
		'swfFile'	=> 'File',
		'flvFile'	=> 'File'
public function getCMSFields(){
		$fields = parent::getCMSFields();
		$swfUpload = new FileIFrameField('swfFile', 'Flash file (swf)');
		$flvUpload = new FileIFrameField('flvFile', 'Flash file (flv)');
		$fields->addFieldToTab("Root.Content.Flash", new FieldGroup(
				new NumericField("Width", "Width"),
				new NumericField("Height", "Height"),
				new TextField("TopMargin", "Top Margin"),
				new TextField("LeftMargin", "Left Margin")
		$fields->addFieldsToTab('Root.Content.Flash', array(
			new HtmlEditorField('AlternateContent', 'Flash replacement text', 20)
		return $fields;

Any ideas,

Samba Sam

Community Member, 85 Posts

30 April 2010 at 2:00pm

Edited: 30/04/2010 3:50pm

Ah, figured it out. There was no swfobject.js file link in my template. Works fine now.


Community Member, 14 Posts

20 July 2010 at 1:51am

hay sam i would love some more info on how you play a swf file with an external flv how did you use that code (eg. did you add that code or was that all you needed)