I have a question about how to bind data in a viewstack component. How can i make my ArrayCollection to work in the viewstack component?
Here is my code... <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" horizontalAlign="center" verticalAlign="middle" backgroundGradientColors="[#000000, #000000]" width="100%" height="100%" creationComplete="initApp()" viewSourceURL="srcview/index.html" xmlns="*"> <mx:HTTPService id="movieService" url="http://192.168.25.200/PHP/katalog.php" useProxy="false" result="srv_results(event)"/> <!-- HTTPSerivce for the tv-shows starts here --> <mx:HTTPService id="tvService" url="http://192.168.25.200/PHP/tvshows.php" useProxy="false" result="tv_results(event)"/> <mx:HTTPService id="epService" url="http://192.168.25.200/PHP/tvepisodes.php" useProxy="false" result="ep_results(event)"/> <!-- END --> <mx:Model id="ipService" source="data/ip.xml"/> <mx:Style source="katalog2main.css"/> <mx:Script> <![CDATA[ import mx.collections.IViewCursor; import mx.rpc.events.ResultEvent; import mx.collections.ArrayCollection; import mx.events.ItemClickEvent; import mx.controls.Alert; import mx.events.CloseEvent; import flash.events.Event; private function initApp():void { movieService.send(); tvService.send(); epService.send(); } public function srv_results(event:ResultEvent):void { //Alert.show(ObjectUtil.toString(event.result) ); movieCollection = event.result.helakatalog.katalog as ArrayCollection; //movieCollection.filterFunction=movieFilter; } public function tv_results(event:ResultEvent):void { tvCollection = event.result.helakatalog.katalog as ArrayCollection; //tvCollection.filterFunction=tvshowsFilter; } public function ep_results(event:ResultEvent):void { epCollection = event.result.helakatalog.katalog as ArrayCollection; //epCollection.filterFunction=episodeFilter; } [Bindable] private var movieCollection:ArrayCollection; [Bindable] private var tvCollection:ArrayCollection; [Bindable] private var epCollection:ArrayCollection; ]]> </mx:Script> <mx:VBox width="85%" height="100%" verticalCenter="20" id="mainVbox" horizontalCenter="0" horizontalAlign="center" verticalAlign="middle"> <mx:ViewStack width="100%" height="80%" creationPolicy="all"> <TvView id="tvView" label="TV"/> </mx:ViewStack> <mx:ApplicationControlBar id="dockedBar" dock="true" width="100%"> <mx:HBox horizontalAlign="right" paddingBottom="5" paddingTop="5"> <mx:Image source="assets/zoom.png" autoLoad="true" height="100%" verticalAlign="middle" scaleContent="false"/> <mx:TextInput id="filterInput" text="" change="movieCollection.refresh();" width="166" toolTip="Skriv.."/> <mx:Spacer width="100%" id="spacer1"/> <mx:Image source="assets/color_swatch.png" autoLoad="true" height="100%" verticalAlign="middle" scaleContent="false"/> <mx:Text text="Kategori" color="#ffffff" fontSize="12" fontFamily="Arial" fontWeight="bold" textAlign="left" selectable="false"/> </mx:HBox> <mx:HBox horizontalAlign="right" width="100%" paddingBottom="5" paddingTop="5"> <mx:Image source="assets/application_cascade.png" autoLoad="true" height="100%" verticalAlign="middle" scaleContent="false" id="image2"/> <mx:LinkButton id="stchange" label="Byta läge" textAlign="left" width="69" click="currentState='Grid'"/> <mx:Image source="assets/film.png" autoLoad="true" height="100%" verticalAlign="middle" scaleContent="false" id="image3"/> <mx:Text id="counterText" text="{movieCollection.length}" paddingTop="2" color="#ffffff" fontWeight="bold" textAlign="left" width="30" height="20" selectable="false" toolTip="Antal filmer som visas"/> <!--<mx:LinkButton id="intlink" label="Download" />--> </mx:HBox> </mx:ApplicationControlBar> <mx:HBox id="footer" width="100%"> <mx:LinkButton id="tvchange" label="TvShows"/> <mx:Spacer width="100%" /> <mx:Text text="FilmKatalog Ver.2 BETA" color="#ffffff" fontWeight="bold" fontSize="12" fontFamily="Arial" textAlign="right" id="text1"/> <mx:Image source="assets/world_link.png" autoLoad="true" height="100%" verticalAlign="middle" scaleContent="false" id="image1"/> </mx:HBox> </mx:VBox> </mx:Application> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

