Okay,

So, a few things:

#1) your TvView component must have either a property or a
getter/setter method to hold the data from the collection. So, for
example, you might have a bindable public property inside of TvView
called 

[Bindable]
var myDataProvider:ArrayCollection;

Then inside of the TvView component, your horizontal list would use
this variable as its dataprovider.

So

<mx:HorizontalList dataProvider="{myDataProvider}"/>

Then, inside of the MXML file that you posted, your TvView component
would be called like this:

<mx:ViewStack width="100%" height="80%" creationPolicy="all">
  <TvView id="tvView" label="TV" myDataProvider="{epCollection}"/> 
</mx:ViewStack>

Does that make sense?
Mike


--- In [email protected], "pioplacz" <[EMAIL PROTECTED]> wrote:
>
> If you look at my ViewStack code i have a component name TvView.
That is a MXML file 
> with a horizontalList and for that list i wan the epCollection to be
a dataprovider. With 
> simpel words what i'm trying to do is to make epCollection result to
work in a diffrent 
> MXML file. 
> 
> Is is a better explenation? 
> --- In [email protected], "Michael Labriola" <labriola@> wrote:
> >
> > 
> > Can you explain more about what you are trying to do?
> > 
> > I see that you have 3 arrayCollections.
> > 
> > Only 1 of them seems to be used in the code, and, in that one, you are
> > only using the length property.
> > 
> > Please provide details about what you are trying to accomplish.
> > 
> > Thanks,
> > --Mike
> > 
> > --- In [email protected], "pioplacz" <icep87@> wrote:
> > >
> > > 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/
 

Reply via email to