Bonjour,

Cela fait un moment que je développe mon propre site, et me trouve actuellement face un problème que je n'arrive pas résoudre.

En effet, j'arrive à insérer un fichier txt à l'intérieur de mon fla.

Mais celui-ci ne s'affiche qu'en trace. Impossible de le voir sur la scène.

A quoi cela est-il dû ?


(Je souhaiterais que. Lorsque l'on clique sur branche_mc, celui-ci bouge -rotation- et lance un fichier txt. A chaque fois que l'on clique sur la branche, le texte change).

Merci d'avance !
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
 
//////////////////////////////PREPARATION DU FICHIER TXT/////////////////////////////////
 
nombreDeTXT=5;
variables = new LoadVars();
_root.variables.onLoad = function() {
_root.mc_TXT.leTexte.text = montexte;
}
 
loadVariables("amas_01.txt", _root);
 
////////////////////////////// FICHIERS POSES////////////////////////////////
 
_root.attachMovie("bg_mc", "bg_mc", 1,{_x:0, _y:0});
_root.attachMovie("tour_mc", "tour_mc", 15,{_x:200.9, _y:172.9});
_root.attachMovie("attaches", "attaches", 16,{_x:622.5, _y:241.5});
_root.attachMovie("test", "test", 17,{_x:120, _y:-10});
_root.attachMovie("mc_TXT", "mc_Texte", 300,{_x:250, _y:230});
 
//////////////////////////// MOUVEMENT COQUILLES ////////////////////////////
 
y1 = 163;
y2 = 165;
x1 = 157;
x2 = 161;
z1 = 150;
z2 = 158;
by1 = 359;
by2 = 362;
 
barycentre = function(a, b, t) {
    return (1 - t)*a + t*b;
};
 
dt = 1/10;
t = 0;
 
barycentre2 = function(a2, b2, t2) {
    return (1 - t2)*a2 + t2*b2;
};
 
dt2 = 1/20;
t2 = 0;
 
var container_coquilles:MovieClip = _root.createEmptyMovieClip("container_coquilles", 11,{_x:100, _y:100});
                    _root.container_coquilles.attachMovie("coquille_mc1","coquille_mc1", 2, {_x:439, _y:169.9});
                    _root.container_coquilles.attachMovie("coquille_mc2","coquille_mc2", 3, {_x:458.4, _y:155.9});
                    _root.container_coquilles.attachMovie("coquille_mc3","coquille_mc3", 4, {_x:489, _y:151});
                    _root.attachMovie("branche_mc","branche_mc", 14, {_x:632, _y:225});
 
 
onEnterFrame = function() {
    t += dt;
 
    _root.container_coquilles.coquille_mc1._y = barycentre(y1, y2, t);
    _root.container_coquilles.coquille_mc2._y = barycentre(x1, x2, t);   
    _root.container_coquilles.coquille_mc3._y = barycentre(z1, z2, t);
 
 
    if(t >= 1) {
        t = 1;
        dt *= - 1;
    } else {
        if(t <=0) {
            t = 0;
            dt *= - 1;
        };
    };
};
 
/////////////////////////////////////////////////////////////////////////
 
t2 += dt2;
 
i=0;
j=10;   
k=1;
 
detection=function(){
    if(i>10){
        delete_root.branche_mc.onEnterFrame;
        _root.branche_mc.onEnterFrame=function(){
            _root.branche_mc._rotation=j;
            j--;
        };
    };
 
    if(j<1){
        delete _root.branche_mc.onEnterFrame;
        i=0;
        j=10;
    };
}
setInterval(detection,5);
 
_root.branche_mc.onRelease = function(){
 
            nom="amas_0"+k;
            nomClip=nom+".txt";
            loadVariables(nomClip, _root);
            _root.mc_Texte.leTexte.text = montexte;
            trace(montexte);           
            k++;
            if(k>nombreDeTXT){
                k=1;
            };
 
            if(i<10){
                _root.branche_mc.onEnterFrame = function(){
                    _root.branche_mc._rotation=i;
                    i++;
                };
            };
};