Could some one please take a look at my fla or the code and tell me why flash
won't attach this clips correctly? Please! I'm not much of a beggar but this is
getting out of hand. I feel like I have done this a thousand times and this
time it won't work.
[code]
///varibles setup
var layoutNum:Number;
var setsArray:Array = [null, 3, 3, 3, 3, 4];
var totalSetsNLayout:Number;
var totalImagesNLayout:Array = [null, 9, 8, 6, 6, 11];
var imagesToGrab:Number;
var imgArray:Array = new Array();
var rfcsArray:Array = new Array();
var randomSet:Number;
function selectLayoutNum() {
//check if it was the last layout
//set layoutNum
layoutNum = random(5)+1;
while (layoutNum == oldNum) {
layoutNum = random(5)+1;
}
var oldNum:Number = layoutNum;
trace("layoutNum: "+layoutNum);
getSetsNLayout(layoutNum);
}
function getSetsNLayout(layoutNum) {
totalSetsNLayout = setsArray[layoutNum];
trace("totalSetsNLayout: "+totalSetsNLayout);
gatherImages4Layout(totalSetsNLayout, layoutNum);
}
function gatherImages4Layout(totalSetsNLayout, layoutNum) {
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;
}
var oldSet:Number = randomSet;
var img:String = "layout"+layoutNum+"_set"+randomSet+"_img"+i;
imgArray.push(img);
var myMC:String = "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 {
var randomPos:Number = random(imagesToGrab)+1;
var rfcClip:String = rfcsArray[randomPos];
var imgID:String = imgArray[randomPos];
rfcsArray.splice(randomPos, 1);
imgArray.splice(randomPos, 1);
//select and image id
trace("imgID: "+imgID);
//select corisponding rfcClip
trace("rfcClip: "+rfcClip+" - typeof("+typeof (rfcClip)+")");
//will strict data typing not assure me that I am pulling clip
references?
//ALL ISSUES ARE OCCURING IN THIS LINE OF CODE FROM WHAT I
UNDERSTAND
//COULD ANYONE HELP ME OUT WITH THIS?
this[rfcClip].container.attachMovie(imgID, imgID,
this.getNextHighestDepth());
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 1:29 PM
To: Flashcoders mailing list
Subject: RE: [Flashcoders] this[rfcClip].container.attachMovie[imgID];
Sorry that's what I meant to type. It's in the code correct. Any other ideas?
Corban Baxter | rich media designer | www.funimation.com
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adrian Lynch
Sent: Thursday, February 02, 2006 11:55 AM
To: Flashcoders mailing list
Subject: RE: [Flashcoders] this[rfcClip].container.attachMovie[imgID];
Try: this[rfcClip].container.attachMovie(imgID);
Ade
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Corban
Baxter
Sent: 02 February 2006 17:15
To: [email protected]
Subject: [Flashcoders] this[rfcClip].container.attachMovie[imgID];
Hey guys I am working on this project still that is doing a whole lot of
random things. Since I have not converted over to AS2 yet I am having
some problems with doing this...
"this[rfcClip].container.attachMovie[imgID];" the rfcClip and the imgID
variables are pulling from arrays and seem to trace perfect but for some
reason the clip's are not showing up nor attaching to my stage. I was
hoping someone could take a quick look at the file and tell me what they
think might be the problem. I have uploaded a zip with the FLA to my dev
server. Any help would be greatly appreciated. Thanks!
http://webdev.funimation.com/fun2004/coders/s3.zip - FLA file
Problem occurs in the loadImage function on frame 9 line 51. This
function is called though an interval at the end of each marker: ie
marker: lay_1, lay_2 etc...
//cb
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders