IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ActionScript 3 Discussion :

Programmation objet en AS3


Sujet :

ActionScript 3

  1. #1
    Membre confirmé Avatar de mjs21
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2008
    Messages
    85
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Juin 2008
    Messages : 85
    Par défaut Programmation objet en AS3
    Rebonjour,

    Je suis bloqué sur les bases de la programmation objet en AS3 et je viens chercher de l'aide auprès de vous.

    Je m'explique :

    J'ai une classe :

    Indicateur.as

    Code ActionScript : 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
     
    package
    {
    	public class Indicateur {
    		private var yac:String;
    		private var be:String;
    		private var prc:String;
    		private var prde:String;
    		private var plafond_zero:String;
    		private var plafond_sub:String;
    		private var pourc_zero:String;
    		private var pourc_sub:String;
     
    		public function Indicateur(unYac:String, unBe:String, unPrc:String, unPrde:String, unPlafondZero:String, unPlafondSub:String, unPourcZero:String, unPourcSub:String)
    		{
    			yac = unYac;
    			be = unBe;
    			prc = unPrc;
    			prde = unPrde;
    			plafond_zero = unPlafondZero;
    			plafond_sub = unPlafondSub;
    			pourc_zero = unPourcZero;
    			pourc_sub = unPourcSub;
    		}
    		public function getYac():String {
    			return yac;
    		}
    		public function getBe():String {
    			return be;
    		}
    		public function getPrc():String {
    			return prc;
    		}
    		public function getPrde():String {
    			return prde;
    		}
    		public function getPlafondZero():String {
    			return plafond_zero;
    		}
    		public function getPlafondSub():String {
    			return plafond_sub;
    		}
    		public function getPourcZero():String {
    			return pourc_zero;
    		}
    		public function getPourcSub():String {
    			return pourc_sub;
    		}
    	}
    }

    et mon fichier FLA associé :

    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
     
    var variables:URLVariables = new URLVariables();
    var varSend:URLRequest=new URLRequest("recup.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
     
    var varLoader:URLLoader = new URLLoader;
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);
     
    varLoader.load(varSend);
     
    function completeHandler(event:Event) {
    	var yac = event.target.data.phpYacVar;
    	var be = event.target.data.phpBeVar;
    	var prc = event.target.data.phpPrcVar;
    	var prde = event.target.data.phpPrdeVar;
    	var plafond_zero = event.target.data.phpPlafZeroVar;
    	var plafond_sub = event.target.data.phpPlafSubVar;
    	var pourc_zero = event.target.data.phpPourcZeroVar;
    	var pourc_sub = event.target.data.phpPourcSubVar;
     
    	var indic:Indicateur = new Indicateur(yac, be, prc, prde, plafond_zero, plafond_sub, pourc_zero, pourc_sub);
    }
     
    yac = indic.getYac();
    la récupération des variables depuis ma page PHP fonctionne bien, seulement je ne peux pas accéder à mon objet hors de ma fonction...

    Cette ligne ne fonctionne pas en réalité :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    yac = indic.getYac();
    Merci par avance !!!!

  2. #2
    Membre confirmé Avatar de mjs21
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2008
    Messages
    85
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Juin 2008
    Messages : 85
    Par défaut
    Finalement je n'ai pas utilisé d'objet et je m'en suis sorti en bon vieux procédural.

    Merci quand même.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [Débuter] Programmation objet mais conditions particulières
    Par KaptainouK dans le forum Langages de programmation
    Réponses: 13
    Dernier message: 30/09/2005, 00h20
  2. [Débutant(e)][Conception] prob de programmation objet
    Par gregorian dans le forum Général Java
    Réponses: 3
    Dernier message: 07/07/2005, 11h20
  3. Questions sur la programmation objet en Delphi
    Par Manopower dans le forum Débuter
    Réponses: 20
    Dernier message: 15/06/2005, 15h39
  4. [ASP] Programmation objet ?
    Par Hell dans le forum ASP
    Réponses: 6
    Dernier message: 07/04/2005, 15h28
  5. Problème programmation objet
    Par Contrec dans le forum MFC
    Réponses: 54
    Dernier message: 30/03/2005, 11h30

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo