2 Replies Latest reply on Sep 6, 2009 11:27 PM by 435.mahesh

    problem in displaying image?

    435.mahesh Level 1

      Hi

      Here i have attatched the code.Just imoprt in you flex builder.

      My problem is when i click on ok button in titlewindow the selected image will

      not be replaced instead of old image.

      plz help me

       

       

       

       

      Regards

      D.Mahesh babu

        • 1. Re: problem in displaying image?
          Gregory Lafrance Level 6

          I get a message stating the zip is invalid. Maybe boil code to simplified code that exhibits the issue and post here.

          • 2. Re: problem in displaying image?
            435.mahesh Level 1

            Here i have pasted the code.

            can.mxml

            ---------------------

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="348">
              <mx:Script>
                  <![CDATA[
                     import mx.core.IFlexDisplayObject;
                      import mx.managers.PopUpManager;
                      public function fnUpload1():void
                      {
                          var var_role_title_window:Title1=Title1(PopUpManager.createPopUp(this,Title1,true));                 
                            PopUpManager.centerPopUp(var_role_title_window);
                      }
                  ]]>
              </mx:Script>
                <mx:Image source="comp/images1.jpg" x="109" y="71" id="id_image"/>
                <mx:Button x="140" y="202" label="Upload" click="fnUpload1();"/>
            </mx:Canvas>

            Take images1.jpg(any image)

            Title1.mxml

            ------------------

            <?xml version="1.0" encoding="utf-8"?>
            <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300" title="Upload Image" creationComplete="fnInit();">
                <mx:Script>
                    <![CDATA[
                        import mx.managers.PopUpManager;
                        import mx.rpc.events.FaultEvent;
                        import mx.rpc.events.ResultEvent;
                        import mx.controls.Alert;
                         public var var_filereference:FileReference;
                         public var var_urlRequest:URLRequest;
                         public var var_php_path:String;
                         public var var_download_path:String;
                         public function fnInit():void
                           {                                 
                            var_filereference= new FileReference();
                            var_filereference.addEventListener(Event.SELECT, fnFileSelectedHandler);     
                           }
                        public function fnFileSelectedHandler(event:Event):void
                          {               
                            uploadid.text=var_filereference.name;               
                            //fileref=FileReference(event.target);               
                           }
                        public function fnUploadFile():void
                            {                
                             var_filereference.browse();               
                            }
                        public function fnClick():void
                        {
                            PopUpManager.removePopUp(this);               
                            var ti:can=new can();
                            ti.id_image.source=uploadid.text;
                        }
                      
                      
                    ]]>
                </mx:Script>
                <mx:TextInput id="uploadid" x="60" y="114" width="90" height="20"/>
                <mx:Button id="but" label="upload" styleName="buttonNoOfficial" click="fnUploadFile()" x="158" y="114" height="22"/>
                <mx:Button label="Ok" click="fnClick();" x="124" y="156"/>
               
            </mx:TitleWindow>

            combo.mxml

            ------------------------

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:comp="comp.*">
                <comp:can />
            </mx:Application>

             

            Here u will get the TitleWindow.In that u will select one image and click on ok button

            then that image will be updated to old image(can.mxml).I have done,but i did not get that.

            How can i achieve this?

             

            Regards

            D.Mahesh babu