Anyone? Sorry Jason I didn't mean to anger you. I have been looking at
this for almost 10hours now and I can't take it anymore!

//cb


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Corban
Baxter
Sent: Thursday, February 02, 2006 3:50 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] scope of function... undefined?

Hey all this is kind of a repost but I have a weird problem... Ok I have
a function I am calling on the root timeline and when I trace(this)
inside of it I am getting a return of undefined. What would cause this?
Here is the function. 

[code]

function loadImages(imagesToGrab:Number) {
        if (imagesToGrab == 0) {
                //stop loading images
                clearInterval(loadImgInterval);
                trace("hitting the clear");
        } else {
                var randomPos:Number = random(imagesToGrab)+1;
                var rfcClip:MovieClip = rfcsArray[randomPos];
                var imgID:String = imgArray[randomPos];
                
                //delete from array to keep from running one more than
once
                rfcsArray.splice(randomPos, 1);
                imgArray.splice(randomPos, 1);
                
                //trying to decipher wtf is going on....
                trace("imgID: "+imgID); //returns layout5_set3_img10
                trace("rfcClip: "+rfcClip); //returns lay5_img10
                trace(this[rfcClip]); //returns undefined - WHY!
                trace(this); //returns undefined - WHY!
                
                //ALL ISSUES ARE OCCURING IN THIS LINE OF CODE FROM WHAT
I UNDERSTAND
                this[rfcClip].container.attachMovie(imgID, imgID,
this.getNextHighestDepth());
                
                
                imagesToGrab--;
                clearInterval(loadImgInterval);
                loadImgInterval = setInterval(loadImages, 2000,
imagesToGrab);
        }
        trace("imagesLeftToLoad: "+imagesToGrab);
        trace(" ");
}

[/code]

if you want to look at my FLA be my guest...
http://webdev.funimation.com/fun2004/coders/s3.zip


//cb


_______________________________________________
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