JS player listener onUpdate problem

156 views
Skip to first unread message

poddu...@gmail.com

unread,
May 16, 2013, 9:40:25 AM5/16/13
to flashmp...@googlegroups.com
Hi. I can't get JS version working correctly. Listener onUpdate method is not firing at all.

I have something like this:

<script type="text/javascript">
   var myListener = new Object();
   myListener.onInit = function () {
      this.position = 0;
      alert('init');
   };
   myListener.onUpdate = function () {
       alert('update');
   };
</script>

<object class="mainplayer" id="mainMDMAplayer" type="application/x-shockwave-flash" data="/System/mp3player/player_mp3_js.swf" width="1" height="1">
    <param name="movie" value="/System/mp3player/player_mp3_js.swf" />
    <param name="AllowScriptAccess" value="always" />
    <param name="FlashVars" value="interval=500&amp;listener=myListener" />
</object>

'init" alert is called, and player works great using SetVariable("method:setUrl", "...."); and SetVariable("method:play", "");

But no 'update' alerts appear and all myListener properties (except position, which stays 0 even though mp3 is playing) are undefined.

What may cause this problem?

Tommy Smith

unread,
May 26, 2013, 3:14:54 PM5/26/13
to flashmp...@googlegroups.com, poddu...@gmail.com
1. Did you add the myListener variable to the Flash?

            <object class="playerpreview" id="myFlash" type="application/x-shockwave-flash" data="/medias/player_mp3_js.swf" width="1" height="1">
                <param name="movie" value="/medias/player_mp3_js.swf" />

                <param name="AllowScriptAccess" value="always" />
                <param name="FlashVars" value="listener=myListener&amp;interval=500" />
            </object>

2. Did you enable the events?
                    SetVariable("enabled", "true");

stanc...@gmail.com

unread,
Jan 6, 2014, 4:03:06 AM1/6/14
to flashmp...@googlegroups.com, poddu...@gmail.com
I've had the same problem. The enabled variable solved it for me so thank you. By the way it's not mentioned in the documentation or i can't find it.
Reply all
Reply to author
Forward
0 new messages