2 Replies Latest reply on Sep 30, 2008 10:00 AM by Newsgroup_User

    Image Visible

    Merlyn_MM
      I have added images to the canvas but visible=false. I am trying to make visible =true based on the webservice result. Here is my code, It is throwing the following error and I do not know how this can be achieved, Can anyone help me please.

      public function handleCountyResult(event:ResultEvent):void{
      CountyInfo = event.result as ArrayCollection;
      for each(var o:Object in CountyInfo){
      Alert.show(o.COUNTYID);
      //image_1_212.visible=true; this works but when i dynamically set like in
      // the next line it doesn't work
      "image_"+'o.PARENTID'+"_"+'o.COUNTYID'.visible = true;
      }
      }



      <mx:Image x="836" y="397" height="8" width="8" source="1.png" visible="false" id="image_1_201"/>
        • 1. Re: Image Visible
          Merlyn_MM Level 1
          Did anyone do anything similar to this like dynamically displaying the image?

          Thanks!
          • 2. Re: Image Visible
            Level 7

            "Merlyn MM" <webforumsuser@macromedia.com> wrote in message
            news:gbt9nh$pie$1@forums.macromedia.com...
            >I have added images to the canvas but visible=false. I am trying to make
            > visible =true based on the webservice result. Here is my code, It is
            > throwing
            > the following error and I do not know how this can be achieved, Can anyone
            > help
            > me please.
            >
            > public function handleCountyResult(event:ResultEvent):void{
            > CountyInfo = event.result as ArrayCollection;
            > for each(var o:Object in CountyInfo){
            > Alert.show(o.COUNTYID);
            > //image_1_212.visible=true; this works but when i dynamically set like in
            >
            > // the next line it doesn't work
            > "image_"+'o.PARENTID'+"_"+'o.COUNTYID'.visible = true;
            > }
            > }

            try
            this['image_'+o.PARENTID+'_'+o.COUNTYID].visible = true;