Skip to content

For( i in stuff )

An example of generating a for loop dynamically.
Let the flash do the heavy lifting.


// turn on all frames to fined active item
var parentClip:MovieClip =  _root.mainStage;
for( i in parentClip )
{

	if (typeof (parentClip[i]) == "movieclip") {
		if( parentClip[i]._name.substring(0,1) == "F" )
		{

			var holderClip:MovieClip = parentClip[i];
			for( j in holderClip )
			{
				if( holderClip[j]._name.substring(0,3) == "Box" )
				{
					holderClip[j].gotoAndStop(1);
				}
			}

		}
	}
}

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*