0 Replies Latest reply on Nov 2, 2011 10:22 AM by Web Magi

    navigateToURL - RSS Feed Reader Linking Issue

    Web Magi Level 4

      Hi, I am working on an RSS feed reader. The reader pulls blog entries just fine, but the results are not clickable. Tried numerous variations of "navigateToURL", but am relatively new to the Flex framework. Is there a way to make generated feed clickable? See code below:

       

       

      <?xml version='1.0' encoding='UTF-8'?>
      <s:Application xmlns:d="http://ns.adobe.com/fxg/2008/dt"
                     xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/halo"
                     xmlns:feed="services.feed.*"
                     width="275" height="325" backgroundColor="#E2E7E9" preloaderChromeColor="#E2E7E9"
                     viewSourceURL="srcview/index.html">
          
          <!-- Blog Feed 1.0 -->
          
          <!-- Properties of the parent ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
          
          <!-- Metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
          
          <!-- Styles ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
          
          <!-- Script ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
          <fx:Script>
              <![CDATA[
                  import mx.events.FlexEvent;
                  import flash.net.navigateToURL;
                  
                  protected function list_creationCompleteHandler(event:FlexEvent):void
                  {
                      getDataResult.token = feed.getData();
                  }
                  
                  public function feed_clickHandler(event:MouseEvent):void
                  {
                      navigateToURL(new URLRequest("http://blog.mysite.com/feed/"+getDataResult.lastResult.title));
                  } 
                  
              ]]>
          </fx:Script>
          <!-- Script ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
          
          <!-- Declarations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
          <fx:Declarations>
              <s:CallResponder id="getDataResult"/>
              <feed:Feed id="feed" showBusyCursor="true"/>
          </fx:Declarations>
          <!-- Declarations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
          
          <!-- UI components ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
          <fx:DesignLayer d:userLabel="Content">
              <s:BitmapImage d:userLabel="Shape 2" x="1" y="64" smooth="true"
                             source="@Embed('/assets/images/PSM-RSS-Feed/Shape 2.png')"/>
              <s:BitmapImage d:userLabel="line highlight" x="263" y="66" smooth="true"
                             source="@Embed('/assets/images/PSM-RSS-Feed/line highlight.png')"/>
          </fx:DesignLayer>
          <fx:DesignLayer d:userLabel="Feed Item">
          </fx:DesignLayer>
          <fx:DesignLayer d:userLabel="Scrollbar">
              <s:List id="list" x="4" y="64" click="feed_clickHandler(event)"
                      creationComplete="list_creationCompleteHandler(event)"
                      skinClass="components.FeedDataListSkin4">
                  <s:AsyncListView list="{getDataResult.lastResult}"/>
              </s:List>
          </fx:DesignLayer>
          <fx:DesignLayer d:userLabel="Header">
              <s:BitmapImage d:userLabel="Shape 1" x="1" y="1" smooth="true"
                             source="@Embed('/assets/images/PSM-RSS-Feed/Shape 1.png')"/>
              <s:BitmapImage d:userLabel="Lines" x="12" y="43" smooth="true"
                             source="@Embed('/assets/images/PSM-RSS-Feed/Lines.png')"/>
              <s:BitmapImage d:userLabel="Pomona Swap Meet" x="11" y="8" smooth="true"
                             source="@Embed('/assets/images/PSM-RSS-Feed/Pomona Swap Meet.png')"/>
              <s:BitmapImage d:userLabel="Blog" x="184" y="31" smooth="true"
                             source="@Embed('/assets/images/PSM-RSS-Feed/Blog.png')"/>
          </fx:DesignLayer>
          <!-- UI components ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
          
      </s:Application>
      

       

      I tried to connect a click event to the feed "title", but I'm not sure that the mouse event function is correct, or that I have placed the "clickHandler(event)" in the right location. Any thoughts would be appreciated.

       

      Thx.