Problems Stopping Video


hi,

 

i using tabbedviewnavigatorapplication, , when switching tabs need video stop playing. i've looked @ spark video player source code , adapted function assigns event listeners parents. code works fine on current view, if switch tabs or go view, not work... flexevent.hide listeners don't fire. in debugger have verified below code indeed assign listeners way parent chain, wondering if either views not getting destroyed or not using right listeners. know?

 

thx

 

/**

                     *  @private

                     *  add event listeners show , hide on ancestors parent chain.

                     *  adding weak event listeners safe.

                     */

                    private function addvisibilitylisteners():void

                    {

                              var current:ivisualelement = this;

 

                              while (current)

                              {

  // add visibility listeners parent

                                        current.addeventlistener(flexevent.hide, visibilitychangedhandler, false, 0, true);

                                        current.addeventlistener(flexevent.show, visibilitychangedhandler, false, 0, true);

 

  // add listeners design layer too

                                        if (current.designlayer)

                                        {

                                                  current.designlayer.addeventlistener("layerpropertychange", designlayer_layerpropertychangehandler, false, 0, true);

                                        }

 

                                        current = current.parent as ivisualelement;

                              }

                    }

i figured out. when views switched, old view removed stage, therefore visibility change handler never getting fired. solved adding removed stage event video player code stop playing.



More discussions in Flex (Read Only)


adobe

Comments