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

Flex Discussion :

problème fabridge communication html-flex


Sujet :

Flex

  1. #1
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    2
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2009
    Messages : 2
    Points : 1
    Points
    1
    Par défaut problème fabridge communication html-flex
    Bonjour,
    Je ne sais pas résoudre un problème de communication entre le conteneur html et celui de flex. J'essaie d'utiliser le pont ajax proposé par ajaxbridge mais en vain je bloque. Mon message d'erreur dans Firebug:
    FABridge.b_affichage is undefined


    affichage.php intègre l'application flex mais l'instentiation de FABrige ne se fait pas.
    voici son code:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    <?php require('fonction.php') ?>
    <?php verifier_connexion() ?>
    <?php
    $sexe=$_POST["choix"];
    $age= $_POST["age"];
    $danse= $_POST["danse"]; 
    $niveau= $_POST["niveau"];
    $departement= $_POST["departement"];
    ?>
    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
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     
     
     
    <html lang="en">
     
     
     
    <head>
     
    <link rel="stylesheet" type="text/css" href="CSS/style.css" />
     
     
    <script src="js/Effets.js" type="text/javascript" ></script>
    <script src="js/FABridge.js" type="text/javascript" ></script>
    <script src="js/affiche.js" type="text/javascript" ></script> 
     
     
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
    <!--  BEGIN Browser History required section -->
    <link rel="stylesheet" type="text/css" href="history/history.css" />
    <!--  END Browser History required section -->
     
    <title></title>
    <script src="AC_OETags.js" language="javascript"></script>
     
    <!--  BEGIN Browser History required section -->
    <script src="history/history.js" language="javascript"></script>
    <!--  END Browser History required section -->
     
    <style>
    body { margin: 0px; overflow:hidden }
    </style>
    <script language="JavaScript" type="text/javascript">
    <!--
    // -----------------------------------------------------------------------------
    // Globals
    // Major version of Flash required
    var requiredMajorVersion = 9;
    // Minor version of Flash required
    var requiredMinorVersion = 0;
    // Minor version of Flash required
    var requiredRevision = 124;
    // -----------------------------------------------------------------------------
    // -->
    </script>
     
    </head>
     
    <body>
     
     
    <?php include('menu.php') ?>
     
    <input type="hidden" id="varSexe" value="<?php echo $sexe; ?>" />
    <input type="hidden" id="varAge" value="<?php echo $age; ?>" />
    <input type="hidden" id="varDanse" value="<?php echo $danse; ?>" />
    <input type="hidden" id="varNiveau" value="<?php echo $niveau; ?>" />
    <input type="hidden" id="varDepartement" value="<?php echo $departement; ?>" />
    <?php echo $sexe; ?>
    <?php echo $age; ?>
    <?php echo $danse; ?>
    <?php echo $niveau; ?>
    <?php echo $departement; ?>
     
    <script language="JavaScript" type="text/javascript">
    <!--
     
    var sexe=String(document.getElementById('varSexe').value);
    var age=String(document.getElementById('varAge').value);
    var danse=String(document.getElementById('varDanse').value);
    var niveau=String(document.getElementById('varNiveau').value);
    var departement=String(document.getElementById('varDepartement').value);
    var instanceFlex=FABridge.b_affichage.root();
    instanceFlex.afficherPartenaire(sexe,age,danse,niveau,departement);
     
    // -->
     
    </script>
     
     
        <div id="main">        
     
                <div id="corps_principal2" >
    <!--b3-->
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                id="affichage" width="900" height="1000"
                codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
                <param name="movie" value="affichage.swf" />
                <param name="flashvars" value="bridgeName=b_affichage" />
                <param name="quality" value="high" />
                <param name="bgcolor" value="#deb5e5" />
                <param name="allowScriptAccess" value="sameDomain" />
                <embed src="affichage.swf" quality="high" bgcolor="#deb5e5"
                    width="900" height="1000" flashvars="bridgeName=b_affichage" name="affichage" align="middle"
                    play="true"
                    loop="false"
                    quality="high"
                    allowScriptAccess="sameDomain"
                    type="application/x-shockwave-flash"
                    pluginspage="http://www.adobe.com/go/getflashplayer">
                </embed>
        </object>
     
    </div>    
     
     
     
     
        </div>
     
    </body>
    </html>
    Voici le code de mon mxml:


    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
    <?xml version="1.0" encoding="utf-8" ?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ctrl="qs.controls.*"  width="900" height="1000" backgroundColor="#DEB5E5"  xmlns:ns1="bridge.*">
        <ns1:FABridge/>
        <mx:Script>
            <![CDATA[
                import mx.containers.TitleWindow;
                import mx.controls.Alert;
                import mx.rpc.events.FaultEvent;
                import mx.rpc.events.ResultEvent;
                import mx.managers.PopUpManager;
     
     
            [Bindable]
            public var xmlList:XMLList;
            [Bindable]
            public var sexe:String;
            [Bindable]
            public var age:String;
            [Bindable]
            public var danse:String;
            [Bindable]
            public var niveau:String;
            [Bindable]    
             public var departement:String; 
     
     
                private function init():void{
     
                    executerService();
     
     
                }
                public function afficherPartenaire(sexe:String,age:String,danse:String,niveau:String,departement:String):void{
                    this.sexe=sexe;
                    this.age=age;
                    this.danse=danse;
                    this.niveau=niveau;
                    this.departement=departement;
                    init();
                }
     
     
                public function executerService():void{
                    listeService.send();
                }
                public function reponseOk(event:ResultEvent):void{
                     xmlList= XMLList(event.result.partenaires) as XMLList;
     
     
                }
                public function reponseKo(event:FaultEvent):void{
                    Alert.show("Erreur ! :"+event.fault.message)
                }
            ]]>
        </mx:Script>
     
     
     
     
     
     
        <mx:List  dataProvider="{xmlList}" variableRowHeight="true"  width="600" y="30" x="150" selectable="false">
            <mx:itemRenderer>
                        <mx:Component >                
                            <mx:HBox >
                                <mx:Script>
                                <![CDATA[
                                    import mx.controls.Image;
                                    import mx.managers.PopUpManager;
     
                                   private function afficher():void{
                                    var fenetre:SimpleTitleWindowExample=SimpleTitleWindowExample(PopUpManager.createPopUp( this.parent, SimpleTitleWindowExample , true));
                                    fenetre.ImageAgrandie.source=data.RefPhoto;    
                                    fenetre.txtLabel.text=data.souhait;
                                    fenetre.idPseudo.text=data.pseudo;
                                    fenetre.idVille.text=data.ville;
                                    fenetre.idAge.text=data.age;                        
                                    PopUpManager.centerPopUp(fenetre);
                                    }
                                ]]>
                                    </mx:Script>
                                <ctrl:SuperImage source="{data.RefPhoto}" width="50" height="60" />
                                <mx:VBox>
                                    <mx:Label text="{data.pseudo}" x="40" y="26" width="100" fontWeight="bold"/>
                                    <mx:Label text="{data.age}" x="40" y="34" width="100"/>
                                    <mx:Label text="{data.niveau}" x="40" y="42" width="100"/>
                                </mx:VBox>
     
                                <mx:TextArea text="{data.souhait}" width="300" height="60" horizontalScrollPolicy="off" verticalScrollPolicy="off"/>
                                <mx:Button label="voir" click="afficher()"/>
                            </mx:HBox>
                        </mx:Component>
                    </mx:itemRenderer>
        </mx:List>
     
    <!--declaration du service-->
     
    <mx:HTTPService id="listeService" 
        url="http://localhost/servicePHP/listerPartenaires.php"
        result="reponseOk(event)"
        fault="reponseKo(event)"
        resultFormat="e4x"
        method="POST">
    <mx:request xmlns="*">
    <sexe>{sexe}</sexe>
    <age>{age}</age> 
    <danse>{danse}</danse>  
    <niveau>{niveau}</niveau>
    <departement>{departement}</departement>
    </mx:request>        
    </mx:HTTPService>
     
     
    </mx:Application>

  2. #2
    Membre averti Avatar de samy2525
    Profil pro
    Inscrit en
    Janvier 2008
    Messages
    259
    Détails du profil
    Informations personnelles :
    Localisation : France, Hauts de Seine (Île de France)

    Informations forums :
    Inscription : Janvier 2008
    Messages : 259
    Points : 310
    Points
    310
    Par défaut extrnalInterface
    Pour communiquer avec la page qui héberge le SWF il faut utiliser l'externalIntrface, ce dernier te permet de transmettre des données au conteneur du SWF

    Bon courage

  3. #3
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    2
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2009
    Messages : 2
    Points : 1
    Points
    1
    Par défaut
    effectivement c'est une solution, la classe ExternalInterface, mais selon le bouquin il est plus aisé de communiquer avec la bibliotheque flex-ajax-bridge.
    Merci pour ta réponse.

Discussions similaires

  1. Réponses: 0
    Dernier message: 23/05/2008, 17h59
  2. [Mail] Problème mail en html
    Par Vinzius dans le forum Langage
    Réponses: 6
    Dernier message: 10/09/2005, 22h51
  3. problème de validation HTML
    Par silversky dans le forum Balisage (X)HTML et validation W3C
    Réponses: 6
    Dernier message: 05/09/2005, 13h47
  4. [WinService][C#] Problème de communication
    Par Pfeffer dans le forum Windows Forms
    Réponses: 2
    Dernier message: 08/07/2005, 15h54
  5. [html][xsl]Problème valeur attribut html
    Par beho dans le forum XSL/XSLT/XPATH
    Réponses: 3
    Dernier message: 16/04/2005, 13h37

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