Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MC array

Status
Not open for further replies.

Adam14

Technical User
Joined
Nov 8, 2003
Messages
193
Location
CA
Hi everyone. Hoping someone can help me with this one. I have this code in the first frame of my movie:

_root.fade2.gotoAndPlay(2);
_root.fade.gotoAndPlay(2);
i = 1;
pArray = new Array("pic"+i);
_root[pArray].gotoAndPlay(2);

function goOn() {
var j = 1;
p2Array = new Array("pic"+j);
_root[p2Array].gotoAndPlay(4);
}
setInterval(goOn, 2500);
i++;


I have MCs named pic1, pic2, pic3, and pic4. Using the above code, pic1 plays frame 2, and then frame 4 well th interval is up. My question is, why is my "i" not incrementing after the interval is done, and then have pic2 gotoAndPlay(2)? I mean, nothing happens...Any ideas?

Thanks, Adam
 
Where's the loop that's incrementing it?
 
Hey old, thanks for gettin' back to me so quickly. I have this on the first frame and another keyframe in the second. But, going twith your suggestion, and my ineptness, I changed it to:

_root.fade2.gotoAndPlay(2);
_root.fade.gotoAndPlay(2);

pArray = new Array();
for (var i = 1; i < 10; i++)
_root[&quot;pic&quot;+i].gotoAndPlay(2);


function goOn() {

p2Array = new Array(&quot;pic&quot;+j);
for (var j = 1; j < 5; j++)
_root[&quot;pic&quot;+j].gotoAndPlay(4);

}
setInterval(goOn, 2500);


So, now it increments, but all four pictures appear, right after each other. Is there some way I can increment the &quot;i&quot; from the MC timeline? Or am I waaaay off?

thanks,
Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top