Could someone please expand on the usage of the "methods" parameter? The documentation is not very clear on how it should be used. Does this allow you to embed using a different method than the swftools default embed method?

I am using a custom method in my template (swfobject 2, but a custom id is replaced rather than creating an empty div), but it is not appropriate for general use. I would like to explicitly use my custom method in my template's call of swf(), but use a different embedding method everywhere else (e.g., the swftools input filter).

Comments

raimondious’s picture

Simple to use, I was just missing the name of the embed method:

swf("myfile",array(
  "methods" => array(
    "embed" => "[embed method name]"
  )
);

[embed method name] can be found in the .module file for that method, e.g., in swftools/swfobject2/swfobject2.module. You'll find

function swfobject2_swftools_methods() {
  $methods = array();
  $methods[SWFTOOLS_EMBED_METHOD]['swfobject2_replace'] = array(
    'name'        => 'swfobject2_replace', // This is the embed method name.
    'module'      => 'swfobject2',
    'shared_file' => 'swfobject2/swfobject.js',
    'title'       => t('SWFObject 2 - JavaScript'),
    'download'    => 'http://code.google.com/p/swfobject/',
  );
  return $methods;
}
raimondious’s picture

Status: Active » Closed (fixed)