10 Replies Latest reply on Jul 31, 2009 11:42 AM by jimmyoneshot

    Persistent Problems displaying images

    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?

       

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

      <mx:Application

       

       

      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

      {

      resetprofile1NewsAndSportAC();

      profile1NewsAndSportAddLinksTilelist.dataProvider

      = profile1NewsAndSportaddLinksAC;

      profile1NewsAndSportLinkChoice.dataProvider =

       

      new

      ArrayCollection([]);

      }

       

       

       

      private function resetprofile1NewsAndSportAC():void

      {

      profile1NewsAndSportaddLinksAC.removeAll();

       

       

      for each(var obj:Object in

      profile1NewsAndSportaddLinksFullAC){

      profile1NewsAndSportaddLinksAC.addItem(obj);

      }

      }

       

       

       

      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){

      profile1NewsAndSporttempAC1.addItem(obj1);

       

       

      continue

      ;

      }

      }

      }

       

       

      if

      (profile1NewsAndSporttempAC1.length > 0){

      profile1NewsAndSportAddLinksTilelist.dataProvider = profile1NewsAndSporttempAC1;

      }

      }

      }

       

       

      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){

      profile1NewsAndSporttempAC2.addItem(obj2);

       

       

      continue

      ;

      }

      }

      }

       

       

      if

      (profile1NewsAndSporttempAC2.length > 0){

      profile1NewsAndSportLinkChoice.dataProvider = profile1NewsAndSporttempAC2;

      }

      }

      }

       

      else

      {

      profile1NewsAndSportReset();

      }

      }

       

       

      private function saveprofile1NewsAndSport(event:MouseEvent):void

      {

       

       

      var profile1NewsAndSportaddList:String = ""

      ;

       

       

      if

      (profile1NewsAndSportAddLinksTilelist.dataProvider){

       

       

      if

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

       

       

      for each(var obj1:Object in

      profile1NewsAndSportAddLinksTilelist.dataProvider){

      profile1NewsAndSportaddList += obj1.label +

       

      ","

      ;

      }

      }

       

      else

      {

      profile1NewsAndSportaddList =

       

      "empty"

      ;

      }

      }

      profile1NewsAndSportSO.data.profile1NewsAndSportaddList = profile1NewsAndSportaddList;

       

       

      var profile1NewsAndSportchoiceList:String = ""

      ;

       

       

      for each(var obj2:Object in

      profile1NewsAndSportLinkChoice.dataProvider){

      profile1NewsAndSportchoiceList += obj2.label +

       

      ","

      ;

      }

      profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList = profile1NewsAndSportchoiceList;

      profile1NewsAndSportSO.flush();

      }

      ]]>

       

       

      </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.title; 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:Application>

        • 1. Re: Persistent Problems displaying images
          injpix Level 3

          Well, what are you doing to change it from a Flex application to an AIR application?  From what I understand, is at least, your root tag needs to change from <mx:Application> to <mx:WindowedApplication>.  It seems that you are asking how to port/convert a Flex app into an AIR app.  Check out this article:

          Building web and Adobe AIR applications from a shared Flex code base

           

          I hope that helps.

          • 2. Re: Persistent Problems displaying images
            jimmyoneshot Level 1

            No thats not what I meant sorry. I have two versions with the same code. One a regular Flex app and one an AIR version but the code is of course exactly the same except for the WindowedApplication part. I only posted the flex app version code incase someone could take a look at it and modify it for me. It's just that the application needs to use the shared object method like in that code but it also needs to display the relevant image on the right hand panel when the app is installed on a user's machine.

             

            Here's the code for the AIR version:-

             

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

            <mx:WindowedApplication

             

             

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

            >

             

             

             

            <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

            {

            resetprofile1NewsAndSportAC();

            profile1NewsAndSportAddLinksTilelist.dataProvider

            = profile1NewsAndSportaddLinksAC;

            profile1NewsAndSportLinkChoice.dataProvider =

             

            new

            ArrayCollection([]);

            }

             

             

             

            private function resetprofile1NewsAndSportAC():void

            {

            profile1NewsAndSportaddLinksAC.removeAll();

             

             

            for each(var obj:Object in

            profile1NewsAndSportaddLinksFullAC){

            profile1NewsAndSportaddLinksAC.addItem(obj);

            }

            }

             

             

             

            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){

            profile1NewsAndSporttempAC1.addItem(obj1);

             

             

            continue

            ;

            }

            }

            }

             

             

            if

            (profile1NewsAndSporttempAC1.length > 0){

            profile1NewsAndSportAddLinksTilelist.dataProvider = profile1NewsAndSporttempAC1;

            }

            }

            }

             

             

            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){

            profile1NewsAndSporttempAC2.addItem(obj2);

             

             

            continue

            ;

            }

            }

            }

             

             

            if

            (profile1NewsAndSporttempAC2.length > 0){

            profile1NewsAndSportLinkChoice.dataProvider = profile1NewsAndSporttempAC2;

            }

            }

            }

             

            else

            {

            profile1NewsAndSportReset();

            }

            }

             

             

            private function saveprofile1NewsAndSport(event:MouseEvent):void

            {

             

             

            var profile1NewsAndSportaddList:String = ""

            ;

             

             

            if

            (profile1NewsAndSportAddLinksTilelist.dataProvider){

             

             

            if

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

             

             

            for each(var obj1:Object in

            profile1NewsAndSportAddLinksTilelist.dataProvider){

            profile1NewsAndSportaddList += obj1.label +

             

            ","

            ;

            }

            }

             

            else

            {

            profile1NewsAndSportaddList =

             

            "empty"

            ;

            }

            }

            profile1NewsAndSportSO.data.profile1NewsAndSportaddList = profile1NewsAndSportaddList;

             

             

            var profile1NewsAndSportchoiceList:String = ""

            ;

             

             

            for each(var obj2:Object in

            profile1NewsAndSportLinkChoice.dataProvider){

            profile1NewsAndSportchoiceList += obj2.label +

             

            ","

            ;

            }

            profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList = profile1NewsAndSportchoiceList;

            profile1NewsAndSportSO.flush();

            }

            ]]>

             

             

            </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.title; 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>

            • 3. Re: Persistent Problems displaying images
              Gregory Lafrance Level 6

              Can you attach a zip with the air app archive, that way I have all the images and do not have to create them myself. Thanks.

              1 person found this helpful
              • 4. Re: Persistent Problems displaying images
                jimmyoneshot Level 1

                Hi Greg. Here's the zip file. The code is basically more or less the same as the code you gave me so obviously I need to keep the shared object functionality so the user can save their changes but it just needs the right hand image to change based on each clicked item's "largeImage" field. For the moment jyst for testing purposes both the item's "icon" and "largeImage" fields link to the same image.

                 

                Thanks a lot for helping.

                • 5. Re: Persistent Problems displaying images
                  jimmyoneshot Level 1

                  Oh and heres the installer in case you need that to preview it.

                  • 6. Re: Persistent Problems displaying images
                    jimmyoneshot Level 1

                    A zip file that I uploaded on here almost 3 hours ago is still "queued" and I have also tried to upload an AIR application installer but that din't seem to work. Does anyone know if this is normal or would I have uploaded incorrectly?

                    • 7. Re: Persistent Problems displaying images
                      Gregory Lafrance Level 6

                      I created test images, and I found that if I changed the name of the images, sometimes the images would be fine under my src folder, but not under the bin-debug folder. You may need to copy images to bin-debug or elsewhere to get it to work locally.

                       

                      Otherwise please describe exactly what you do in the UI, what should happen, and what is not happening.

                       

                      If this post answers your question or helps, please mark it as such.

                      1 person found this helpful
                      • 8. Re: Persistent Problems displaying images
                        jimmyoneshot Level 1

                        I think the images are already in the bin debug folder under imagetestdesktopversion/bin-debug/assets/images or at least that's the way the folder structure for bin-debug appears within flex itself.

                         

                        As for the application itself when a user clicks any of the items that are within either of the two tilelists the details contained within the selected item should all appear within the right hand panel including the selected item's "largeImage" within the image placeholder (linkImage). This works fine when I preview it during flex but as I say it seems to not bring up the image on the right when I release and install the app.

                         

                        Here's what I mean. This is how the application looks like upon first opening:-

                         

                        http://i223.photobucket.com/albums/dd147/jimmyoneshot/default.jpg

                         

                        Here's what it looks like during previewing within flex and selecting an item within the tilelist:-

                         

                        http://i223.photobucket.com/albums/dd147/jimmyoneshot/right.jpg

                         

                        And heres what it looks like when I release and install the app and select the same item:-

                         

                        http://i223.photobucket.com/albums/dd147/jimmyoneshot/wrong.jpg

                         

                        All the code needs to stay somewhat similar because as you know the user needs to be able to save changes using the code you previously made for me but I'm sure it's a small thing that's causing them not to display.

                        • 9. Re: Persistent Problems displaying images
                          Gregory Lafrance Level 6

                          If this post answers your question or helps, please mark it as such.

                           

                          The problem is that you are embedding the images, but the imageLarge is still referring to the file paths, and the files are not installed with the AIR app.

                           

                          The following code does not look nice because of copy/paste issues between Flex Builder and here, round trip.

                           

                          Here are the significantly changed parts:

                           

                          Replace the paths to large images with the embedded "class" names. I realize they are the same as the thumbnails for now, but you can have different embedded "class" names for the full-size images.

                          largeImage:"image1"

                          largeImage:"image2"

                          largeImage:"image3"

                           

                          Change how the large image source is set in your itemClick handlers for both tile lists:

                           

                          linkImage.source=this[profile1NewsAndSportLinkChoice.selectedItem.largeImage];"

                           

                          Notice the use of the this[] to convert a string to an object name.

                           

                          <?xml version="1.0" encoding="utf-8"?>
                          
                          
                          <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
                          
                          
                           varimage1:Class;
                          
                          
                          [
                          
                          
                          
                          Bindable
                          ]
                          
                          [
                          
                          
                          
                          Embed(source=
                          "assets/images/itv_small.png")]
                          
                          
                          
                          
                          public
                          
                          
                           varimage2:Class;
                          
                          
                          [
                          
                          
                          
                          Bindable
                          ]
                          
                          [
                          
                          
                          
                          Embed(source=
                          "assets/images/skynews_small.png")]
                          
                          
                          
                          
                          public
                          
                          
                           varimage3:Class;
                          
                          
                          ]]>
                          
                          
                          
                          
                          </mx:Script>
                          
                          
                          
                          
                          <mx:Script>
                          
                          <![CDATA[
                          
                          
                          
                          import
                          mx.collections.*;
                          
                          
                          
                          
                          import
                          flash.net.SharedObject;
                          
                          
                          
                          
                          public
                          
                          
                           varprofile1NewsAndSportSO:SharedObject;
                          
                          
                          
                          
                          private
                          
                          
                           var profile1NewsAndSportaddLinksFullAC:ArrayCollection = newArrayCollection([
                          
                          {link:
                          
                          
                          
                          "www.bbcnews.com"
                          
                          
                          , label:"BBC News", icon:"image1", largeImage:"image1", title:"BBC News", description:"BBC News description will go here"},
                          
                          {link:
                          
                          
                          
                          "www.itv.com/"
                          
                          
                          , label:"ITV", icon:"image2", largeImage:"image2", title:"ITV", description:"ITV Description will go here"},
                          
                          {link:
                          
                          
                          
                          "www.skynews.com"
                          
                          
                          , label:"Sky News", icon:"image3", largeImage:"image3", title:"Sky News", description:"Sky News Description will go here"}
                          
                          ]);
                          
                          
                          
                          
                          
                          private
                          
                          
                           var profile1NewsAndSportaddLinksAC:ArrayCollection = newArrayCollection([
                          
                          {link:
                          
                          
                          
                          "www.bbcnews.com"
                          
                          
                          , label:"BBC News", icon:"image1", largeImage:"image1", title:"BBC News", description:"BBC News description will go here"},
                          
                          {link:
                          
                          
                          
                          "www.itv.com/"
                          
                          
                          , label:"ITV", icon:"image2", largeImage:"image2", title:"ITV", description:"ITV Description will go here"},
                          
                          {link:
                          
                          
                          
                          "www.skynews.com"
                          
                          
                          , label:"Sky News", icon:"image3", largeImage:"image3", title:"Sky News", description:"Sky News Description will go here"}
                          
                          ]);
                          
                          
                          
                          
                          private
                          
                          
                           function profile1NewsAndSportReset():void{
                          
                          resetprofile1NewsAndSportAC();
                          
                          profile1NewsAndSportAddLinksTilelist.dataProvider
                          
                          = profile1NewsAndSportaddLinksAC;
                          
                          profile1NewsAndSportLinkChoice.dataProvider =
                          
                          
                          
                          new
                          ArrayCollection([]);
                          
                          }
                          
                          
                          
                          
                          
                          private
                          
                          
                           function resetprofile1NewsAndSportAC():void{
                          
                          profile1NewsAndSportaddLinksAC.removeAll();
                          
                          
                          
                          
                          for
                          
                          
                           each(var obj:Object inprofile1NewsAndSportaddLinksFullAC){
                          
                          profile1NewsAndSportaddLinksAC.addItem(obj);
                          
                          }
                          
                          }
                          
                          
                          
                          
                          
                          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 = newArrayCollection();
                          
                          
                          
                          
                          for
                          
                          
                           each(var str:String inprofile1NewsAndSportaddList){
                          
                          
                          
                          
                          for
                          
                          
                           each(var obj1:Object inprofile1NewsAndSportaddLinksAC){
                          
                          
                          
                          
                          if
                          (str == obj1.label){
                          
                          profile1NewsAndSporttempAC1.addItem(obj1);
                          
                          
                          
                          
                          continue
                          ;
                          
                          }
                          
                          }
                          
                          }
                          
                          
                          
                          
                          if
                          (profile1NewsAndSporttempAC1.length > 0){
                          
                          profile1NewsAndSportAddLinksTilelist.dataProvider = profile1NewsAndSporttempAC1;
                          
                          }
                          
                          }
                          
                          }
                          
                          
                          
                          
                          if
                          (profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList){
                          
                          
                          
                          
                          var
                          
                          
                           profile1NewsAndSportchoiceList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList.split(",");
                          
                          
                          
                          
                          var
                          
                          
                           profile1NewsAndSporttempAC2:ArrayCollection = newArrayCollection();
                          
                          
                          
                          
                          for
                          
                          
                           each(var str2:String inprofile1NewsAndSportchoiceList){
                          
                          
                          
                          
                          for
                          
                          
                           each(var obj2:Object inprofile1NewsAndSportaddLinksAC){
                          
                          
                          
                          
                          if
                          (str2 == obj2.label){
                          
                          profile1NewsAndSporttempAC2.addItem(obj2);
                          
                          
                          
                          
                          continue
                          ;
                          
                          }
                          
                          }
                          
                          }
                          
                          
                          
                          
                          if
                          (profile1NewsAndSporttempAC2.length > 0){
                          
                          profile1NewsAndSportLinkChoice.dataProvider = profile1NewsAndSporttempAC2;
                          
                          }
                          
                          }
                          
                          }
                          
                          
                          
                          else
                          {
                          
                          profile1NewsAndSportReset();
                          
                          }
                          
                          }
                          
                          
                          
                          
                          private
                          
                          
                           function saveprofile1NewsAndSport(event:MouseEvent):void{
                          
                          
                          
                          
                          var
                          
                          
                           profile1NewsAndSportaddList:String = "";
                          
                          
                          
                          
                          if
                          (profile1NewsAndSportAddLinksTilelist.dataProvider){
                          
                          
                          
                          
                          if
                          (ArrayCollection(profile1NewsAndSportAddLinksTilelist.dataProvider).length > 0){
                          
                          
                          
                          
                          for
                          
                          
                           each(var obj1:Object in
                          profile1NewsAndSportAddLinksTilelist.dataProvider){
                          
                          profile1NewsAndSportaddList += obj1.label +
                          
                          
                          
                          ","
                          ;
                          
                          }
                          
                          }
                          
                          
                          
                          else
                          {
                          
                          profile1NewsAndSportaddList =
                          
                          
                          
                          "empty"
                          ;
                          
                          }
                          
                          }
                          
                          profile1NewsAndSportSO.data.profile1NewsAndSportaddList = profile1NewsAndSportaddList;
                          
                          
                          
                          
                          var
                          
                          
                           profile1NewsAndSportchoiceList:String = "";
                          
                          
                          
                          
                          for
                          
                          
                           each(var obj2:Object in
                          profile1NewsAndSportLinkChoice.dataProvider){
                          
                          profile1NewsAndSportchoiceList += obj2.label +
                          
                          
                          
                          ","
                          ;
                          
                          }
                          
                          profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList = profile1NewsAndSportchoiceList;
                          
                          profile1NewsAndSportSO.flush();
                          
                          }
                          
                          ]]>
                          
                          
                          
                          
                          </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.title; websiteLinkLabel.text=profile1NewsAndSportAddLinksTilelist.selectedItem.link; descLabel.text=profile1NewsAndSportAddLinksTilelist.selectedItem.description; linkImage.source=
                          
                          this[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=this[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>
                          
                          
                          
                          
                          • 10. Re: Persistent Problems displaying images
                            jimmyoneshot Level 1

                            That works perfectly now. Thanks so much for your time.