A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: goto a frame when an array is empty

Threaded View

  1. #1
    Senior Member
    Join Date
    May 2006
    Posts
    119

    goto a frame when an array is empty

    Im wondering, I have this script courtesy of MD004 (thanks again)
    and Im wondering how I can make it goto the frame labeled "congradulations" when the array is empty. this is what I have.

    Code:
    function arrayRandomizer(a, b) {
    	var value = (random(2)==0) ? -1 : 1;
    	return value;
    }
    
    frames = [2,3,4,5,6,7,8,9,10,11,12,13]; // this is the array of frames
    frames.sort(arrayRandomizer);
    
    
    currentFrameCount=0;
    function nextFrame() {
    	gotoAndStop(  frames[currentFrameCount]  );
    	currentFrameCount++;
    }
    I tried just putting a

    Code:
    if( frames == "" ){ 
     _root.gotoAndPlay("congradulations");
    }
    but it doesn't goto the frame
    any suggestions?

    thanks in advance

    Mark
    Last edited by MarkSensei; 06-21-2006 at 09:42 AM.

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