Hi

I would rather have a simple way of doing it.

1) Only have one VideoDisplay instance
2) Attach it to selected VBox/View, as soon as view is selected.

Does this make sense?

-abdul

NisanthKumar wrote:
> Inside a VBox i have VideoDisplay that call by dynamically. Vbox is
> inside a viewstack .and i have a linkbar also.My need is when i click
> first one the first video will show and all the others deactive like
> that,,give me a solution..  My code is shown below
>
>
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> layout="absolute" backgroundGradientAlphas="[1.0, 1.0]"
> backgroundGradientColors="[#837575, #E5E6BA]" creationComplete="showXML
> ()">
>       <mx:ViewStack x="113" y="10" id="viewstack1" width="615" height="520"
>   
>       </mx:ViewStack>
>               <mx:LinkBar x="22" y="27" width="62" dataProvider="{viewstack1}"
> direction="vertical" alpha="0.07" styleName="link1">
>               </mx:LinkBar>
>       <mx:Script>
>               <![CDATA[
>                       import mx.controls.VideoDisplay;
>                       import mx.containers.VBox;
>
>               import mx.controls.Alert;
>               public function showDate():void{
>                         var date:Date = new Date();
>            Alert.show("Date: "+date.toLocaleString());
>   }
>               public function showXML():void{
>                       var myXML:XML = new XML();
>                       var XML_URL:String = 
> "http://192.168.0.122/SampleWorks/video.xml";;
>                       var myXMLURL:URLRequest = new URLRequest(XML_URL);
>                       var myLoader:URLLoader = new URLLoader(myXMLURL);
>                       myLoader.addEventListener("complete", xmlLoaded);
>
>
>                               function xmlLoaded(event:Event):void
>                               {
>                                       myXML = XML(myLoader.data);
>
>                               var rwlist:XMLList      = myXML.children();
>                               var length:int          = rwlist.length();
>                                       for(var i:int = 0 ; i<length ; i++ ){
>
>                                                                               
>         var v:VBox =new VBox();
>                                                                               
>                 var vid:VideoDisplay = new VideoDisplay();
>                                                                               
>                 vid.source      = rwlist[i].video_src;
>                                                                               
>                 vid.autoPlay    = false;
>
>                                                                               
>                 v.addChild(vid);
>                                                                       
> //viewstack1.currentStateChange = vid.play();
>                                                                       v.label 
> = rwlist[i].video_name;
>                                                                       
> viewstack1.addChild(v);
>                                               }
>
>
>                               }
>                 }
>               ]]>
>       </mx:Script>
>       <mx:Style source="style1.css"/>
> </mx:Application>
>
>
> Thanks in advance
>
> Nisanth
>
> >
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to