Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Featured Content Slider- activate Flash movie

  1. #1
    Join Date
    May 2008
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Featured Content Slider- activate Flash movie

    1) Script Title: Featured Content Slider v2.0

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tentslider.htm

    3) Describe problem:
    First off: Thank you for your work on this script!

    I am trying to use the script to slide through several Flash movies. The problem is once the movie is done playing, and the cycle loops through, it doesn't restart playing the movie, but stays at the end frame. I've tried this with inline movies, using iframes, and using an external file with ajax.

    I have a script where I can use a onclick:PlayFlashMovie(); to start the flash movie, but I don't know how to integrate this with the contentslider.js. My first thought was to stick the command into the "onChange: function" section, but that didn't seem to work... (or maybe I didn't do it right) My feeling is it needs to be integrated with the pagination, but how this is done I don't know.

    Any help would be greatly appreciated!

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    While I'm not familiar with calling/stopping Flash movies on demand, as long as you have a way to explicitly restart a Flash movie via some function (ie: playFlashMovie(number)), you should be able to use that in conjunction with the Slider script's onChange event handler to restart a movie when it is shown as the Slider script shows the slide in question. Something like:

    Code:
    onChange: function(previndex, curindex){ //event handler fired whenever script changes slide
     playFlashMovie(curindex)
    }
    Now, I don't know how playFlashMovie() is actually called to tell it to start a particular Flash movie versus another, so the above is just the general concept.

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    mike_c (05-15-2008)

  4. #3
    Join Date
    May 2008
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your reply, I'm very basic with Javascript, but this is the script I have, that I'm trying to use with the slider:

    Code:
    <script language="JavaScript">
    <!--
    // (C) F. Permadi 
    function getFlashMovieObject(movieName)
    {
      if (window.document[movieName]) 
      {
        return window.document[movieName];
      }
      if (navigator.appName.indexOf("Microsoft Internet")==-1)
      {
        if (document.embeds && document.embeds[movieName])
          return document.embeds[movieName]; 
      }
      else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
      {
        return document.getElementById(movieName);
      }
    }
    
    function PlayFlashMovie()
    {
    	var flashMovie=getFlashMovieObject("aniflash3");
    	flashMovie.Play();
    }
    //-->
    </script>
    It does work with:
    Code:
    <input type="button" value="Play" name="Play" onClick="PlayFlashMovie();">
    but when I try to insert the "PlayFlashMovie(); into the onchange, it doesn't work.

    I appreciate your help, please let me know if you can think of any other solution!

  5. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    I haven't worked with manipulating Flash using JavaScript. Can you put up a test page that includes:

    1) The Flash movie, and the sample form button above that plays it whenever clicked on
    2) Featured Content Slider with the same movie embedded, plus your attempt of using the onChange event to play the movie when the user goes to that slide?

  6. #5
    Join Date
    May 2008
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Ok, sorry for the delay. Here's the link:

    http://www.springthunder.com/test.html

    After more experimenting I've almost got it to work. It is restarting the movie, but on every onchange, instead of just when it gets to the third slide.

    Any suggestions much appreciated!

  7. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    That's easy to fix. If you want to call flashMovie.play() only when the 3rd slide is shown, you'd do something like:

    Code:
    	onChange: function(previndex, curindex){
    	var flashMovie=getFlashMovieObject("aniflash");
     	if (curindex==3) //if this is the 3rd slide being shown
    		flashMovie.Play();
    	}

  8. The Following User Says Thank You to ddadmin For This Useful Post:

    mike_c (05-16-2008)

  9. #7
    Join Date
    May 2008
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    You're awesome dude! Thanks for the help, worked like a charm!

  10. #8
    Join Date
    Aug 2008
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default same request with less knowledge

    I am looking to do a similar thing to mike_c (i.e. trigger a flash animation outside of flash but jumping to different frames) so I thought the content slider would be ideal for this (nice work by the way!). But really - there are two real subjects that I need to uncover.

    1) Firstly: where should I input the flash file? And from there how do I get it to jump to various frames of my animation?

    2) For a separate project I would like to ask what I can do to change the menu 'page' section at the bottom of the slider as I am looking for a similar feature whereby the menu of the page/screen selected is highlighted but I would like to use my own images and change one image for another when selected.

    As you can probably tell I am a complete JS novice and really appreciate any answers/suggestions anyone can donate.

    Thanks kindly>
    Last edited by g_force; 09-02-2008 at 05:26 PM. Reason: now two slider related queries

  11. #9
    Join Date
    Aug 2008
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Can you take a look at this:

    Test Page

    This doesn't appear to work in IE (at least version 7.0), how can I get around this?

  12. #10
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    There's an error with one of the other scripts on the same page:

    Code:
    Error: syntax error
    Source File: http://webvertising4free.com/MFPOI/TESTS/dynamic_TEST1.html
    Line: 1, Column: 71
    Source Code:
    MM_preloadImages('bluesquare.jpg','redsquare.jpg', 'yellowsquare.jpg', )
    Try removing all scripts on the page except the Featured Content Slider, and see if that fixes things in IE.
    DD Admin

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •