Thank you, Banal!
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
- Previous 10 entries
- 1
- Page 22(current)
- 3
- Next 10 entries
Banal has put this recipe/tutorial on http://ssbits.com/embed-flash-content-using-swfobject/
Nice one!
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?
Thanks,
JuLo
Hi
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.
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 FlashPage.ss.
Go figure.
Thanks.
Nevermind.
Hi,
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(
$swfUpload,$flvUpload,
new HtmlEditorField('AlternateContent', 'Flash replacement text', 20)
));
return $fields;
}
Any ideas,
Sam
Ah, figured it out. There was no swfobject.js file link in my template. Works fine now.
Sam
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)
- Previous 10 entries
- 1
- Page 22(current)
- 3
- Next 10 entries