Be a Supporter!

upload button

  • 96 Views
  • 1 Reply
New Topic Respond to this Topic
A-Genius
A-Genius
  • Member since: Mar. 20, 2010
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
upload button 2014-01-03 15:30:29 Reply

how can I upload an image from my computer and add it into my MovieClip which should contain the image I have selected?

I know that:

uploadBtn.addEventListener(MouseEvent.CLICK,onClick);

function onClick(e:MouseEvent){

//What should I add here to trigger the upload button

}
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Online!
Forum Stats
Supporter
Level 16
Game Developer
Response to upload button 2014-01-03 15:37:53 Reply

At 1/3/14 03:30 PM, A-Genius wrote: //What should I add here to trigger the upload button

}

Use a FileReference and Loader. fileRef.browse() to find the image, fileRef.load() to get the data, then loader.loadBytes(fileRef data). The docs have examples of everything.