Jump to:

23373 Posts in 18175 Topics by 2865 members

General Questions

SilverStripe Forums » General Questions » Additional params for uploaded flash

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

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

Page: 1 2 3
Go to End
Author Topic: 4280 Views
  • AlaVive
    Avatar
    Community Member
    42 Posts

    Re: Additional params for uploaded flash Link to this post

    Thank you, Banal!

  • Taffy
    Avatar
    Community Member
    119 Posts

    Re: Additional params for uploaded flash Link to this post

    Banal has put this recipe/tutorial on http://ssbits.com/embed-flash-content-using-swfobject/

    Nice one!

  • JuLo
    Avatar
    Community Member
    37 Posts

    Re: Additional params for uploaded flash Link to this post

    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

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Additional params for uploaded flash Link to this post

    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.

  • JuLo
    Avatar
    Community Member
    37 Posts

    Re: Additional params for uploaded flash Link to this post

    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.

  • Samba Sam
    Avatar
    Community Member
    85 Posts

    Re: Additional params for uploaded flash Link to this post

    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

  • Samba Sam
    Avatar
    Community Member
    85 Posts

    Re: Additional params for uploaded flash Link to this post

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

  • studio6
    Avatar
    Community Member
    14 Posts

    Re: Additional params for uploaded flash Link to this post

    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)

    4280 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.