title: How do you upload a photo in Flex 3?
body: <p>In Flex 3 how to upload a photo ssing Browse and Upload option?</p>
  <p>In Flex 4 there is an option like:</p>
  <pre><code>&lt;net:FileReference id=&quot;fileReference&quot;
                         select=&quot;fileReference_select(event);&quot;
                         complete=&quot;fileReference_complete(event);&quot; /&gt;
  </code></pre>
  <p>But in Flex 3 there is no <code>&lt;net&gt;</code> tag.</p>
  <p><strong>EDIT:</strong></p>
  <p>This is my Button click handler code</p>
  <pre><code>protected function uploadProfileImage(event:MouseEvent):void
          {
  
              
              var fileRef:FileReference= new FileReference();
              browseButton.addEventListener(MouseEvent.CLICK, onButtonClick);
              
              function onButtonClick(e:MouseEvent):void {
                  fileRef.browse([new FileFilter(&quot;Images&quot;, &quot;*.jpg;*.gif;*.png&quot;)]);
                  fileRef.addEventListener(Event.SELECT, onFileSelected);
                  Alert.show(&quot;0&quot;)
              }
              
              function onFileSelected(e:Event):void {
                  fileRef.addEventListener(Event.COMPLETE, onFileLoaded);
                  //fileRef.load();
                  Alert.show(&quot;1&quot;);
              }
              
              function onFileLoaded(e:Event):void {
                  var loader:Loader = new Loader();
                  loader.loadBytes(e.target.data);
                  //addChild(loader);
                  profileImage.data = loader.content;
                  profileImage.width = loader.width;
                  profileImage.height = loader.height;
                  this.height = profileImage.height;
                  this.width = profileImage.width;
                  this.visible = true;
                  Alert.show(&quot;2&quot;);
  
              }
  </code></pre>