A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 25 of 25

Thread: Make a Random Number and If else get along

  1. #21
    Junior Member
    Join Date
    Oct 2010
    Posts
    13
    OK I got a very paired down version, no pictures but you can pretend what it looks like.
    Attached Files Attached Files

  2. #22
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Is this stripped down version, still going directly to 35 for you?
    Because for me it is operating correctly, going to go to frame 1, then jumping to an random frame and playing from there.

  3. #23
    Junior Member
    Join Date
    Oct 2010
    Posts
    13
    When I used:

    var frameArray:Array=[12,50,85,120,155,190,225,260,295,330,365,400,435];
    var maxNum=frameArray.length-1;

    function randRange(min:Number, max:Number):Number {
    return Math.floor(Math.random() * (max - min + 1)) + min;
    }

    var n:Number=randRange(0,maxNum);
    trace(n + " "+frameArray[n]);
    gotoAndPlay(frameArray[n]);

    It worked in the stripped down so I copied it into the original file and it does not want to work. When I made the stripped down version all I did was delete all the pictures and movie clips from the library, then put numbers on all the frames. So why does it work in one and not the other if they are the basically the same.

  4. #24
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Check your original file and look for any actionscript on or in the movie clips.

  5. #25
    Junior Member
    Join Date
    Oct 2010
    Posts
    13
    i did and found nothing. I checked the time line and nothing is there, however thanks, I will take a closer look tomorrow and and see what I can find, my day is almost done here. But thanks for helping me get something to work, so at least I know there is hope.

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