5/10/2010 9:57:06 PM
Title:
how to access private variables in flex
<mx:Script>
<![CDATA[
private function myEventHandler(event:MouseEvent):void {
var obj:Object = ((event.currentTarget).getRepeaterItem().@mediahubfile);
}
]]>
<mx:VideoDisplay id="vid" source="obj" autoPlay="true" width="400" height="300" />
hi ,i am new to programming world
i want to pass reference of obj to video display as source
plzzz help
5/10/2010 10:56:34 PM
you can do it like this -
[Bindable]
private var obj:Object;
<mx:Script>
<![CDATA[
private function myEventHandler(event:MouseEvent):void {
obj = ((event.currentTarget).getRepeaterItem().@mediahubfile);
}
]]>
<mx:VideoDisplay id="vid" source="obj" autoPlay="true" width="400" height="300" />
5/10/2010 10:58:35 PM
Sorry I did a mistake in above code,I declared obj variable outside of script tag , just a typo , Do like this -
<mx:Script>
<![CDATA[
[Bindable]
private var obj:Object;
private function myEventHandler(event:MouseEvent):void {
obj = ((event.currentTarget).getRepeaterItem().@mediahubfile);
}
]]>
<mx:VideoDisplay id="vid" source="obj" autoPlay="true" width="400" height="300" />
5/10/2010 11:24:59 PM
Thank u amar.
but still the video is not playing ,should i use play(),if yes where and how to use it.