This content has been marked as final. Show 4 replies
getChildByName() returns a DisplayObject, which has no startUp field. You'll need to cast the object in order to use it as a cell. eg:
var child: Object = newCell.parent.getChildByName("newCell"+i+j);
var mycell: cell = cell(child); //Cast it
txt.text = mycell.startUp.toString();
I further want to know if i want to change the value of startUp which is a boolean type( user define, in the actionscript file, cell.as, i had created) for movieClip instance, (created earlier),....... lets say the current focussed movieClip is newCell51 when clicking on it the value of the startUp(boolean type) for movieClip(newCell41)which is just above the current focussed movieClip (newCell51) be changed.....such that if the value of startUp in newCell is "false" then it should be "true" and when clicking on the next focussed movieClip(newCell41) the value of startUp for the movieClip(newCell31) be changed........so on....
There's something else to be aware of, although in the code you have it may not be a problem.
When you do: cell = new Cell(); addChild(cell); the parent-child relationship is created (eg, cell.parent) but none of the UI, including measurement and layout has occured. So if your startUp method contains any references to the UI elements of cell or requires the parent to know where cell is, it won't work.
You need to give the Flex framework time to go through its tasks. Use events like creationComplete to let you know when the UI is ready.
As I said, this may not be a problem, but something to keep an eye on.
Thanks inLineBlue and Peterent and Brajeshwar ....your coments help me solve my problem...now i can understand things little bit...
When i cast the returned value, object , by getChildByName ( ) method, like the following code, I got my solution:-
Thanks once more.