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
| <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="init()">
<mx:Script>
<![CDATA[
import flash.net.sendToURL;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.events.ToolTipEvent;
import mx.managers.ToolTipManager;
import mx.controls.Alert;
import mx.rpc.http.HTTPService;
import ToolTipComponents.PanelToolTip2;
[Bindable]
public var xmlList:XMLList;
public var evenement:Object;
private function init():void
{
/* génération du tooltip HTML */
ToolTipManager.showDelay = 0;
ToolTipManager.hideDelay = Infinity;
/* requete sur le fichier coordonnees.xml */
coordonnees.send();
srv.send();
}
private function srv_fault(evt:FaultEvent):void
{
var title:String = evt.type + " (" + evt.fault.faultCode + ")";
var text:String = evt.fault.faultString;
Alert.show(text, title);
}
private function srv_result(evt:ResultEvent):void
{
evenement = evt.result;
}
private function createCustomTip(event:ToolTipEvent):void
{
xmlList = XML(evenement).accueil.identification.donnee;
var ptt:PanelToolTip2 = new PanelToolTip2();
ptt.rp.dataProvider = xmlList.toString();
Alert.show(ptt.rp.currentItem.terme.toString());
ptt.fi.label = ptt.rp.currentItem.terme.toString();
ptt.respText = ptt.rp.currentItem.definition.toString();
event.toolTip = ptt;
}
]]>
</mx:Script>
<mx:HTTPService id="coordonnees" url="data/coordonnees.xml" resultFormat="e4x"/>
<mx:HTTPService id="srv" url="data/contenu_ok.xml" resultFormat="xml"
fault="srv_fault(event)" result="srv_result(event)" />
<mx:VBox width="100%">
<mx:HBox backgroundColor="white" width="100%">
<!-- LOGO -->
<mx:Image source="img/logo.png" />
<mx:Label text="Aide pour l'administrateur" fontSize="18" paddingTop="22" />
</mx:HBox>
<!-- BARRE DE MENU HORIZONTAL -->
<mx:TabNavigator id="menuHorizontal" width="100%">
<mx:Panel minHeight="700" width="100%" label="PREAMBULE">
<mx:Label id="preambule" height="100%" width="100%"
htmlText=""
textIndent="0"/>
</mx:Panel>
<mx:Panel title="Vous êtes ici : Accueil" label="ACCUEIL" layout="absolute">
<mx:Image x="150" y="0" source="img/accueil.jpg" />
<mx:Canvas id="identification"
borderColor="red"
borderStyle="solid" borderThickness="3"
x="{coordonnees.lastResult.accueil.identification.x}"
y="{coordonnees.lastResult.accueil.identification.y}"
width="{coordonnees.lastResult.accueil.identification.width}"
height="{coordonnees.lastResult.accueil.identification.height}"
toolTip=" "
toolTipCreate="createCustomTip(event)"/>
</mx:Panel>
</mx:TabNavigator>
</mx:VBox>
</mx:Application> |
Partager