Aide avec le code d'un jeu de phrases complètes
- dcg76_uamazc
- Born


- Inscription: Avr 10, 2010
- Messages: 1
- Status: Offline
Salut, je `peu ma coincé, je m` faire un jeu où vous devez compléter les phrases en faisant glisser les mots qui sont dynamiquement généré plus de bon endroit pour les IST Certaines boîtes, tout fonctionne très bien mais si vous tirez les mots de stands Placé tout sont l'un tombe en panne.
Malheureusement, ce n'est quelqu'un d'autre code (un autre programmeur qui dansent sur nous dans le milieu de l'équipe du projet) Bien que je parviens à le faire fonctionner avec de nouveaux mots, ce qui rend les objets déplaçables vous undraggable un seul lieu tous les 4 de la dans les boîtes est tout à fait raison Imprécis pour moi. I `ll apprécient toute aide que je peux obtenir.
Voici l `ensemble du code que cette partie du film est à l'aide, je m` en utilisant CS4 avec 2 ActionScript:
Malheureusement, ce n'est quelqu'un d'autre code (un autre programmeur qui dansent sur nous dans le milieu de l'équipe du projet) Bien que je parviens à le faire fonctionner avec de nouveaux mots, ce qui rend les objets déplaçables vous undraggable un seul lieu tous les 4 de la dans les boîtes est tout à fait raison Imprécis pour moi. I `ll apprécient toute aide que je peux obtenir.
Voici l `ensemble du code que cette partie du film est à l'aide, je m` en utilisant CS4 avec 2 ActionScript:
ACTIONSCRIPT Code: [ Select ]
function random (min, max)
(
var _loc2 = true;
if (usados. length <= max - min)
(
while (_loc2! = false)
(
var _loc1 = Math.floor (Math.random () * (max - min + 1));
_loc2 = repeat (_loc1)
) / / End while
used. push (_loc1)
return (_loc1)
)
else
(
return (0);
) / / End else if
) / / End of the function
function repeat (num)
(
_loc1 var = false;
for (i = 0; i <used. length; i + +)
(
if (num == Used [i])
(
_loc1 = true;
) / / End if
) / / End of for
return (_loc1)
) / / End of the function
stop ();
var used = new Array ();
_root. palabras_colocadas = 0;
palabras_correctas = 0;
listado_x = 700;
listado_y = 400;
origenx = 0;
origeny = 0;
estaba_en = -1;
off = false;
_root. sentence = 2;
var words = new Array ("huts", "made", "mud", "straw");
var correct = new Array (false, false, false, false);
var busy = new Array (-1, -1, -1, -1);
my_font var = new TextFormat ();
my_font.font = "Arial";
my_font.color = 0;
my_font. size = 30;
words [i]. embedFonts = true;
my_font.bold = true;
var i = 0;
while (i <4)
(
this ["box" + i]. gotoAndStop (1);
this. createEmptyMovieClip (myClip "+ i, this.getNextHighestDepth ());
length = words [i]. length * 22;
this ["myClip" + i]. createTextField ("label", 1, 0, 0, length, 40);
this ["myClip" + i]. label.text = words [i];
this ["myClip" + i]. label. setTextFormat (my_font)
this ["myClip" + i]. onPress = function ()
(
temp = this. _name;
temp = Number (temp charAt (6));
if (Occupied [0] == temp)
(
off = true;
estaba_en = 0;
) / / End if
if (Occupied [1] == temp)
(
off = true;
estaba_en = 1;
) / / End if
if (Occupied [2] == temp)
(
off = true;
estaba_en = 2;
) / / End if
if (Occupied [3] == temp)
(
off = true;
estaba_en = 3;
) / / End if
if (! off)
(
estaba_en = -1;
) / / End if
origenx = this._x;
origeny = this. _y;
trace ("was" + estaba_en)
this.startDrag ();
);
this ["myClip" + i]. onRelease = this ["myClip" + i]. onReleaseOutside = function ()
(
this.stopDrag ();
which = this._name;
which = Number (cual. charAt (6));
drop = eval (this._droptarget)
trace (drop);
WHERE = String (drop);
frame = donde.substr (8, 6);
WHERE = Number (donde. charAt (14));
trace (Which + "in" + WHERE + "" + table);
if (table == "table")
(
if (Occupied [WHERE]> = 0 & & Occupied [WHERE] <= 3 | | WHERE == estaba_en)
(
off = false;
this._x = origenx;
this._y = origeny;
)
else
(
if (! off)
(
+ + _root.palabras_colocadas;
) / / End if
section = eval ("tranche" + (where + 1) + "_mc");
tramo.gotoAndPlay (2);
if (_root. palabras_colocadas> = 4)
(
startbtn.start ();
start_mc. gotoAndPlay (2);
)
else
(
palabra_ok.start ();
) / / End else if
length = words [Which]. length * 8.500000E +000;
drop.gotoAndStop (2);
this._y = drop._y - 22;
this._x = drop. _x - long;
Occupied [WHERE] = is;
if (off)
(
off = eval ("Table" + estaba_en)
apaga.gotoAndStop (1);
= Eval section ("section" + (estaba_en +1) + "_mc");
tranche. gotoAndPlay (6);
Occupied [estaba_en] = -1;
correct [estaba_en] = false;
off = false;
trace ("is" + _root.palabras_colocadas + "words");
if (_root.palabras_colocadas == 3)
(
trace ("Without noise off");
start_mc. gotoAndStop (1);
) / / End if
) / / End if
trace (Occupied [0] + "" + Occupied [1] + "" + Occupied [2] + "" + Occupied [3]);
if (Which == where)
(
+ + Palabras_correctas;
correct [WHERE] = true;
) / / End if
) / / End if
) / / End else if
if (table == "myClip" | | Table == "start_)
(
palabra_error.start ();
this._x = origenx;
this. _y = origeny;
) / / End if
if (table == "bottom")
(
if (off)
(
off = eval ("Table" + estaba_en)
off. gotoAndStop (1);
= Eval section ("section" + (estaba_en +1) + "_mc");
tramo.gotoAndPlay (6);
Occupied [estaba_en] = -1;
correct [estaba_en] = false;
- _root. Palabras_colocadas;
off = false;
trace ("is" + _root.palabras_colocadas + "words");
if (_root. palabras_colocadas == 3)
(
startbtn.start ();
start_mc.gotoAndStop (1);
) / / End if
) / / End if
) / / End if
);
+ + I;
) / / End while
var ii = 0;
while (ii <4)
(
var numeroNuevo = random (1, 4);
trace (numeroNuevo)
this ["myClip" + numeroNuevo]. _x = listado_x;
this [myClip "+ numeroNuevo]. listado_y + y = 40 * i;
+ + Ii;
) / / End while
(
var _loc2 = true;
if (usados. length <= max - min)
(
while (_loc2! = false)
(
var _loc1 = Math.floor (Math.random () * (max - min + 1));
_loc2 = repeat (_loc1)
) / / End while
used. push (_loc1)
return (_loc1)
)
else
(
return (0);
) / / End else if
) / / End of the function
function repeat (num)
(
_loc1 var = false;
for (i = 0; i <used. length; i + +)
(
if (num == Used [i])
(
_loc1 = true;
) / / End if
) / / End of for
return (_loc1)
) / / End of the function
stop ();
var used = new Array ();
_root. palabras_colocadas = 0;
palabras_correctas = 0;
listado_x = 700;
listado_y = 400;
origenx = 0;
origeny = 0;
estaba_en = -1;
off = false;
_root. sentence = 2;
var words = new Array ("huts", "made", "mud", "straw");
var correct = new Array (false, false, false, false);
var busy = new Array (-1, -1, -1, -1);
my_font var = new TextFormat ();
my_font.font = "Arial";
my_font.color = 0;
my_font. size = 30;
words [i]. embedFonts = true;
my_font.bold = true;
var i = 0;
while (i <4)
(
this ["box" + i]. gotoAndStop (1);
this. createEmptyMovieClip (myClip "+ i, this.getNextHighestDepth ());
length = words [i]. length * 22;
this ["myClip" + i]. createTextField ("label", 1, 0, 0, length, 40);
this ["myClip" + i]. label.text = words [i];
this ["myClip" + i]. label. setTextFormat (my_font)
this ["myClip" + i]. onPress = function ()
(
temp = this. _name;
temp = Number (temp charAt (6));
if (Occupied [0] == temp)
(
off = true;
estaba_en = 0;
) / / End if
if (Occupied [1] == temp)
(
off = true;
estaba_en = 1;
) / / End if
if (Occupied [2] == temp)
(
off = true;
estaba_en = 2;
) / / End if
if (Occupied [3] == temp)
(
off = true;
estaba_en = 3;
) / / End if
if (! off)
(
estaba_en = -1;
) / / End if
origenx = this._x;
origeny = this. _y;
trace ("was" + estaba_en)
this.startDrag ();
);
this ["myClip" + i]. onRelease = this ["myClip" + i]. onReleaseOutside = function ()
(
this.stopDrag ();
which = this._name;
which = Number (cual. charAt (6));
drop = eval (this._droptarget)
trace (drop);
WHERE = String (drop);
frame = donde.substr (8, 6);
WHERE = Number (donde. charAt (14));
trace (Which + "in" + WHERE + "" + table);
if (table == "table")
(
if (Occupied [WHERE]> = 0 & & Occupied [WHERE] <= 3 | | WHERE == estaba_en)
(
off = false;
this._x = origenx;
this._y = origeny;
)
else
(
if (! off)
(
+ + _root.palabras_colocadas;
) / / End if
section = eval ("tranche" + (where + 1) + "_mc");
tramo.gotoAndPlay (2);
if (_root. palabras_colocadas> = 4)
(
startbtn.start ();
start_mc. gotoAndPlay (2);
)
else
(
palabra_ok.start ();
) / / End else if
length = words [Which]. length * 8.500000E +000;
drop.gotoAndStop (2);
this._y = drop._y - 22;
this._x = drop. _x - long;
Occupied [WHERE] = is;
if (off)
(
off = eval ("Table" + estaba_en)
apaga.gotoAndStop (1);
= Eval section ("section" + (estaba_en +1) + "_mc");
tranche. gotoAndPlay (6);
Occupied [estaba_en] = -1;
correct [estaba_en] = false;
off = false;
trace ("is" + _root.palabras_colocadas + "words");
if (_root.palabras_colocadas == 3)
(
trace ("Without noise off");
start_mc. gotoAndStop (1);
) / / End if
) / / End if
trace (Occupied [0] + "" + Occupied [1] + "" + Occupied [2] + "" + Occupied [3]);
if (Which == where)
(
+ + Palabras_correctas;
correct [WHERE] = true;
) / / End if
) / / End if
) / / End else if
if (table == "myClip" | | Table == "start_)
(
palabra_error.start ();
this._x = origenx;
this. _y = origeny;
) / / End if
if (table == "bottom")
(
if (off)
(
off = eval ("Table" + estaba_en)
off. gotoAndStop (1);
= Eval section ("section" + (estaba_en +1) + "_mc");
tramo.gotoAndPlay (6);
Occupied [estaba_en] = -1;
correct [estaba_en] = false;
- _root. Palabras_colocadas;
off = false;
trace ("is" + _root.palabras_colocadas + "words");
if (_root. palabras_colocadas == 3)
(
startbtn.start ();
start_mc.gotoAndStop (1);
) / / End if
) / / End if
) / / End if
);
+ + I;
) / / End while
var ii = 0;
while (ii <4)
(
var numeroNuevo = random (1, 4);
trace (numeroNuevo)
this ["myClip" + numeroNuevo]. _x = listado_x;
this [myClip "+ numeroNuevo]. listado_y + y = 40 * i;
+ + Ii;
) / / End while
- function random (min, max)
- (
- var _loc2 = true;
- if (usados. length <= max - min)
- (
- while (_loc2! = false)
- (
- var _loc1 = Math.floor (Math.random () * (max - min + 1));
- _loc2 = repeat (_loc1)
- ) / / End while
- used. push (_loc1)
- return (_loc1)
- )
- else
- (
- return (0);
- ) / / End else if
- ) / / End of the function
- function repeat (num)
- (
- _loc1 var = false;
- for (i = 0; i <used. length; i + +)
- (
- if (num == Used [i])
- (
- _loc1 = true;
- ) / / End if
- ) / / End of for
- return (_loc1)
- ) / / End of the function
- stop ();
- var used = new Array ();
- _root. palabras_colocadas = 0;
- palabras_correctas = 0;
- listado_x = 700;
- listado_y = 400;
- origenx = 0;
- origeny = 0;
- estaba_en = -1;
- off = false;
- _root. sentence = 2;
- var words = new Array ("huts", "made", "mud", "straw");
- var correct = new Array (false, false, false, false);
- var busy = new Array (-1, -1, -1, -1);
- my_font var = new TextFormat ();
- my_font.font = "Arial";
- my_font.color = 0;
- my_font. size = 30;
- words [i]. embedFonts = true;
- my_font.bold = true;
- var i = 0;
- while (i <4)
- (
- this ["box" + i]. gotoAndStop (1);
- this. createEmptyMovieClip (myClip "+ i, this.getNextHighestDepth ());
- length = words [i]. length * 22;
- this ["myClip" + i]. createTextField ("label", 1, 0, 0, length, 40);
- this ["myClip" + i]. label.text = words [i];
- this ["myClip" + i]. label. setTextFormat (my_font)
- this ["myClip" + i]. onPress = function ()
- (
- temp = this. _name;
- temp = Number (temp charAt (6));
- if (Occupied [0] == temp)
- (
- off = true;
- estaba_en = 0;
- ) / / End if
- if (Occupied [1] == temp)
- (
- off = true;
- estaba_en = 1;
- ) / / End if
- if (Occupied [2] == temp)
- (
- off = true;
- estaba_en = 2;
- ) / / End if
- if (Occupied [3] == temp)
- (
- off = true;
- estaba_en = 3;
- ) / / End if
- if (! off)
- (
- estaba_en = -1;
- ) / / End if
- origenx = this._x;
- origeny = this. _y;
- trace ("was" + estaba_en)
- this.startDrag ();
- );
- this ["myClip" + i]. onRelease = this ["myClip" + i]. onReleaseOutside = function ()
- (
- this.stopDrag ();
- which = this._name;
- which = Number (cual. charAt (6));
- drop = eval (this._droptarget)
- trace (drop);
- WHERE = String (drop);
- frame = donde.substr (8, 6);
- WHERE = Number (donde. charAt (14));
- trace (Which + "in" + WHERE + "" + table);
- if (table == "table")
- (
- if (Occupied [WHERE]> = 0 & & Occupied [WHERE] <= 3 | | WHERE == estaba_en)
- (
- off = false;
- this._x = origenx;
- this._y = origeny;
- )
- else
- (
- if (! off)
- (
- + + _root.palabras_colocadas;
- ) / / End if
- section = eval ("tranche" + (where + 1) + "_mc");
- tramo.gotoAndPlay (2);
- if (_root. palabras_colocadas> = 4)
- (
- startbtn.start ();
- start_mc. gotoAndPlay (2);
- )
- else
- (
- palabra_ok.start ();
- ) / / End else if
- length = words [Which]. length * 8.500000E +000;
- drop.gotoAndStop (2);
- this._y = drop._y - 22;
- this._x = drop. _x - long;
- Occupied [WHERE] = is;
- if (off)
- (
- off = eval ("Table" + estaba_en)
- apaga.gotoAndStop (1);
- = Eval section ("section" + (estaba_en +1) + "_mc");
- tranche. gotoAndPlay (6);
- Occupied [estaba_en] = -1;
- correct [estaba_en] = false;
- off = false;
- trace ("is" + _root.palabras_colocadas + "words");
- if (_root.palabras_colocadas == 3)
- (
- trace ("Without noise off");
- start_mc. gotoAndStop (1);
- ) / / End if
- ) / / End if
- trace (Occupied [0] + "" + Occupied [1] + "" + Occupied [2] + "" + Occupied [3]);
- if (Which == where)
- (
- + + Palabras_correctas;
- correct [WHERE] = true;
- ) / / End if
- ) / / End if
- ) / / End else if
- if (table == "myClip" | | Table == "start_)
- (
- palabra_error.start ();
- this._x = origenx;
- this. _y = origeny;
- ) / / End if
- if (table == "bottom")
- (
- if (off)
- (
- off = eval ("Table" + estaba_en)
- off. gotoAndStop (1);
- = Eval section ("section" + (estaba_en +1) + "_mc");
- tramo.gotoAndPlay (6);
- Occupied [estaba_en] = -1;
- correct [estaba_en] = false;
- - _root. Palabras_colocadas;
- off = false;
- trace ("is" + _root.palabras_colocadas + "words");
- if (_root. palabras_colocadas == 3)
- (
- startbtn.start ();
- start_mc.gotoAndStop (1);
- ) / / End if
- ) / / End if
- ) / / End if
- );
- + + I;
- ) / / End while
- var ii = 0;
- while (ii <4)
- (
- var numeroNuevo = random (1, 4);
- trace (numeroNuevo)
- this ["myClip" + numeroNuevo]. _x = listado_x;
- this [myClip "+ numeroNuevo]. listado_y + y = 40 * i;
- + + Ii;
- ) / / End while
- Anonymous
- Bot


- Inscription: 25 Feb 2008
- Messages: ?
- Loc: Ozzuland
- Status: Online
Avril 10th, 2010, 9:56 pm
Page 1 sur 1
Pour répondre à ce sujet, vous devez vous connecter ou vous enregistrer. Il est gratuit.
Afficher de l'information
- Total des messages de ce sujet: 1 message
- Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 44 invités
- Vous ne pouvez pas poster de nouveaux sujets
- Vous ne pouvez pas répondre aux sujets
- Vous ne pouvez pas éditer vos messages
- Vous ne pouvez pas supprimer vos messages
- Vous ne pouvez pas joindre des fichiers
