Bonjour,

J'ai un problème:

J'ai un ViewStack comprenant plusieurs pages. Lorsque je vais sur une autre page que la première, et qu'elle contient un inputText, j'obtiens l'exception suivante:

TypeError: Error #1009: Il est impossible d'accéder à la propriété ou à la méthode d'une référence d'objet nul.
at mx.managers::FocusManager/focusInHandler()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\managers\FocusManager.as:601]
Mais par contre après ça fonctionne ça m'énerve.

Code contenant la ViewStack:
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
 
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
 
	<mx:Panel layout="absolute"
			  title="Bienvenue {model.login.prenom}"
			  width="100%"
			  height="100%"
			  xmlns:viewC="view.component.*">
		<mx:Script>
			<![CDATA[
				import modelLocator.ModelLocator;
				[Bindable]
				public var model:ModelLocator=ModelLocator.getInstance();
			]]>
		</mx:Script>
		<mx:ViewStack id="MenuAdminContent"
					  resizeToContent="true"
					  alpha="1.0" creationPolicy="all">
			<viewC:AccueilView label="Accueil"
							   width="100%"
							   height="100%"
							   backgroundColor="#FFFFFF"/>
			<viewC:InsertArticleView label="Gestion des insertions"
									 width="100%"
									 height="100%"/>
			<viewC:ReserveArticleView label="Gestion des réservations"
									  width="100%"
									  height="100%"/>
			<viewC:SellArticleView label="Gestion des ventes"
								   width="100%"
								   height="100%"/>
			<viewC:PretArticleView label="Gestion des prêts"
								   width="100%"
								   height="100%"/>
			<viewC:ManageUserView label="Gestion utilisateurs"
								  width="100%"
								  height="100%"/>
 
		</mx:ViewStack>
		<mx:LinkBar dataProvider="MenuAdminContent"
					fontSize="12"/>
 
 
	</mx:Panel>
</mx:Canvas>
Et le code d'une des pages:
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
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
		   width="100%"
		   height="100%"
		   backgroundColor="#FDFDFD">
	<mx:states>
		<mx:State name="AddUser">
			<mx:AddChild position="lastChild">
				<mx:Form x="42"
						 y="323"
						 width="315"
						 height="206">
					<mx:FormItem label="Label">
						<mx:TextInput/>
					</mx:FormItem>
				</mx:Form>
			</mx:AddChild>
		</mx:State>
	</mx:states>
	<mx:Script>
		<![CDATA[
			import mx.events.IndexChangedEvent;
			import com.adobe.cairngorm.control.CairngormEventDispatcher;
			import control.FonctionEvent;
			import modelLocator.ModelLocator;
			import mx.containers.ViewStack;
 
			[Bindable]
			public var model:ModelLocator=ModelLocator.getInstance();
 
			private function generatePassword():String
			{
				var chars:Array=new Array("a", "A", "b", "B", "c", "C", "d", "D", "e", "E", "f", "F", "g", "G", "h", "H", "i", "I", "j", "J", "k", "K", "l", "L", "m", "M", "n", "N", "o", "O", "p", "P", "q", "Q", "r", "R", "s", "S", "t", "T", "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "#", "@", "%", "&", "?", ",", ".", "-", "_", "!", "+", "$", "€", "=");
				var specialChars:Boolean=false;
				var size:int=6;
				var pass:String="";
				for (var x:int=0; x < size; x++)
				{
					if (specialChars == true)
						pass+=chars[(Math.floor(Math.random() * (chars.length)))];
					else
						pass+=chars[(Math.floor(Math.random() * (chars.length - 14)))];
				}
				//inputPassword.text=pass;
				return pass;
			}
 
			private function addNewUser():void
			{
				currentState='AddUser';
				//var evt:FonctionEvent=new FonctionEvent();
				//CairngormEventDispatcher.getInstance().dispatchEvent(evt);
			}
		]]>
	</mx:Script>
 
	<mx:Grid x="22"
			 y="115"
			 id="grid1">
		<mx:GridRow width="100%"
					height="100%"
					id="gAddUser">
			<mx:GridItem width="100%"
						 height="100%"
						 verticalAlign="middle">
				<mx:Image source="assets/images/icones/Add.png"/>
 
			</mx:GridItem>
			<mx:GridItem width="100%"
						 height="100%">
				<mx:LinkButton label="Ajouter un nouvel utilisateur"
							   fontSize="16"
							   id="linkbutton4"
							   click="addNewUser()"/>
			</mx:GridItem>
		</mx:GridRow>
		<mx:GridRow width="100%"
					height="100%"
					id="gridrow2">
			<mx:GridItem width="100%"
						 height="100%"
						 verticalAlign="middle"
						 id="griditem1">
				<mx:Image source="assets/images/icones/Modify.png"/>
			</mx:GridItem>
			<mx:GridItem width="100%"
						 height="100%"
						 id="griditem2">
				<mx:LinkButton label="Modifier un utilisateur"
							   fontSize="16"
							   id="linkbutton1"/>
			</mx:GridItem>
		</mx:GridRow>
		<mx:GridRow width="100%"
					height="100%"
					id="gridrow1">
			<mx:GridItem width="100%"
						 height="100%"
						 verticalAlign="middle"
						 id="griditem4">
				<mx:Image source="assets/images/icones/Delete.png"/>
			</mx:GridItem>
			<mx:GridItem width="100%"
						 height="100%"
						 id="griditem3">
				<mx:LinkButton label="Supprimer un utilisateur"
							   fontSize="16"
							   id="linkbutton2"/>
			</mx:GridItem>
		</mx:GridRow>
		<mx:GridRow width="100%"
					height="100%"
					id="gridrow3">
			<mx:GridItem width="100%"
						 height="100%">
				<mx:Image id="image1"/>
			</mx:GridItem>
			<mx:GridItem width="100%"
						 height="100%"
						 id="griditem5">
				<mx:LinkButton label="Imprimer un fichier PDF"
							   fontSize="16"
							   id="linkbutton3"/>
			</mx:GridItem>
		</mx:GridRow>
	</mx:Grid>
	<mx:Form x="349" y="115" width="236">
		<mx:FormItem label="Label">
			<mx:TextInput/>
		</mx:FormItem>
	</mx:Form>
 
 
</mx:Canvas>
Merci d'avance !