As I said, it is easier to package up the items into a component and
repeat that. To that end, here is an example (Unfortunately, it appears
that vimeo is set up not to allow embedding. It does work with other web
sites however):

Application:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="vertical" xmlns:Vimeo="Vimeo.*"
creationComplete="onCreationComplete()">
     <mx:Script>
         <![CDATA[
             import mx.collections.ArrayCollection;
             import mx.collections.XMLListCollection;
             import mx.rpc.events.FaultEvent;
             import mx.rpc.events.ResultEvent;

             private var vimeoListArrayColl:ArrayCollection;

             private function onCreationComplete():void
             {
                 vimeoService.send();
             }

             private function onResult(event:ResultEvent):void
             {
                 vimeoListArrayColl = event.result.videos.video as
ArrayCollection;
                 vimeoRepeater.dataProvider = vimeoListArrayColl;
             }

             private function onFault(event:FaultEvent):void
             {

             }
         ]]>
     </mx:Script>
     <mx:Repeater id="vimeoRepeater">
         <Vimeo:VimeoList vimeoItem="{vimeoRepeater.currentItem}"/>
     </mx:Repeater>
     <mx:HTTPService id="vimeoService"
url="http://vimeo.com/api/v2/iglesiafls/videos.xml";
resultFormat="object" result="onResult(event)" fault="onFault(event)"/>
</mx:Application>

VimeoList.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml";>
     <mx:Script>
         <![CDATA[
             import mx.managers.PopUpManager;

             [Bindable] public var vimeoItem:Object;

             private function openWindowVimeo(event:MouseEvent):void
             {
                 var myVimeoWindow:VimeoWindow =
PopUpManager.createPopUp(this, VimeoWindow, true) as VimeoWindow;
                 myVimeoWindow.windowTitle = vimeoItem.title;
                 myVimeoWindow.iFrameSource = vimeoItem.url;
                 PopUpManager.centerPopUp(myVimeoWindow);
             }
         ]]>
     </mx:Script>
     <mx:Image source="{vimeoItem.thumbnail_medium}" width="200"
height="150"/>
     <mx:Text id="titleText" text="{vimeoItem.title}" color="#F5FBFC"
fontSize="14" width="300"/>
     <mx:Text text="{vimeoItem.description}" color="#F5FAFB"
width="300"/>
     <mx:Text text="{vimeoItem.url}"/>
     <mx:Button name="{vimeoItem.title}" label="ver video"
click="openWindowVimeo(event)" enabled="true"/>
</mx:VBox>

VimeoWindow.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml";
layout="vertical" width="800" height="600"
     xmlns:flexiframe="http://code.google.com/p/flex-iframe/";
     title="{windowTitle}"
     showCloseButton="true"
     close="titleWindow_close(event);">
     <mx:Script>
         <![CDATA[
             import mx.events.CloseEvent;
             import mx.managers.PopUpManager;

             [Bindable] public var windowTitle:String;
             [Bindable] public var iFrameSource:String;

             private function titleWindow_close(evt:CloseEvent):void
             {
                 PopUpManager.removePopUp(this);
             }
         ]]>
     </mx:Script>
     <flexiframe:IFrame id="iFrameBySource" width="100%" height="100%"
source="{iFrameSource}"/>
</mx:TitleWindow>

You will need flex-iframe from
https://github.com/flex-users/flex-iframe/ to embed the HTML.

Note that this is a quick and dirty example with no error checking etc.
You should use this to further your understanding rather than as a basis
for production code.

