Bonjour,

Je voudrais créer un bouton sous Flex qui permettrait de télécharger un fichier mais il ne se passe rien quand je clique sur le bouton et pourtant pas d'erreurs ni de warning :s

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="1308" height="1496">
	<mx:Text y="35" text="Mon CV" horizontalCenter="0"/>
	<mx:List  id="listcv" y="82" height="70" dragEnabled="true" color="black" horizontalCenter="0">
         <mx:Array>
                <mx:String>PDF</mx:String>
                <mx:String>WORD</mx:String>
                <mx:String>PAGES</mx:String>
         </mx:Array>
    </mx:List>
    <mx:Script>
    	<![CDATA[
    import flash.net.URLRequest;
    import flash.net.FileReference;
    		private function downloadFile():void {
				var fileRef:FileReference = new FileReference();
				fileRef.download(new URLRequest ("src/images/CV.pdf"));
			}
     	]]>
    </mx:Script>
    <mx:Button y="160" label="Télécharger" click="downloadFile()" id="bouton" horizontalCenter="0"/>
 
</mx:Canvas>
Quelqu'un peut m'éclairer ? Je sèche complètement :/

Merci