views:

17

answers:

2

Does anyone know a simple script that one could add to a custom jQuery content slider that would make the slider stop while Flash content is being played inside?

Or, alternatively, just make the slider stop while hovering the mouse over it?

All the best, Robert

A: 

you can call a javascript function (like mySliderStop()) from flash via getUrl (or navigateURL).

Anakin
A: 

Provided that you have access to the Flash script, Flash & Javascript can communicate via the ExternalInterface class so you could implement a JQuery function that would be called from Flash when the movie starts playing.

in JQuery

  function stopMySlider()
  {
     //your javascript code here
  }

in Flash

import flash.external.ExternalInterface;

    //your constructor
    public function Main()
    {
         init();
    }

    // any function that would get the movie to start playing
    private function init():void
    {
       ExternalInterface.call('stopMySlider');
    }

If you don't have access to the Actionscript code, one solution could be to create a loader component in Actionscript. There are plenty of examples around so here's only a brief description of the code:

   var loader:Loader = new Loader();
   // add your event listeners here
   loader.load( new UrlRequest('path to your swf') );

   private function onLoadComplete(event:Event )
   {
       addChild( event.target.content );
       ExternalInterface.call('stopMySlider');
   }
PatrickS
Dadadaa... answer accepted!Arise, Sir, Knight! For thou are ennobled!
robert
i shall be very proud indeed!
PatrickS