A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Cannot hack simple slideshow function

  1. #1
    Junior Member
    Join Date
    Feb 2009
    Posts
    5

    Cannot hack simple slideshow function

    Good afternoon,

    I've been wrestling with this problem for a good two days with very little progess. My flash version is CS3. What I have is a dynamic slideshow using flash as2. I lifted the basic code out of a book, and it works fine except I want the thing to do the loadClip function after the movie clip pans offscreen, not right when I click the Prev or Next button, so that it looks like an old microfilm reader.

    Here's an example of the beta test, the way it's set now is that the movie container loads the next slide automatically, making it disappear when you should be seeing the current one pan offscreen first:

    http://www.belfrylove.com/SlideshowTest7.swf

    Forget about the Prev button for now.

    The movie container is located inside a movie clip called framesMC. All the actionscript is located at the top level of the project. The function for loading the next slide is loadMovie, but when I plug that script into the last frame of framesMC (when the movie container finishes its offscreen panning motion), nothing happens.

    Here is the main as for the above link. Any suggestions would be appreciated.


    stop();


    var myMCL:MovieClipLoader = new MovieClipLoader();

    var myListener:Object = new Object();

    myMCL.addListener(myListener);


    var slideInfoLV:LoadVars = new LoadVars();

    slideInfoLV.onLoad = function (success){
    if (success) {
    slideCounter();
    } else {
    frameNum.text = "error";
    }
    }

    slideInfoLV.load("Graphics3/slide_info.txt");

    var curFrameNum:Number = 0;

    function loadFrame() {

    _level0.myMCL.loadClip("Graphics3/drawing_" + curFrameNum + ".swf", _root.framesMC.framesMCinner);

    }


    function slideCounter(){

    frameNum.text = ((curFrameNum) + 1);

    }

    loadFrame();


    //---------------Next Slide Button--------------------

    _root.nextSlideBtn.onRelease = function() {

    _root.framesMC.play();

    if (curFrameNum < Number(slideInfoLV.totalFrames) -1){
    curFrameNum ++;
    } else {
    curFrameNum = 0;

    }

    loadFrame();
    slideCounter();

    }

    //------------/Next Slide Button-------------------

    //------Prev Slide button-----------------


    _root.prevSlideBtn.onRelease = function() {

    if (curFrameNum == 0){
    curFrameNum = Number(slideInfoLV.totalFrames) -1;
    } else {
    curFrameNum --;

    }

    loadFrame();
    slideCounter();

    }

    Last edited by Nostromos; 05-01-2011 at 07:36 PM.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center