Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Flash/Flex > Flex
Flex Forum d'entraide sur la programmation Adobe Flex : applications Internet riches (RIA)
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 17/09/2007, 10h35   #1
Membre régulier
 
Inscription : février 2006
Messages : 237
Détails du profil
Informations personnelles :
Localisation : France, Nord (Nord Pas de Calais)

Informations forums :
Inscription : février 2006
Messages : 237
Points : 84
Points : 84
Par défaut Flex: erreur accès à la propriété

Bonjour, j'essai de faire marcher un exemple que j'ai trouvé sur le net en suivant scrupuleusement les indications données, je me retrouve avec cette erreur :"accès à la propriété non définie monService". Je précise que je suis débutant.

voici mon code:
Code :
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
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="init();" viewSourceURL="srcview/index.html">
 
	    <mx:Script>
 
        <![CDATA[
        	import mx.controls.dataGridClasses.DataGridColumn;
        	import mx.events.DataGridEvent;
        	import mx.collections.ArrayCollection;
            import mx.managers.CursorManager;
            import mx.rpc.events.ResultEvent;
            import mx.rpc.events.FaultEvent;
            import mx.controls.Alert;
            import encoding.PNGEnc;
            import flash.utils.describeType;
            import events.RemoveEvent;
            import flash.filesystem.File;
 
		    [Embed(source="icons/add.png")]
		    [Bindable]
		    private var addIcon:Class;
 
		   [Embed(source="icons/refresh.png")]
		    [Bindable]
		    private var refreshIcon:Class;
 
		    [Bindable]
			private var employesDP:ArrayCollection;
 
		    // méthode déclenchée lors de l'initialisation de l'application
		    // nous avons spécifié cette fonction avec l'attribut initialize de la balise Application
		    private function init ():void 
 
		    {
				monService.chargeEmployes();
				videoScreen.attachCamera(Camera.getCamera());
		    }
 
		    private function chargeEmployesResult (evt:ResultEvent):void
			{
				employesDP = ArrayCollection ( evt.result );
			}
 
		    <mx:RemoteObject id="monService" showBusyCursor="true" source="trombinoscope.trombinoscope"
destination="amfphp">
				<mx:method name="chargeEmployes" result="chargeEmployesResult(event)" />
			</mx:RemoteObject>
 
        ]]>
 
    </mx:Script>
 
     <mx:Panel title="Flex Trombinoscope" layout="absolute" width="70%" horizontalCenter="0" height="70%" verticalCenter="0">
	  <mx:VDividedBox x="10" y="10" width="100%" height="100%">
	   <mx:DataGrid rowHeight="50" dataProvider="{employesDP}" id="liste_employes" editable="true" width="100%" height="50%">
	    <mx:columns>
			<mx:DataGridColumn editable="false" headerText="Image"/>
			<mx:DataGridColumn headerText="Prénom" dataField="prenom"/>
			<mx:DataGridColumn headerText="Nom" dataField="nom"/>
			<mx:DataGridColumn headerText="Emploi" dataField="emploi"/>
			<mx:DataGridColumn editable="false" headerText="Supprimer" dataField="available" itemRenderer="renderer.DeleteButton"/>
	    </mx:columns>
	   </mx:DataGrid>
	   <mx:HDividedBox width="100%" height="50%">
	    <mx:Form width="50%">
	     <mx:FormHeading label="Saisie d'un employé"/>
	     <mx:FormItem label="Nom" toolTip="Nom de l'employé">
	      <mx:TextInput id="nom"/>
	     </mx:FormItem>
	     <mx:FormItem label="Prénom" toolTip="Prénom de l'employé">
	      <mx:TextInput id="prenom"/>
	     </mx:FormItem>
	     <mx:FormItem label="Fonction" toolTip="Fonction">
	      <mx:TextInput id="emploi"/>
	     </mx:FormItem>
	      <mx:Button label="Ajouter" icon="{addIcon}"/>
	    </mx:Form>
	    <mx:Canvas width="320" height="240" alpha="100" backgroundColor="#ffffff">
	     <mx:VideoDisplay id="videoScreen" x="0" y="0" width="100%" height="100%"/>
	    </mx:Canvas>
	   </mx:HDividedBox>
	  </mx:VDividedBox>
	 </mx:Panel>
 
</mx:Application>
d'avance merci
taka10 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 17/09/2007, 19h26   #2
Membre du Club
 
Inscription : janvier 2006
Messages : 67
Détails du profil
Informations personnelles :
Âge : 42

Informations forums :
Inscription : janvier 2006
Messages : 67
Points : 54
Points : 54
Envoyer un message via MSN à emardjean
salut,
je débute aussi, mais a vue de nez je pense qu'il te manque la classe mon service qui doit se trouver dans une libraire nommée trombinoscope.

Prends mes conseils avec des pincettes, je suis comme toi je débute.
Bon courage
a+
emardjean est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 20/09/2007, 11h24   #3
Membre actif
 
Inscription : avril 2007
Messages : 126
Détails du profil
Informations personnelles :
Âge : 36
Localisation : France, Paris (Île de France)

Informations forums :
Inscription : avril 2007
Messages : 126
Points : 150
Points : 150
Hummm... je code en AS3, rarement en MXML. Mais il me semble que ta balise de déclaration de "monService" n'est pas au bon endroit, on dirait qu'elle est à l'intérieur de ta balise Script... elle est même à l'intérieur de ta balise Data si je ne me trompe.

Déplace <mx:RemoteObject id="monService" .......... </mx:RemoteObject> vers le bas, genre juste avant ton <mxanel title="Flex Trombinoscope"

Je suis pas sûr, mais ça paraît pas à sa place.
David Buff est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 23h28.


 
 
 
 
Partenaires

Hébergement Web