--- In flexcoders@yahoogroups.com, Gustavo Duenas <gduenas@...> wrote:
>
> This repeater is making me crazy, someone can help me out.
>
> Hi I have a repeater that has a button and the button open a title
> window component from flex
> So far I use the name property of the button to pass the title from
> the repeater to the title of the titlewindow
>
> here it is:
> Vimeo is the name of the repeater
> <mx:button name="{vimeo.currentItem.title}"
>
> on the as3:
> myWindow.title=event.currentTarget.name;
>
> so far I can open it with the names from the list.
>
> Also I have an html inside of the title window and I want to set its
> location from the parameters of the repeater
> so here is when it start to be hard to imagine a way to retrieve that
> information from the repeater and pass it to
> the location.
>
> here is my code.
> import mx.managers.PopUpManager;
>                      import mx.containers.*;
>                                import mx.controls.Alert;
>                                import mx.rpc.events.FaultEvent;
>                                import mx.rpc.events.ResultEvent;
>                                import flsWindow;
>
>                                private function
> openWindowVimeo(event:MouseEvent):void{
>                                          var
> myVimeoWindow:TitleWindow= TitleWindow(PopUpManager.createPopUp(this,
> flsWindow, true));
>                                          myVimeoWindow.width=800;
>                                          myVimeoWindow.height=600;
>                                          myVimeoWindow.title =
> event.currentTarget.name;
>                                          var myHtml:HTML= new HTML;
>
> myHtml.location={myText.text};//tried to make this happens though is
> always with error;
>                                          myHtml.width=800;
>                                          myHtml.height=600;
>                                          myHtml.x=0;
>                                          myHtml.y=0;
>                                         
myVimeoWindow.addChild(myHtml);
>
>
>
>                                }
>
> <mx:HTTPService id="vimeoService"
url="http://vimeo.com/api/v2/iglesiafls/videos.xml
> " resultFormat="e4x" fault="onFault(event)"/>
>
> <mx:XMLListCollection id="myVimeoList"
> source="{vimeoService.lastResult.video}"/>
>            <mx:VBox width="340" height="334" x="699" y="422">
>                      <mx:Repeater id="vimeo"
> dataProvider="{myVimeoList}">
>                      <mx:Image
> source="{vimeo.currentItem.thumbnail_medium}" width="200"
height="150"/>
>                      <mx:Text id="titleText"
> text="{vimeo.currentItem.title}" color="#F5FBFC" fontSize="14"
> width="300"/>
>                      <mx:Text text="{vimeo.currentItem.description}"
> color="#F5FAFB" width="300"/>
>                      <mx:Text text="{vimeo.currentItem.url}"
> id="myText"/>
>                      <mx:Button  name="{vimeo.currentItem.title}"
> label="ver video" click="openWindowVimeo(event)" enabled="true"/>
>
>    </mx:Repeater>
>    </mx:VBox>
>
>
> i would appreciate any help.
>
> Gus
> On Oct 7, 2011, at 8:28 AM, Gustavo Duenas wrote:
>
> > thanks for your help
> >
> > here is the error log
> >
> > Error: Repeater is not executing.
> >  at mx.core::Repeater/get
currentItem()[C:\autobuild\3.3.0\frameworks
> > \projects\framework\src\mx\core\Repeater.as:305]
> >  at iglesiaFls/openWindowVimeo()[/Users/gustavoduenas/Documents/Flex
> > Builder 3/iglesiaFls/src/iglesiaFls.mxml:17]
> >  at iglesiaFls/__vimeoButton_click()[/Users/gustavoduenas/Documents/
> > Flex Builder 3/iglesiaFls/src/iglesiaFls.mxml:51]
> >
> > On Oct 7, 2011, at 12:47 AM, Tandon, Rishi wrote:
> >
> >>
> >>
> >> You missed the most important thing in message, the error log.
> >> Send over that.
> >>
> >> From: Gustavo Duenas gduenas@...
> >> To: flexcoders@yahoogroups.com
> >> Sent: Friday, October 7, 2011 9:47 AM
> >> Subject: [flexcoders] help with a repeater
> >>
> >>
> >> I have a repeater which reads a xmllist from vimeo, it works and do
> >> the repeat but when I tried to pass info from the repeater to the
> >> title window, something happens and I have an as3
> >> errror. this is  my code.
> >>
> >> <mx:Script>
> >>   <![CDATA[
> >>   import mx.managers.PopUpManager;
> >>   import mx.containers.*;
> >>    import mx.controls.Alert;
> >>    import mx.rpc.events.FaultEvent;
> >>    import mx.rpc.events.ResultEvent;
> >>    import flsWindow;
> >>
> >>    private function openWindowVimeo(event:MouseEvent):void{
> >>     var myVimeoWindow:TitleWindow=
> >> TitleWindow(PopUpManager.createPopUp(this, flsWindow, true));
> >>     myVimeoWindow.title=vimeoService.lastResult.video.title;///this
> >> is the one using the xmlList,
> >> it works but only the last title and with tags there is a way that
> >> my different video titles will be in the opened windows?
> >> also when I try using the repeater like:
> >> myVimeoWindow.title=vimeo.currentItem.title
> >> is always giving me and error.
> >>
> >>    }
> >>
> >> ///here is my repeater, it works, but I cannot open the window as I
> >> want.
> >> <mx:HTTPService id="vimeoService"
url="http://vimeo.com/api/v2/iglesiafls/videos.xml
> >> " resultFormat="e4x" fault="onFault(event)"/>
> >> <mx:XMLListCollection id="myVimeoList"
> >> source="{vimeoService.lastResult.video}"/>
> >>  <mx:VBox width="340" height="334" x="699" y="422">
> >>   <mx:Repeater id="vimeo" dataProvider="{myVimeoList}">
> >>   <mx:Image source="{vimeo.currentItem.thumbnail_medium}"
> >> width="200" height="150"/>
> >>   <mx:Text text="{vimeo.currentItem.title}" color="#F5FBFC"
> >> fontSize="14" width="300"/>
> >>   <mx:Text text="{vimeo.currentItem.description}" color="#F5FAFB"
> >> width="300"/>
> >>   <mx:LinkButton label="ver video" click="openWindowVimeo(event)"
> >> id="vimeoButton" enabled="true"/>
> >>
> >>   </mx:Repeater>
> >>   </mx:VBox>
> >>
> >> Could someone help me out
> >>
> >> gus
> >>
> >>
> >>
> >
> >
> >
>

Reply via email to