PDA

View Full Version : Troubles with list component


ISomebody
06-05-2006, 04:36 PM
Hi all,

I'm an absolute newbie, I've just been using Flash for a couple of weeks, and this is the first time i'm trying to do something in ActionScript.

So, I created a new document, and put a list component on it (just as on the picture). Then i put 7 labels next to it. I wanted to make the text of the 7 labels change whenever i click one of the rows in my list object. I've tried a lot of ways to tell that stuff to Flash, but it didn't understand. :)

I think (thought) it's not a big thing to write that code, now i see (for me) it is.

Please help!


Oh, and sorry for my poor English knowledge, I'm just a foreigner student. :)

Xeef
06-05-2006, 05:53 PM
hi and welcome to As.Org


//instance name of the List component "_list"
_list.addEventListener("change", _list);
_list.change = function(evn) {
trace(evn.target.selectedItem.label);
//here code to change the textfields
//like
//_root.myText.text=evn.target.selectedItem.label
//_root.myData.text=evn.target.selectedItem.Data
};

udv. Csaba ;)

ISomebody
06-05-2006, 06:21 PM
Oops...
Thanks a lot, but there are other problems.. :)
Let's call the list nevvalaszto and the label nevlabel.
what is the code then? :)

thanks again for the help


Hoppá..
kösz nagyon, de vannak további gondok... :)
szóval hívjuk a listát nevvalaszto-nak, a label-t meg nevlabel-nek.
így hogy nézne ki a kód? :)

kösz a segítséget mégegyszer

Xeef
06-05-2006, 07:10 PM
nevvalaszto.change = function(O) {
_root.nevlabel.text = O.target.selectedItem.label;
};
nevvalaszto.addEventListener("change", nevvalaszto);