Getting reference of a dynamic instancied part
Hi,
I'd like to know what is the best practice about getting a reference of a dynamic instancied part.
Here is a use case:
Definition of my dynamic SkinPart:
[SkinPart(type="spark.components.Group")]
public var minutesGroup:IFactory;
Somewhere in my code, I need to acces the instancied group.
At the moment , I have something really ugly that looks like this :
HorizontalLayout(Group(dropDown.getChildByName("minutesGroup")).layout).paddingLeft = _selectedHour.x;
Not only this is unreadable but will slow down my application.
So how do you think I should handle this?
Should I create a instanciedMinutesGroup class variable that gets a reference of the Group?
(something like :
instanciedMinutesGroup = createDynamicPartInstance("minutesGroup") as Group; )
I guess this is a better solution that the one I'm using for now, but I will have at some time, 3 or 4 dynamic parts and creating a class variable for each part seems inappropriate.
Also, I see there is a getDynamicaPartAt method but I won't know what is the index of that part.
Any help welcomed! ![]()
