Calling Help From the Actionscript Gods

  • Morrigu
  • Born
  • Born
  • Morrigu
  • Posts: 1

Post 3+ Months Ago

I am trying to get a function to loop. I have 12 images that I was able to get to run as a slide show. My problem is, once it gets to the end of those 12 images, the slide show stops. I want it to restart back to the first image and start the slide show again.

Can someome please show me how to do this? Your help would be greatly appreciated.

Here is the following code:

Code: [ Select ]
    public function createImages():Void{
        for (var i : Number = 0; i <= mXMLManager.imageCount-1; i++) {            
            mImages[i] = new Image(mImageHolder_mc, i, mXMLManager.imagePath + mXMLManager.imageFileNames[i],this);
            mImageLoadQueue[i] = i;                    
        }        
        mImageLoadQueue.reverse();    
        //load 1st image        
        setInterval(Delegate.create(this,onClickNext), 3000);
        
        

    
    
    public function loadNextImage(){        
        var nextImgId = mImageLoadQueue.pop();        
        mImages[nextImgId].loadImage(true);        
    }
  1.     public function createImages():Void{
  2.         for (var i : Number = 0; i <= mXMLManager.imageCount-1; i++) {            
  3.             mImages[i] = new Image(mImageHolder_mc, i, mXMLManager.imagePath + mXMLManager.imageFileNames[i],this);
  4.             mImageLoadQueue[i] = i;                    
  5.         }        
  6.         mImageLoadQueue.reverse();    
  7.         //load 1st image        
  8.         setInterval(Delegate.create(this,onClickNext), 3000);
  9.         
  10.         
  11.     
  12.     
  13.     public function loadNextImage(){        
  14.         var nextImgId = mImageLoadQueue.pop();        
  15.         mImages[nextImgId].loadImage(true);        
  16.     }
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

The Actionscript gods are playing volleyball in Maui, they left me here to take care of things.

Look at this function.
Code: [ Select ]
public function loadNextImage(){   

   var nextImgId = mImageLoadQueue.pop();   

   mImages[nextImgId].loadImage(true);   

  }
  1. public function loadNextImage(){   
  2.    var nextImgId = mImageLoadQueue.pop();   
  3.    mImages[nextImgId].loadImage(true);   
  4.   }


Notice now it pops an item off the end of the array, making the array smaller ?

unshift that item back into the array & you should be good to go.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 11 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.