Est il possible d'intéragir sur le html via javascript depuis le swf flex ?
Pareil est-il possible de recuperer depuis le swf en flex des variables input hidden du document html dans lequel est inclut le swf ?
Version imprimable
Est il possible d'intéragir sur le html via javascript depuis le swf flex ?
Pareil est-il possible de recuperer depuis le swf en flex des variables input hidden du document html dans lequel est inclut le swf ?
Oui, va te renseigner par exemple sur FSCommand en javascript.Citation:
Est il possible d'intéragir sur le html via javascript depuis le swf flex ?
un exemple :
Il faut que depuis ton swf tu envois des messages qui seront récupérés par le FSCommand (ici, les messages sont OnEditTextDesign et OnGetFilePath).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 /******************************************************************************* ** ** DoFSCommand() ** *******************************************************************************/ function elm_DoFSCommand(command, args) { var buffer = false; args = String(args); command = String(command); var aArgs = args.split(";"); switch (command) { case "OnEditTextDesign": window.open ('rte/demo.htm', '', config='height=400, width=700, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no'); break; case "OnGetFilePath": alert(command); break; default : //alert(command); break; break; } return buffer; } /********************** ** Compatibilité IE **********************/ if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) { document.write('<script language=VBScript\> \n'); document.write('on error resume next \n'); document.write('Sub elm_FSCommand(ByVal command, ByVal args)\n'); document.write(' call elm_DoFSCommand(command, args)\n'); document.write('end sub\n'); document.write('</script\> \n'); }
Tu peux regarder du coté de externalInterface, peut être trouveras tu ton bonheur ;)