I'm trying to access variables inside a typescript class. 
The first one `checkLUCE1` is easily editable adding `this`. 

The second one `checkLUCE2` is inside another function and i don't know how to set a new value for it:

```
export class ServiziConfigurazioneComponent implements OnInit {

constructor(private savelocal: SavelocaleService,
          private globals: GlobalsService) { }

checkLUCE1:boolean = false;
checkLUCE2:boolean = false;

handleFileSelect(evt,servizio,i){

    let target = evt.target || evt.srcElement || evt.currentTarget;
    let idAttr = target.attributes.id;
    let value = idAttr.nodeValue;
    let obj:any;

    document.getElementById(value+'-image').style.display="none";
    document.getElementById(value+'-loading').style.display = "block";

    let files = evt.target.files;
    let file = files[0];
    this.checkLUCE1 = true; //HERE I CAN SET THE VALUE

    if (files && file) {
        let reader = new FileReader();

        reader.onload = function() {
            (<HTMLImageElement>document.getElementById(value+'-image-file')).src  = reader.result;
            let binaryString = reader.result;
            let base64textString = btoa(binaryString);
            //console.log(base64textString);

            let obj = {};
            obj['file-'+servizio+'-'+i]= {
                'file' : base64textString
            };
            checkLUCE2= true; //HERE I CAN'T SET THE VALUE

            localStorage.setItem('currentUserLuceFile-'+i,base64textString);
        };
        reader.readAsDataURL(file);

        document.getElementById(value+'-image').style.display="block";
        document.getElementById(value+'-loading').style.display = "none";

        //this.savelocal.write('currentUserOfferta',JSON.stringify(obj));
    }
  }
}

```