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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array of movieClips objects

Status
Not open for further replies.

tziviak

Technical User
Oct 10, 2002
128
US
I'm trying to make a few movie clips a certain type of object-and then putting it into an array. This code is not working properly what am I doing wrong?

function objLine33 ()
{

}

Line33=[];
Line33.push(new objLine33(Line33A));
Line33.push(new objLine33(Line33B));
Line33.push(new objLine33(Line33C));
Line33.push(new objLine33(Line33D));
Line33.push(new objLine33(Line33E));

* all the lines are actual movieclips
and then when I'm trying to see if a user clicked on one of the items I wrote:
else if (this==objLine33) //but it doesn't recognize it

thank you

 
this may be the sort of thing you want

Code:
//change the 90 in the loop depending in number of chars used
line33=[]
for(var i = 65;i<90;i++){
	clip = eval(&quot;line33&quot; + chr(i))
line33.push(clip);
clip.onRelease = function(){
trace(String(this));
}
}
 
thank you for the code-but I have many differnt movie clips-that users can drag-and instead of writing:
if (this== line33[0]|| this ==line33[1] and so on)
I want to be able to check if this is the same object (I'll create an object for line33,line 47.... that way I can check if this is the object line33 (for ex)

do you get what I'm trying to do? is there any way to do it-(maybe I don't need objects-but I don't want to have to write each element of the array separately-and I can't have a loop-since I have a lot of if-and elses-to check for different types of lines)
thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top