A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Hand made slideshow - Can anybody help me on this?

  1. #1
    Junior Member
    Join Date
    Feb 2007
    Posts
    3

    Hand made slideshow - Can anybody help me on this?

    Hi everybody.

    I'm building a hand made slideshow, in which I need some help.

    I not an "ace" in scripting, just a curious designer , still, with some intermediate knowledge of actionscripting (if this help), and working with Flash 8 pro.

    The problem:

    I already accomplished some of the tasks to this project - based on a full screen XML gallery I found trough web, which already had the connectivity done with the XML doc, I already transformed it into a automatized slideshow adding some functions based on a delay...

    So, in the first frame I have:

    stop();

    // ========= XML ===========
    function ldDat() {
    // Loading XML
    dat=new XML();
    dat.ignoreWhite=true;
    dat.onLoad=function(success) {
    if(success) {
    swch(0);
    nextFrame();
    }
    }
    dat.load('images2.xml');
    }

    // === Switching XML images ===
    function swch(id) {
    stb=false;
    tot=dat.childNodes.length;
    if(id>tot-1) {
    id=0;
    }else if(id<0) {
    id=tot-1;
    }
    picMc.ldImg(dat.childNodes[id].attributes.url);
    act=id;
    }

    // === CALLING FUNCTION ===
    ldDat();


    In the second frame, this:

    stop();

    // ============= Delay Settings ===============
    var time:Number = 3500;

    // === FUNCTIONS ===
    function proceed() {
    // goes forward one image in the XML
    if(_root.stb) {
    _root.swch(_root.act+1);
    }
    }
    // delay function
    function delay() {
    clearInterval(waitingTime);
    waitingTime = setInterval(proceed, time);
    }

    // === CALLING FUNCTIONS ===
    delay();


    And the rest of the actionscripting is for the buttons events:

    // === BACK BUTTON ACTIONS ===
    back_btn.onRelease=function() {
    if(_root.stb) {
    _root.swch(_root.act-1);
    }
    //clearInterval(waitingTime); ??? this seems to be not working
    }

    // === NEXT BUTTON ACTIONS ===
    next_btn.onRelease=function() {
    if(_root.stb) {
    _root.swch(_root.act+1);
    }
    //clearInterval(waitingTime); ??? this seems to be not working
    }
    // === PAUSE/PLAY TOGGLE BUTTON ACTIONS ===
    playPauseSwitch_mc.onRelease=function(){
    if(_root.stb) {
    _root.swch(_root.act+0);
    }
    // === Toggling Play/Pause Symbols within "_root.crt.playPauseSwitch_mc" ===
    if (_root.crt.playPauseSwitch_mc.switchSymbols_mc._cu rrentframe == _root.crt.playPauseSwitch_mc.switchSymbols_mc._tot alframes){
    _root.crt.playPauseSwitch_mc.switchSymbols_mc.goto AndStop(1);
    }else{
    _root.crt.playPauseSwitch_mc.switchSymbols_mc.next Frame();
    }
    }

    And it's right here, in the buttons that I'm finding some difficulties giving the right events:

    1) I need the "back_btn" to go back one image "onRelease" and to clear the delay;

    2) The "next_btn" to go next one image "onRelease" and to clear the delay;

    3) The Pause/Play toggle button to stop on an image, to clear the delay and to show the "Play" symbol (which is on the "_root.crt.playPauseSwitch_mc.switchSymbols_mc " second frame - in the first is the "Pause") if clicked once. If clicked the second time it should start from where it stop's and set the delay again.


    Can anybody give me some help on this?
    A great "thank you" in advance.

  2. #2
    Junior Member
    Join Date
    Oct 2005
    Posts
    24

    just curious

    I am just beginning to learn AS so this may be a stupid Q, but the lines you are saying are not working appear to be commented out. Is that only for our viewing or was that something you did during testing?

  3. #3
    Junior Member
    Join Date
    Feb 2007
    Posts
    3
    yep, just for viewing.

  4. #4
    Junior Member
    Join Date
    Feb 2007
    Posts
    3
    Anyway, I found the answer and was there all the time...
    Those same lines...

    The "clearInterval(waitingTime);" should indicate the place they are in the stage.
    So, now that I change that to "clearInterval(_root.waitingTime);" worked out just fine.

    Tks anyway

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