Bonjour, je viens à vous car j'ai beau cherché, je ne trouve pas de solution à mon problème.

Je travail avec "Flash Builder 4" ainsi que "Open Plug" pour faire des applications Ipad dans l'entreprise dans laquelle je suis en stage.
Mon application fonctionne avec ElipsFlexSDK 3.0.1.598 et est de type : Screen Based Application.

Mon problème est que lorsque que clique sur mon image (touchTap) je dois aller un autre écran. Hors çà ne marche pas. J'ai déjà utilisé cette fonction et çà marché mais là çà ne veux vraiment pas.

Précisément ce qui ne marche pas :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
<mx:Image id="icone7" source="{Icone1}" top="40" right="20" touchTap="goToScreen('AccueilMagazines')"/>
<mx:Image id="icone3" source="{Icone2}" top="40" right="80" touchTap="goToScreen('vueArticles')"/>
Voilà tout le code si çà vous intéresse :
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
 
<?xml version="1.0" encoding="utf-8"?>
<mob:ScreenStackApplication 
	xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
	xmlns:mob="openplug.elips.controls.*" xmlns:screen="openplug.elips.controls.screenClasses.*"
	xmlns:fx="http://ns.adobe.com/mxml/2009"
	creationComplete="init()"
	>
 
	<mx:Style>
		.listeArticle {
			font-size: 16px;
			selectionColor: #A7A37E;
			color:black;
		}
		.listeMagazines{
			font-size: 18px;
			selectionColor: #f9c045;
			fontWeight: bold;
			color:white;
		}
 
		.magazine{
			borderStyle: solid;
			borderColor: #000000;
 
		}
	</mx:Style>
 
	<mx:Script>
		<![CDATA[
			//importation des classes nécessaires 
			import flash.events.Event;
			import flash.filesystem.*;
			import flash.net.URLLoader;
			import flash.net.URLRequest;
 
			import mx.collections.ArrayCollection;
			import mx.controls.Label;
			import mx.controls.VideoDisplay;
			import mx.events.CloseEvent;
			import mx.rpc.events.ResultEvent;
 
			import openplug.elips.controls.Alert;
			import openplug.elips.events.AccessoryButtonEvent;
			import openplug.elips.events.ItemEvent;
			import openplug.elips.events.ItemTouchTapEvent;
			import openplug.elips.services.SystemAPI;
 
 
			[Embed(source="img/background3.jpg")] 
			[Bindable]
			public var Logo:Class;
 
			[Embed(source="img/background.jpg")]
			[Bindable]
			public var Logo2:Class;
 
			[Embed(source="img/logo.png")]
			[Bindable]
			public var Logo3:Class;
 
			[Embed(source="img/entete.png")]
			[Bindable]
			public var Entete:Class;
 
			[Embed(source="img/home.png")]
			[Bindable]
			public var Icone1:Class;
 
			[Embed(source="img/retour.png")]
			[Bindable]
			public var Icone2:Class;
 
			//Tableaux contenant les informations necessaires pour les magazines
			private var tableauMagazines:ArrayCollection = new ArrayCollection();
			private var tableauImagesMagazines:ArrayCollection = new ArrayCollection();
			private var tableauIdMagazines:ArrayCollection = new ArrayCollection();
 
			//Tableau contenant les informations nécessaires pour les articles
			private var tableauArticles:ArrayCollection = new ArrayCollection();
			private var tableauIdArticles:ArrayCollection = new ArrayCollection();
 
			private var mag:String;
 
			//Se connecte au serveur par Script PHP afin de créer un fichier XML contenant tout les magazines
			private function init():void {
				var urlLoader:URLLoader = new URLLoader();
				urlLoader.load(new URLRequest("http://www.mapstrategie.com/journalIpad/journal.php"));
 
				//On appelle la fonction completeListe() si la connection est réussie
				urlLoader.addEventListener(Event.COMPLETE,completeListe);
 
				//chargementFichier() dans le cas contraire
				urlLoader.addEventListener(IOErrorEvent.IO_ERROR, chargementFichier);
			}
 
			//Créer ou MAJ le fichier local XML
			private function completeListe(event:Event):void {
 
				//On déclare l'URLLoader car la connection à réussi dans init() et on stocke le contenu
				var loader:URLLoader = URLLoader(event.target);
				var xml:XML = XML(loader.data);
 
				//On Ouvre le fichier de stockage
				var file:File = File.applicationStorageDirectory;	
				file = file.resolvePath("articleStorage.xml");
 
				//On stocke tout le xml renvoyé par PHP dans une variable
				var newXMLString:String =  xml.toXMLString();
 
				//On ouvre le fichier de stockage et on copie tout le XML
				var fs:FileStream = new FileStream();				    
				fs.open(file, FileMode.WRITE);
				fs.writeUTFBytes(newXMLString);
				fs.close(); 
 
				loadProviders(xml);
 
			}
 
			//Charge le XML sauvegardé si la connection à échoué
			private function chargementFichier(event:IOErrorEvent):void {
 
				var file:File = File.applicationStorageDirectory;
				file = file.resolvePath("articleStorage.xml");
				var fs:FileStream = new FileStream();	
 
				//On lit le XML du fichier et on le stocke
				var fileStream:FileStream = new FileStream();
				fileStream.open(file, FileMode.READ);
				var source:XML= XML(fileStream.readUTFBytes(fileStream.bytesAvailable));
				fileStream.close();
 
				loadProviders(source);
 
			}
 
			//Remplis les tableaux magazines et crée la liste des magazines disponibles
			private function loadProviders(source:XML):void{ 
 
				tableauMagazines.removeAll();
				tableauImagesMagazines.removeAll();
				tableauIdMagazines.removeAll();
 
				for each (var tag:XML in source..magazine.libelle) {
					tableauMagazines.addItem(tag.toString());
				}	
				for each (var tag:XML in source..magazine.une) {
					tableauImagesMagazines.addItem(tag.toString());
				}	
 
				listeMagazines.dataProvider = tableauMagazines;
 
				for each (var tag2:XML in source..magazine.@id) {
					tableauIdMagazines.addItem(tag2.toString());
				}
			}
 
			//Charge l'image du magazine selectionné et stocke l'id de celui-ci
			private function initImageMagazine(event:ItemTouchTapEvent):void {
 
				//L'utilisateur à cliquer sur un magazine, on récupère sa position dans le tableau 
				var indexImage:Number = tableauMagazines.getItemIndex(event.item);
 
				//on récupère l'image correspondante à la même position dans le tableau des images
				imageMag.source = tableauImagesMagazines.getItemAt(indexImage);
 
				//on stocke l'id correspondant dans le tableau ID
				var id:Number=tableauMagazines.getItemIndex(event.item);
				mag= tableauIdMagazines.getItemAt(id).toString();
			}
 
			//Charge la liste des articles disponibles pour le magazine selectionné
			private function initListeArticle():void {
 
				init();
				/*Si la connection à réussi, le fichier est à jour donc on charge le fichier
				Sinon, le fichier contient les articles des précédents chargements*/
 
				var file:File = File.applicationStorageDirectory;
				file = file.resolvePath("articleStorage.xml");	
 
				var fileStream:FileStream = new FileStream();
				fileStream.open(file, FileMode.READ);
				var source:XML= XML(fileStream.readUTFBytes(fileStream.bytesAvailable));
				fileStream.close();
 
				tableauArticles.removeAll();
				tableauIdArticles.removeAll();
 
				for each (var tag:XML in source..magazine.(@id==mag)..article.titre) {
					tableauArticles.addItem(tag.toString());
				}	
				for each (var tag:XML in source..magazine.(@id==mag)..article.@id) {
					tableauIdArticles.addItem(tag.toString());
				}	
 
				listeArticles.dataProvider = tableauArticles;
 
				goToScreen("vueArticles");
			}
 
			private function initArticle(event:ItemTouchTapEvent):void {
 
				//L'utilisateur à cliquer sur un élement de la liste, On prend la position de celui ci dans le tableauArticle qui contient les titres
				var indexArticle:Number = tableauArticles.getItemIndex(event.item);
				//on appelle la fonction en lui précisant l'index du titre (position dans le tableau)
				goToScreen("article");
				loadArticle(indexArticle);
 
			}
 
			//Charge l'article choisi
			private function loadArticle(index:Number):void{
 
				init();
				/*Si la connection à réussi, le fichier est à jour donc on charge le fichier
				Sinon, le fichier contient les articles des précédents chargements*/
 
				var file:File = File.applicationStorageDirectory;
				file = file.resolvePath("articleStorage.xml");	
 
				var fileStream:FileStream = new FileStream();
				fileStream.open(file, FileMode.READ);
				var source:XML= XML(fileStream.readUTFBytes(fileStream.bytesAvailable));
				fileStream.close();
 
				//On charge l'article possédant l'id se trouvant à la position indiqué en paramètre
				for each (var xml:XML in source..article.(@id==tableauIdArticles.getItemAt(index).toString())) {	
 
					var titre:String = xml..titre;
					var texte:String = xml..texte;
					var annexe:String = xml..annexe;
					var media:String = xml..media;
					var video:String = xml..video;
 
					texte_article.text=texte;
					annexe_article.text=annexe;
					titre_article.text=titre;
					image_article.source=media;
					video_article.source=video;
				}	
				if(media=="") {
					video_label.visible=true;
					image_article.visible=false;
				}
				else {
					image_article.source=media;
					image_article.visible=true;
					video_label.visible=false;
				}
				video_article.source=video;
				goToScreen("article");
			}
 
			private function initVideo():void {
				goToScreen("video");
				video_article.play();
			}
 
			private function returnArticle():void {
				video_article.stop();
				goToScreen("article");
			}
 
 
 
		]]>
	</mx:Script>
 
	<mob:ScreenView id="Accueil" width="100%" height="100%">
		<mx:Canvas height="100%" width="100%">
			<mx:Image id="myLogo2" source="{Logo2}" touchTap="goToScreen('AccueilMagazines')"/>
			<mx:Label textAlign="center" text="-My Newspaper-" color="#FFFFFF" fontWeight="bold" fontSize="60" fontFamily="Calibri" top="80"  horizontalCenter="0"/>
		</mx:Canvas>
	</mob:ScreenView>
 
	<mob:ScreenView id="AccueilMagazines" width="100%" height="100%" backgroundColor="#FAF8DF">
		<mx:Canvas height="20%" width="100%" top="0">
			<mx:Image id="entete" source="{Entete}" height="100%"/>
			<mx:Label id="titre" text="My" left="20" bottom="70" color="white" fontWeight="bold" fontSize="40" fontFamily="Times New Roman"/> 
			<mx:Label id="titres" text="Newsletter" left="20" bottom="20" color="white" fontWeight="bold" fontSize="40" fontFamily="Times New Roman"/>
			<mx:Image id="icone2" source="{Icone1}" top="40" right="20" touchTap="goToScreen('AccueilMagazines')"/>
 
		</mx:Canvas>
		<mx:Canvas height="80%" width="100%" bottom="0">
			<mx:Image source="{Logo}"/>	
			<mx:Canvas height="50%" top="10" left="10" styleName="magazine"  width="55%">
				<mx:Image id="imageMag" height="100%" width="100%" source="" touchTap="initListeArticle()"/>
			</mx:Canvas>
			<mob:List id="listeMagazines"
					  rowHeight="50" width="40%" right="20" top="20"  height="100%" 
					  itemTouchTap="initImageMagazine(event)" defaultItemAccessory="2" styleName="listeMagazines"/>
		</mx:Canvas>
 
	</mob:ScreenView>
 
	<mob:ScreenView id="vueArticles" width="100%" height="100%">
		<mx:Canvas height="20%" width="100%" top="0">
			<mx:Image id="entete2" source="{Entete}" height="100%"/>
			<mx:Label id="titre22" text="My" left="20" bottom="70" color="white" fontWeight="bold" fontSize="40" fontFamily="Times New Roman"/> 
			<mx:Label id="titre222" text="Newsletter" left="20" bottom="20" color="white" fontWeight="bold" fontSize="40" fontFamily="Times New Roman"/>
			<mx:Image id="icone22" source="{Icone1}" top="40" right="20" touchTap="Alert.show('Salut'); goToScreen('AccueilMagazines')"/>
		</mx:Canvas>
		<mx:Canvas height="80%" width="100%" right="20" left="20" bottom="0">
			<mob:List  id="listeArticles" rowHeight="80" styleName="listeArticle" width="100%" height="100%" itemTouchTap="initArticle(event)" defaultItemAccessory="1" alpha="1.0"/>
		</mx:Canvas>
	</mob:ScreenView>
 
	<mob:ScreenView id="article">
		<mx:Canvas height="20%" width="100%" top="0">
			<mx:Image id="entete3" source="{Entete}" height="100%"/>
			<mx:Label id="titre32" text="My" left="20" bottom="70" color="white" fontWeight="bold" fontSize="40" fontFamily="Times New Roman"/> 
			<mx:Label id="titre232" text="Newsletter" left="20" bottom="20" color="white" fontWeight="bold" fontSize="40" fontFamily="Times New Roman"/>
			<mx:Image id="icone7" source="{Icone1}" top="40" right="20" touchTap="goToScreen('AccueilMagazines')"/>
			<mx:Image id="icone3" source="{Icone2}" top="40" right="80" touchTap="goToScreen('vueArticles')"/>
		</mx:Canvas>
		<mx:Canvas height="80%" right="10" left="10" bottom="0" fontSize="16" color="#000000" fontFamily="Times New Roman" width="100%">
			<mx:Text id="titre_article" textAlign="center" y="10" text="" width="100%" height="80" right="10" left="10" color="#000000" fontWeight="bold" fontSize="23" fontFamily="Times New Roman" />
			<mx:Text id="texte_article" textAlign="justify" text="" width="60%" height="100%" top="100" left="10" fontSize="16" color="#000000" fontFamily="Calibri"/>
			<mx:Image id="image_article" right="0" top="100" width="34%" maxHeight="150"/>
			<mx:Button id="video_label" label="Voir la vidéo" visible="false" buttonDown="initVideo()"  right="0" top="92"/>
			<mx:Text id="annexe_article" textAlign="justify" text="" right="13" width="32%" top="250" fontFamily="Calibri" color="#000000" fontSize="16"/>
		</mx:Canvas>
	</mob:ScreenView>
 
	<mob:ScreenView id="video" width="100%" height="100%">
		<mx:Canvas height="20%" width="100%" top="0">
			<mx:Image id="entete4" source="{Entete}" height="100%"/>
			<mx:Label id="titre242" text="Newsletter" left="20" bottom="20" color="white" fontWeight="bold" fontSize="40" fontFamily="Times New Roman"/>
			<mx:Image id="icone72" source="{Icone1}" top="40" right="20" touchTap="goToScreen('AccueilMagazines')"/>
			<mx:Image id="icone4" source="{Icone2}" top="40" right="80" touchTap="goToScreen('article')"/>
		</mx:Canvas>
		<mx:VideoDisplay id="video_article" width="90%" height="65%" top="200" autoPlay="false" horizontalCenter="0"/>
		<mx:Canvas horizontalCenter="0" top="10">
			<mx:Button label="Play" buttonDown="video_article.play();" x="10" y="8"/>
			<mx:Button label="Pause" buttonDown="video_article.pause();" x="69.5" y="8"/>
			<mx:Button label="Stop" buttonDown="video_article.stop();" x="138" y="8"/>
			<mx:Button label="Retourner à l'article" buttonDown="returnArticle();" x="200" y="8"/>
		</mx:Canvas>
	</mob:ScreenView>
</mob:ScreenStackApplication>
Je vous remercie d'avance pour l'aide que vous pourrez m'apporter.