Runtime yml:swf does not work

Creating runtime flash object(embed/object element) using yml:swf works fine. But doesn't work fine, If it is created out of user action like click, keypress, etc.
I am using the following code.

divobj.innerHTML = '<yml:swf width="400" height="270" wmode="transparent" src="http://www.example.com/player.swf" flashvars="autoPlay=1&ecode=JCX3ta"/>';

Normally the above code works fine. But if it gets executed inside a function call which in turn gets called via user -action, it doesn't work. It will ask one to install new flash version ( beside having the latest ).

2 Replies
  • The yml tags will render down to their base level html / js / css on initial page build, so the yml tag will not build itself when innerHTML is called. What you'll want to do is wrap the user click action in a yml:a tag with an insert parameter of the node you want to insert the flash into. When yml:a is clicked, the params parameter should be set to a server side script that will return your yml:swf tag. When it is inserted into the page it'll render how you need it to. This will only work if the yml:swf is loaded through another yml tag.

    Hope that helps,
  • It worked. Thanks a lot. :D
  • My pleasure - glad to hear that worked.

    - Jon
  • Hello Jon

    I am a beginner level developer in front-end web dev. I am trying to use yml:swf like this, so as to set the flashvars from my php script.
    <yml:swf src="http://krati.mydictionaryapi.com/images/images/speaker.swf" height="17" width="20" minversion="9.0.124" flashvars="<?echo "$audio";?>" >

    I only get this error :
    "Please get the latest Adobe Flash Player...."

    Is it possible to pass the php variable? And can you please give me an example of using <yml:a> tag to display the swf ?


    QUOTE (Jonathan LeBlanc @ Jan 29 2010, 11:30 AM) <{POST_SNAPBACK}>
    My pleasure - glad to hear that worked.

    - Jon

Recent Posts

in YAP