0 Replies Latest reply on Jul 30, 2009 1:55 PM by jimmyoneshot

    Problems Displaying Images Within Installed AIR application

    jimmyoneshot Level 1

      I thought I'd already managed to fix this problem but it doesn't seem to be the case. I have two tilelists that items can be dragged between and when each item is clicked the information and"largeImage" contained within it should display in the right hand panel however this works fine in previewing but when I actually change it into an air application and run it the images do not display in the right hand panel when each item within the tilelists is clicked.

       

      What changes would I need to make to this code to make it work correctly when changed into an AIR app?

       

      <mx:WindowedApplication

       

       

      xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initprofile1NewsAndSportSO()"

      >

       

       

       

      <mx:Script>

      <![CDATA[

       

      [

       

      Bindable

      ]

      [

       

       

      Embed(source="assets/images/bbcnews_small.png"

      )]

       

       

       

      public var

      image1:Class;

       

       

      Bindable

      ]

      [

       

       

      Embed(source="assets/images/itv_small.png"

      )]

       

       

       

      public var

      image2:Class;

       

       

      Bindable

      ]

      [

       

       

      Embed(source="assets/images/skynews_small.png"

      )]

       

       

       

      public var

      image3:Class;

       

       

      </mx:Script>

       

       

       

      <mx:Script>

      <![CDATA[

       

       

      import

      mx.collections.*;

       

       

       

      import

      flash.net.SharedObject;

       

       

       

      public var

      profile1NewsAndSportSO:SharedObject;

       

       

       

      private var profile1NewsAndSportaddLinksFullAC:ArrayCollection = new

      ArrayCollection([

      {link:

       

       

      "www.bbcnews.com", label:"BBC News", icon:"image1", largeImage:"assets/images/bbcnews_small.png", title:"BBC News", description:"BBC News description will go here"

      },

      {link:

       

       

      "www.itv.com/", label:"ITV", icon:"image2", largeImage:"assets/images/itv_small.png", title:"ITV", description:"ITV Description will go here"

      },

      {link:

       

       

      "www.skynews.com", label:"Sky News", icon:"image3", largeImage:"assets/images/skynews_small.png", title:"Sky News", description:"Sky News Description will go here"

      }

       

       

      private var profile1NewsAndSportaddLinksAC:ArrayCollection = new

      ArrayCollection([

      {link:

       

       

      "www.bbcnews.com", label:"BBC News", icon:"image1", largeImage:"assets/images/bbcnews_small.png", title:"BBC News", description:"BBC News description will go here"

      },

      {link:

       

       

      "www.itv.com/", label:"ITV", icon:"image2", largeImage:"assets/images/itv_small.png", title:"ITV", description:"ITV Description will go here"

      },

      {link:

       

       

      "www.skynews.com", label:"Sky News", icon:"image3", largeImage:"assets/images/skynews_small.png", title:"Sky News", description:"Sky News Description will go here"

      }

       

       

      private function profile1NewsAndSportReset():void

      {

       

       

      new

      ArrayCollection([]);

       

       

      private function resetprofile1NewsAndSportAC():void

      {

       

       

      for each(var obj:Object in

      profile1NewsAndSportaddLinksFullAC){

       

       

      private function initprofile1NewsAndSportSO():void

      {

      profile1NewsAndSportSO = SharedObject.getLocal(

       

       

      "profile1NewsAndSport"

      );

       

       

       

      if

      (profile1NewsAndSportSO.size > 0){

       

       

      if

      (profile1NewsAndSportSO.data.profile1NewsAndSportaddList){

       

       

       

      if(profile1NewsAndSportSO.data.profile1NewsAndSportaddList != "empty"

      ){

       

       

       

      var profile1NewsAndSportaddList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportaddList.split(","

      );

       

       

       

      var profile1NewsAndSporttempAC1:ArrayCollection = new

      ArrayCollection();

       

       

       

      for each(var str:String in

      profile1NewsAndSportaddList){

       

       

       

      for each(var obj1:Object in

      profile1NewsAndSportaddLinksAC){

       

       

       

      if

      (str == obj1.label){

       

       

      continue

      ;

       

       

      if

      (profile1NewsAndSporttempAC1.length > 0){

       

       

      if

      (profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList){

       

       

       

      var profile1NewsAndSportchoiceList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList.split(","

      );

       

       

       

      var profile1NewsAndSporttempAC2:ArrayCollection = new

      ArrayCollection();

       

       

       

      for each(var str2:String in

      profile1NewsAndSportchoiceList){

       

       

       

      for each(var obj2:Object in

      profile1NewsAndSportaddLinksAC){

       

       

       

      if

      (str2 == obj2.label){

       

       

      continue

      ;

       

       

      if

      (profile1NewsAndSporttempAC2.length > 0){

       

       

      else

      {

       

       

      private function saveprofile1NewsAndSport(event:MouseEvent):void

      {

       

       

       

      var profile1NewsAndSportaddList:String = ""

      ;

       

       

       

      if

      (profile1NewsAndSportAddLinksTilelist.dataProvider){

       

       

       

      if

      (ArrayCollection(profile1NewsAndSportAddLinksTilelist.dataProvider).length > 0){

       

       

       

      for each(var obj1:Object in

       

       

      ","

      ;

       

       

      else

      {

      profile1NewsAndSportaddList =

       

       

      "empty"

      ;

       

       

      var profile1NewsAndSportchoiceList:String = ""

      ;

       

       

       

      for each(var obj2:Object in

       

       

      ","

      ;

       

       

      </mx:Script>

       

       

       

      <mx:TileList id="profile1NewsAndSportAddLinksTilelist" fontWeight="bold" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true" height="292" width="650" left="21" columnCount="5" rowHeight="145" columnWidth="125" itemClick="titleLabel.text=profile1NewsAndSportAddLinksTilelist.selectedItem.ti tle; websiteLinkLabel.text=profile1NewsAndSportAddLinksTilelist.selectedItem.link; descLabel.text=profile1NewsAndSportAddLinksTilelist.selectedItem.description; linkImage.source=profile1NewsAndSportAddLinksTilelist.selectedItem.largeImage;" itemDoubleClick="{navigateToURL(new URLRequest('http://' + profile1NewsAndSportAddLinksTilelist.selectedItem.link))}" doubleClickEnabled="true" backgroundColor="#000000" borderColor="#FFFFFF" color="#FFFFFF" borderSides="top right left" y="25"/>

       

       

      <mx:Canvas id="SitePreviewArea" y="10" width="453" height="540" backgroundColor="#545050" cornerRadius="20" borderStyle="solid" x="692" borderThickness="2" dropShadowEnabled="true" borderColor="#000000"

      >

       

       

      <mx:Label x="45" y="309" text="Website Name:" width="150" height="52" fontSize="14" fontWeight="bold" color="#FFFFFF" left="10"/>

       

       

       

      <mx:Label x="150.5" y="309" id="titleLabel" width="282.5" height="24" fontWeight="bold" fontSize="14" color="#FCFF00"

      />

       

       

      <mx:Label x="124.5" y="385" text="Website Description:" width="200" height="24" fontSize="14" fontWeight="bold" color="#FFFFFF" textAlign="center"/>

       

       

       

      <mx:TextArea x="16" y="417" id="descLabel" width="421" height="69" textAlign="left" color="#FCFF00" borderThickness="0" backgroundColor="#545050" editable="false" enabled="true" disabledColor="#FFFFFF" backgroundDisabledColor="#545050" fontWeight="bold" fontSize="12"

      />

       

       

      <mx:Label x="61" y="342" text="Website Link:" width="150" height="52" fontSize="14" fontWeight="bold" color="#FFFFFF" left="10"

      />

       

       

      <mx:TextArea x="150.5" y="343" id="websiteLinkLabel" width="282.5" height="33" fontWeight="bold" fontSize="12" color="#FCFF00" borderThickness="0" backgroundColor="#545050" editable="false" enabled="true" disabledColor="#FCFF00" backgroundDisabledColor="#545050"

      />

       

       

      <mx:Button id="goToSiteButton" top="494" left="168" label="VISIT SITE" fontWeight="bold" fontSize="14" color="#000000" click="{navigateToURL(new URLRequest('http://' + websiteLinkLabel.text))}" fillAlphas="[1.0, 1.0]" fillColors="[#FFFFFF, #DCDCDC]" borderColor="#000000"

      />

       

       

      <mx:Canvas x="99.5" y="51" width="250" height="250" backgroundColor="#FFFFFF"

      >

       

       

      <mx:Image id="linkImage" click="{navigateToURL(new URLRequest('http://' + websiteLinkLabel.text))}" width="250" height="250" x="0" y="0" scaleContent="true" top="2" right="2" left="2" bottom="2"

      />

       

       

      </mx:Canvas>

       

       

      </mx:Canvas>

       

       

      <mx:TileList id="profile1NewsAndSportLinkChoice" fontWeight="bold" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true" height="292" width="650" left="21" columnCount="5" rowHeight="145" columnWidth="125" itemClick="titleLabel.text=profile1NewsAndSportLinkChoice.selectedItem.title; websiteLinkLabel.text=profile1NewsAndSportLinkChoice.selectedItem.link; descLabel.text=profile1NewsAndSportLinkChoice.selectedItem.description; linkImage.source=profile1NewsAndSportLinkChoice.selectedItem.largeImage;" itemDoubleClick="{navigateToURL(new URLRequest('http://' + profile1NewsAndSportLinkChoice.selectedItem.link))}" doubleClickEnabled="true" backgroundColor="#000000" borderColor="#FFFFFF" color="#FFFFFF" borderSides="top right left" y="325"

      />

       

      </mx:WindowedApplication>

       

       

      }

      profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList = profile1NewsAndSportchoiceList;

      profile1NewsAndSportSO.flush();

      }

      ]]>

       

      profile1NewsAndSportLinkChoice.dataProvider){

      profile1NewsAndSportchoiceList += obj2.label +

      }

      }

      profile1NewsAndSportSO.data.profile1NewsAndSportaddList = profile1NewsAndSportaddList;

       

      }

      }

      profile1NewsAndSportAddLinksTilelist.dataProvider){

      profile1NewsAndSportaddList += obj1.label +

      profile1NewsAndSportReset();

      }

      }

       

      profile1NewsAndSportLinkChoice.dataProvider = profile1NewsAndSporttempAC2;

      }

      }

      }

      }

      }

      }

       

      profile1NewsAndSporttempAC2.addItem(obj2);

       

      profile1NewsAndSportAddLinksTilelist.dataProvider = profile1NewsAndSporttempAC1;

      }

      }

      }

       

      }

      }

      }

       

      profile1NewsAndSporttempAC1.addItem(obj1);

       

       

       

      profile1NewsAndSportaddLinksAC.addItem(obj);

      }

      }

       

       

      profile1NewsAndSportaddLinksAC.removeAll();

       

      }

       

       

      resetprofile1NewsAndSportAC();

      profile1NewsAndSportAddLinksTilelist.dataProvider

      = profile1NewsAndSportaddLinksAC;

      profile1NewsAndSportLinkChoice.dataProvider =

      ]);

       

      ]);

       

       

       

      ]]>

       

       

      [

       

      [

      <?xml version="1.0" encoding="utf-8"?>