Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Flash/Flex > Flash > AS3
AS3 Questions relatives à la programmation ActionScript 3 (Cours AS3)
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 18/06/2007, 12h13   #1
Membre à l'essai
 
Inscription : mai 2006
Messages : 137
Détails du profil
Informations forums :
Inscription : mai 2006
Messages : 137
Points : 20
Points : 20
Par défaut [Flash/Delphi] Dialogue et échange de variable

Bonjour,

J'ai essayé de suivre ce tuto pour dialoguer entre flash et delphi.
Lorsque j'écris sur la zone de texte, rien ne se passe dans le flash. Je pense que c'est l'actionscript 3 qui bug.

Pouvez-vous m'indiquer d'autres tutos ou me donner des conseils ?

merci d'avance, gcvoiron.

[Code Delphi]
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
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, OleCtrls, ShockwaveFlashObjects_TLB, StdCtrls;
 
type
  TForm1 = class(TForm)
    OpenDialog1: TOpenDialog;
    Edit1: TEdit;
    Button1: TButton;
    ShockwaveFlash1: TShockwaveFlash;
    procedure ShockwaveFlash1FSCommand(ASender: TObject; const command,
      args: WideString);
    procedure Button1Click(Sender: TObject);
    procedure Edit1Change(Sender: TObject);
  private
    { Déclarations privées }
  public
    { Déclarations publiques }
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.dfm}
 
procedure TForm1.ShockwaveFlash1FSCommand(ASender: TObject; const command,
  args: WideString);
begin
      //
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
    OpenDialog1.Execute;
    ShockwaveFlash1.Movie:=OpenDialog1.FileName;
    //ShockwaveFlash1.SetVariable(text,'kkk');
    //ShowMessage('Hello Word');
end;
 
procedure TForm1.Edit1Change(Sender: TObject);
begin
ShockwaveFlash1.SetVariable('monTexte', 'hello');
ShockwaveFlash1.SetVariable('monTexte', 'hello');
ShockwaveFlash1.SetVariable('monTexte', 'hello');
 
ShockwaveFlash1.SetVariable('monTexte.text', 'hello');
ShockwaveFlash1.SetVariable('monTexte.text', 'hello');
ShockwaveFlash1.SetVariable('monTexte.text', 'hello');
end;
 
end.
[Code ActionScript 3]
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
	var monTexte:TextField = new TextField();
	// propriétés du champ de texte
	with(monTexte)
	{
		x = 10; //coordonnée x
		y = 10; //coordonnée y
		autoSize = TextFieldAutoSize.LEFT; //largeur et hauteur automatique à partir du bord gauche
		selectable = false; // Le texte ne peut pas être sélectionné
 
		text = "Variable monText"; // Contenu du champ de texte
	}
	// affichage du champ de texte
	this.addChild(monTexte);
gcvoiron est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 19/06/2007, 10h11   #2
Membre à l'essai
 
Inscription : mai 2006
Messages : 137
Détails du profil
Informations forums :
Inscription : mai 2006
Messages : 137
Points : 20
Points : 20
Avec Delphi 7 & ActionScript 3.0 :
J'ai essayé ceci :
* Dans mon ActionScript :
Code :
ExternalInterface.call("affiche","bonjour");
* Dans mon Delphi :
Code :
1
2
3
4
procedure TForm1.affiche(a: string);
begin
  ShowMessage(a);
end;
Mais rien à faire, le message n'est pas affiché !
Auriez-vous une idée du problème ?

Merci d'avance.
gcvoiron est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 20h53.


 
 
 
 
Partenaires

Hébergement Web