flash hates me and I love her.

  • Started
  • Last post
  • 3 Responses
  • verydarkred

    I am having trouble passing updated array information into my function. If I trace the array the value passes through and displays in the out put window, but that same value
    does not update my gotoAndPlay(sceneArray[num]).

    thanks in advance - good luck.

    // slide_mc contains 5 keyframes each with different content
    // each frame has a stop action, as well as other events / actions
    // the counter should start on frame 2 which it does.
    // the idea is to have the counter go to a frame for an increment of time
    // then move foward
    // the trace is formatted so I can see what gotoAndPlay is being passed

    here is the code:

    fscommand("allowscale","false");
    fscommand("fullscreen","false");
    stop;

    // attach movie
    this.attachMovie("slide","slide...
    this.slide_mc._x = 0;
    this.slide_mc._y = 0;

    //initialize slide show
    if( init==null )
    {
    // sets the app as initilized
    var init = true;
    // the current scene displayed
    var num = 0;
    // creates the array
    var sceneArray = new Array(2,3,4,5);
    // makes the initial call to the nScene() function
    nScene();
    // creates a listner that calls event on this interval
    setInterval( nScene, 10*500 );
    // stop
    stop();
    }

    //Shows the next image in array
    function nScene()
    {
    if( num >= sceneArray.length)
    {
    num=0;
    }
    // change scene
    this.slide_mc.gotoAndPlay(sceneA...
    );
    // trace
    trace("gotoAndPlay("+sceneArray
    +")");
    // up counter
    num++;
    }

  • unfittoprint0

    something here

    this.slide_mc.gotoAndPlay
    (sceneArray
    );

    should be

    this.slide_mc.gotoAndPlay
    (sceneArray[num]
    );

    you could also try to put the entire nScene in the setInterval like:

    setInterval( function(){
    if( num >= sceneArray.length)
    {
    num=0;
    }
    // change scene
    this.slide_mc.gotoAndPlay
    (sceneArray
    );
    // trace
    trace("gotoAndPlay("+scen
    eArray
    +")");
    // up counter
    num++;
    } , 10*500 );

  • verydarkred0

    thank you so much that did the trick.

  • unfittoprint0

    nIcE.