In a world. In a time. Wait that is weird.
Better?

//cb

Ok those are determinded in an array in a previous function.
Here is EVERYTHING THAT I AM GOING TO THIS POINT. 
I will change the code for random later I just need to figure this out.
Oon step at a time. The random works fine above so I feel ok about it
for now.

[code] 
//this can be copy and pasted into script window to see results.
// and I really need to learn OOP and AS2 I'm sure life would be a lot
//easier.

//setup vars
clipNum = 1;

selectLayoutNum = function(){
                //check if it was the last layout
                //set layoutNum
                layoutNum = random(5) +1;
                while(layoutNum == oldNum){
                        layoutNum = random(5) +1;
                }
                oldNum = layoutNum;
                trace("layoutNum: " + layoutNum);
                getSetsNLayout(layoutNum);
}

getSetsNLayout = function(layoutNum){
        setsArray = [null, 3, 3, 3, 3, 4];
        totalSetsNLayout = setsArray[layoutNum];
        trace("totalSetsNLayout: " + totalSetsNLayout);
        gatherImages4Layout(totalSets, layoutNum);
}

gatherImages4Layout = function(totalSetsNLayout, layoutNum){
        totalImagesNLayout = [null, 9, 8, 6, 6, 11];
        imagesToGrab = totalImagesNLayout[layoutNum];
        trace("imagesToGrab: " + imagesToGrab);

        
        //dynamicly create array of images to be used in layout
        imgArray = new Array();
        for(i=0; i<=imagesToGrab; i++){
                
                randomSet = random(totalSetsNLayout) + 1;
//totalSetsNLayout = 4
                //shouldn't i get a random number between 1-4?
                trace("randomSet: " + randomSet);
                img = "layout" + layoutNum + "_set" + randomSet + "_img"
+ i;
                imgArray.push(img);
        }
        trace("imgArray= [" + imgArray + "]");
        gotoAndPlay("lay_" + layoutNum);
}

loadImages = function(layoutNum){
        myMC = "lay" + layoutNum + "_img" + clipNum;
        
        clipNum++;
}

selectLayoutNum();
stop();

[/code]




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Merrill,
Jason
Sent: Wednesday, February 01, 2006 4:12 PM
To: Flashcoders mailing list
Subject: RE: [Flashcoders] understanding the for loop

By the way, with that e-mail signature line of yours, I feel like I am
talking to my alter-self from a parallel universe.  

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com



>>>>Jason so its bad to use this old way of random huh?
>>>>
>>>>Corban Baxter      |      rich media designer      |
www.funimation.com




NOTICE:
This message is for the designated recipient only and may contain
privileged or confidential information. If you have received it in
error, please notify the sender immediately and delete the original. Any
other use of this e-mail by you is prohibited.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to