How to control videodisplay functions like videodisplay.stop, pause(), close etc from the presentation model? But I need to control it from Presentation model. Custom events is not my option, as that is costly.
Flex with Presentation model
207 Views Asked by Fresher4Flex At
2
There are 2 best solutions below
0

I used the Binding tag to solve a similar problem (calling centerAt on an ESRI Map) :
<fx:Binding source="model.videoState" destination="videoState"/>
<fx:Script>
<![CDATA[
private function set videoState(value:String):void
{
// do whatever is to be done
This avoid custom events, and preserve the pattern : your presentation model does not know about the video display.
Take a peek at my code behind approach: you could just give the model an id and call methods on it. But i really don't think custom events are too costly.