Jump to content

Problem sa instanciranjem


godza

Recommended Posts

imam neki loop tipa

 

for (x=0; x

tmp=_root.year.attachMovie("link","linka"+x,2);

tmp._x= 30+x*5;

tmp.link.text="project"+x;

}

 

eh kad ovako radim normalno overwritujem svaki tmp i na kraju dobijem instanciran jedan objekat umesto 5.

 

znam da je jedno reshenje da kreiram niz objekata, ali ja to jednostavno ne znam da uradim u AS-u.

 

Pomoc?

Link to comment
Share on other sites

update

 

var niz = new Array();

for (x=0; x

niz[x]=_root.year.attachMovie("link","link"+x,2);

niz[x]._x= 30+x*5;

niz[x].linkic.linktitle.text="Project "+x;

niz[x]._y=(x*10);

trace(niz[x]);

}

 

kao trace dobijam

_level0.year.link0

_level0.year.link1

_level0.year.link2

_level0.year.link3

_level0.year.link4

 

ali ne kontam sto mi se na movie-u prikazuje samo poslednja instanca :(:(

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...
powered by