Reputation: 2680
i have in my main application:
private var vm:VideoManager;
protected function init():void{
vm = new VideoManager();//create a video manager instance
}
and i want to pass the vm instance to another component so i do:
<components:LatestVideos left="10" right="10" top="90" bottom="70"
vm = "{vm}"/>
and in that component i have
[Bindable]public var vm:VideoManager;
but it does not get a value it is null, what's wrong with that??
thanks in advance!
Upvotes: 0
Views: 132
Reputation: 826
You have to create your instance of VideoManager in the initialize event instead of creationComplete in your main application.
Looks like your custom component is created before the creationComplete event is fired. That's why you have a null value.
So instead of creationComplete="init()"
try initialize="init()"
I juste tested it and it is working. Good luck
Upvotes: 1