How can I set flash parameters values on flash item add?

From AVObjects Knowledge Base
Jump to: navigation, search

Sometimes flash items require parameters to be set on flash add like on html page:

<html>
 <object type="application/x-shockwave-flash" data="myflash.swf" >
    <param name="param1" value="value1" /> 
 </object>
</html>

You can set this parameters values on flash item add by passing them to filename string of AddNewItem method like this:

string strItemID = "";
m_pMLCharGen.AddNewItem("FlashItem.swf?param1=value&param2=value2", 0, 0, 1, 0, ref strItemID);

You can also save this parameters string to Character Generator configuration XML:

<ml-chargen>
  <video-props interlace='auto' extra-buffer='1' width='720' height='576'/>
  <video-output background='Black(0)' top-video='no'>
    <input-rect left='0.000%' right='0.000%' top='0.000%' bottom='0.000%'/>
    <output-rect left='0.000%' right='0.000%' top='0.000%' bottom='0.000%'/>
  </video-output>
  <cg-items>
    <cg-item id='flash-000' pos-x='0.050' pos-y='0.050' size-x='0.764' size-y='0.694'>
 
      <img path='myflash.swf?param1=value&param2=value2'/>
 
      <cg-props pos-x='36' pos-y='29' show='yes' move-type='accel-both' alpha='255' bg-color='Black(0)' pixel-ar='0.000' play-mode='loop' interlace='auto' scale='fit-ar' align='top-left' width='550' height='400' pause='no' edges-smooth='0'>
        <indent left='0' right='0' top='0' bottom='0' use-for-bg='no'/>
        <group-indent left='0' right='0' top='0' bottom='0'/>
      </cg-props>
      <flash-vars/>
    </cg-item>
  </cg-items>
  <cg-schedule>
    <timeline-file/>
  </cg-schedule>
  <cg-compositions/>
</ml-chargen>
Personal tools