hi Corban,

>                 //ALL ISSUES ARE OCCURING IN THIS LINE OF CODE FROM WHAT I 
> UNDERSTAND
>                 //COULD ANYONE HELP ME OUT WITH THIS?
>                 rfcClip.container.attachMovie(imgID);

the other two arguments for attachMovie are name:String and depth:Number. :)

to clarify Andreas' advice to use var, if you only need it locally,
declare it locally. for example, randomPos is only used inside
loadImages, but you declare it in the beginning of your script. that's
not necessary, you can declare it in the beginning of your function.

also, i disagree with him on using "function foo ()  {" over "var
foo:Function = function () {", but i guess that's really a matter of
preference. just do it like whatever feels more comfortable with you.

hth,
mark



On 2/2/06, Corban Baxter <[EMAIL PROTECTED]> wrote:
> So I am trying to convert the scripts to AS2 and get strict datatyping to 
> work but nothing seems to work the way I imagined it to work. I tried to do 
> what I could best and nothing still is working. All the data is in place but 
> nothing will get my MC's to load in the images from the library...
>
>
> [code]
> ///varibles setup
> var layoutNum:Number;
> var oldNum:Number;
> var setsArray:Array = new Array();
> var totalSetsNLayout:Number;
> var totalImagesNLayout:Array = new Array();
> var imagesToGrab:Number;
> var imgArray:Array = new Array();
> var rfcsArray:Array = new Array();
> var randomSet:Number;
> var oldSet:Number;
> var img:String;
> var myMC:String;
> var randomPos:Number;
> var rfcClip:MovieClip;
> var imgID:String;
>
> function selectLayoutNum(){
>                 //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);
> }
>
> function getSetsNLayout(layoutNum){
>         setsArray = [null, 3, 3, 3, 3, 4];
>         totalSetsNLayout = setsArray[layoutNum];
>         trace("totalSetsNLayout: " + totalSetsNLayout);
>
>         gatherImages4Layout(totalSetsNLayout, layoutNum);
> }
>
> function gatherImages4Layout(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
>         for(i=0; i<=imagesToGrab; i++){
>                 randomSet = random(totalSetsNLayout) + 1;
>                 while(randomSet == oldSet){
>                         randomSet = random(totalSetsNLayout) + 1;
>                 }
>                 oldSet = randomSet;
>
>                 img = "layout" + layoutNum + "_set" + randomSet + "_img" + i;
>                 imgArray.push(img);
>                 myMC = "lay" + layoutNum + "_img" + i;
>                 rfcsArray.push(myMC);
>         }
>         //trace("imgArray= [" + imgArray + "]");
>         //trace(" ");
>         //trace("rfcsArray = [" + rfcsArray + "]");
>         gotoAndPlay("lay_" + layoutNum);
> }
>
> //loadImages is called in an interval when the playhead hits the marker 
> specified
> //like "lay_2" etc
> //loadImgInterval = setInterval(loadImages, 2000, imagesToGrab);
>
> function loadImages(imagesToGrab){
>         if(imagesToGrab == 0){
>                 //stop loading images
>                 clearInterval(loadImgInterval);
>                 trace("hitting the clear");
>         }else{
>                 randomPos = random(imagesToGrab)+1;
>
>                 rfcClip = rfcsArray[randomPos];
>                 imgID = imgArray[randomPos];
>
>                 rfcsArray.splice(randomPos, 1);
>                 imgArray.splice(randomPos, 1);
>
>                 //select and image id
>                 trace("imgID: " + imgID);
>
>                 //select corisponding rfcClip
>                 trace("rfcClip: " + rfcClip);
>
>                 //ALL ISSUES ARE OCCURING IN THIS LINE OF CODE FROM WHAT I 
> UNDERSTAND
>                 //COULD ANYONE HELP ME OUT WITH THIS?
>                 rfcClip.container.attachMovie(imgID);
>
>                 imagesToGrab--;
>                 clearInterval(loadImgInterval);
>                 loadImgInterval = setInterval(loadImages, 2000, imagesToGrab);
>         }
>         trace("imagesLeftToLoad: " + imagesToGrab);
>         trace(" ");
> }
>
> selectLayoutNum();
> stop();
> [/code]
>
>
> Corban Baxter |rich media designer |www.funimation.com
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Corban Baxter
> Sent: Thursday, February 02, 2006 10:45 AM
> To: flashcoders@chattyfig.figleaf.com
> Subject: RE: [Flashcoders] understanding the for loop - EXTENDED HELP NEEDED.
>
> Well, I am going to take a stab at strict formatting. Not sure how well this 
> is going to go but wish me luck as I venture off. Hopefully I can get some 
> help as I take this new road. I appreciate the insight Andreas,
>
> //cb
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andreas Rønning
> Sent: Wednesday, February 01, 2006 6:25 PM
> To: Flashcoders mailing list
> Subject: Re: [Flashcoders] understanding the for loop - EXTENDED HELP NEEDED.
> _______________________________________________
> 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
>


--
http://snafoo.org/
jabber: [EMAIL PROTECTED]
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to