another one of naming and retrieving
hi, i am trying to deal with some sprites i have created via script. each one can have draings and stuff, but in particular, all have a textfield inside.
something like (not the current code, but to give you an idea)
var _newtext:textfield = new textfield();
_newtext.name = "textname";
//
some_array[some_pos] = new sprite();
some_array[some_pos].addchild(_newtext);
(...)
// this gets the sprite in the array as parameter, they all have a textfield called 'textname' (not current name, but same case)
function whatever(some_sprite:sprite, etc):void {
// tried this:
some_sprite.textname.x = x_value; // gives error
// also this
var mytextfield:textfield = (textfield)some_sprite.getChildByName("textname"); // i dont know if there is casting in as3, but it also gives error.
}
in any case, what i am trying to do is access the properties of the textfiled defined in each sprite. it is not that there is no textfield named whatever inside the sprite, i defined it and i added with addchild when i created it, same for any sprite that gets there. how do i access the textfield inside?
tnx