Trace une Ligne en action script erreur dans mon code

cs_jzeel Messages postés 156 Date d'inscription mercredi 21 décembre 2005 Statut Membre Dernière intervention 10 mars 2011 - 17 mars 2006 à 20:22
cs_bali_balo Messages postés 1378 Date d'inscription samedi 9 octobre 2004 Statut Membre Dernière intervention 1 novembre 2010 - 21 mars 2006 à 18:12
Salut tout le monde,

Je veux faire deux lignes parallelle qui se trace en ligne droite de gauche a droite et qui s'arrete apres l'avoir duplique 32 fois et se en actionscript et non avec des "goto" voici mon code :

for(i=1; i<=32; i++){
UpLine0.duplicateMovieClip(UpLine+i, 1);
DownLine0.duplicateMovieClip(DownLine+i, 1);
UpLine+i = UpLine+i-1._x - UpLine+i-1._width;
DownLine+i = DownLine+i-1._x - DownLine+i-1._width;
}

Le probleme c'est que cela me donne cette ERREUR :

**Error** Scene=Scene 1, layer=Up - Down Line, frame=1:Line 4: Left side of assignment operator must be variable or property.
UpLine+i = UpLine+i-1._x - UpLine+i-1._width;

**Error** Scene=Scene 1, layer=Up - Down Line, frame=1:Line 5: Left side of assignment operator must be variable or property.
DownLine+i = DownLine+i-1._x - DownLine+i-1._width;

Merci pour votre aide.

Jzeel

27 réponses

astrolabbcracker Messages postés 106 Date d'inscription mardi 11 janvier 2005 Statut Membre Dernière intervention 11 juin 2012
19 mars 2006 à 23:48
ben j'ai mx !!!



et chez moi, cela marche très bien.



je propose d'essayer un truc : essayons de localiser l'endroit où le code ripe :



1 :

_root.createEmptyMovieClip("UpLine", _level0.getNextHighestDepth());

_root.UpLine.lineStyle(2, 0xF73A20, 100, true, "none", "round", "miter", 1);
_root.depart=500;

_root.arrivee=200;

_root.UpLine.moveTo(_root.depart,"200");

_root.UpLine.lineTo(_root.arrivee,"200");





-----> ce code permet-il de créer 1 ligne chez toi jzeel ?



2 :

_root.createEmptyMovieClip("UpLine", _level0.getNextHighestDepth());

_root.UpLine.lineStyle(2, 0xF73A20, 100, true, "none", "round", "miter", 1);

_root.createEmptyMovieClip("Downline", _level0.getNextHighestDepth());

_root.Downline.lineStyle(2, 0xF73A20, 100, true, "none", "round", "miter", 1);

_root.depart=500;

_root.arrivee=480;

_root.UpLine.moveTo(_root.depart,"200");


_root.UpLine.lineTo(_root.arrivee,"200");


_root.Downline.moveTo(_root.depart,"250");


_root.Downline.lineTo(_root.arrivee,"250");



-----> ce code permet-il de créer 2 petites lignes parallèles ?



3 :

var marche;

var duration = 20;



function dessinligne() {

trace("Astrolabb arrive encore a faire une fonction setinterval qui marche ");

}



marche = setInterval(this, "dessinligne", duration);



------> ce code permet-il de répéter une évidence des miliers de fois ?



4 :

_root.createEmptyMovieClip("UpLine", _level0.getNextHighestDepth());

_root.UpLine.lineStyle(2, 0xF73A20, 100, true, "none", "round", "miter", 1);

_root.createEmptyMovieClip("Downline", _level0.getNextHighestDepth());

_root.Downline.lineStyle(2, 0xF73A20, 100, true, "none", "round", "miter", 1);

_root.depart=500;

_root.arrivee=480;

_root.arrivee_fin=10;

var marche;

var duration = 20;



function dessinligne() {

if(_root.arrivee >= _root.arrivee_fin) {

_root.arrivee-=5;

_root.UpLine.moveTo(_root.depart,"200");

_root.UpLine.lineTo(_root.arrivee,"200");

_root.Downline.moveTo(_root.depart,"250");

_root.Downline.lineTo(_root.arrivee,"250");

}

else{

clearInterval(marche);

}

}



marche = setInterval(this, "dessinligne", duration);



------> là c le top et on peut fermer la rubrique
0
cs_jzeel Messages postés 156 Date d'inscription mercredi 21 décembre 2005 Statut Membre Dernière intervention 10 mars 2011
20 mars 2006 à 00:42
Ok PARFAIT je vois le problème, lorsque je les essaie séparément, le 1 - 3 et 4 marche mais le 2 ne donne pas 2 petites lignes parallèles mais juste une seule ligne.

Par contre, lorsque je mets tous les codes ensemble je vois une seule ligne qui s'allonge et non 2 lignes.

Jzeel
0
cs_jzeel Messages postés 156 Date d'inscription mercredi 21 décembre 2005 Statut Membre Dernière intervention 10 mars 2011
20 mars 2006 à 01:34
Ok je vois, lorsque je met en commentaire('//') les lignes concernant UpLine, DownLine s'affiche et lorsque je met en commentaire les lignes concernant DownLine, c'est UpLine qui s'affiche ET si je mets aucun des deux en commentaire il y aura juste DownLine qui va s'afficher et non UpLine.... si cela peut t'aider. BIZZARE!!!!

Jzeel
0
astrolabbcracker Messages postés 106 Date d'inscription mardi 11 janvier 2005 Statut Membre Dernière intervention 11 juin 2012
20 mars 2006 à 08:09
// essai ça :



createEmptyMovieClip("UpLine", 1);

UpLine.lineStyle(2, 0xF73A20, 100, true, "none", "round", "miter", 1);

createEmptyMovieClip("Downline", 2);

Downline.lineStyle(2, 0xF73A20, 100, true, "none", "round", "miter", 1);

_root.depart=500;

_root.arrivee=480;

_root.arrivee_fin=10;

var marche;

var duration = 20;



function dessinligne() {

if(_root.arrivee >= _root.arrivee_fin) {

_root.arrivee-=5;

UpLine.moveTo(_root.depart,"200");

UpLine.lineTo(_root.arrivee,"200");

Downline.moveTo(_root.depart,"250");

Downline.lineTo(_root.arrivee,"250");

}

else{

clearInterval(marche);

}

}



marche = setInterval(this, "dessinligne", duration);





//ça marche ?

//juste pour voir si la fonction : _level0.getNextHighestDepth() passe
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_jzeel Messages postés 156 Date d'inscription mercredi 21 décembre 2005 Statut Membre Dernière intervention 10 mars 2011
20 mars 2006 à 17:11
Oui cela marche enfin et j'ai voulu aller plus loin en faisant en sorte que quand les lignes Upline et DownLine arrive au bout ils changent de direction et faire une forme de couloir(comme le site www.audi.com/q7) et cela marche aussi mais séparément, lorsque je met les 2 portions de code ensemble il y en a une qui marche et non l'autre, meme avec les modif que tu as faites... voici les portions essaye toi-meme séparément pour voir :


1ere portion :

createEmptyMovieClip("DownLine", 2);
DownLine.lineStyle(1, 0xFFFFFF, 100, true, "none", "round", "miter", 1);
_root.depart=500;
_root.depart1=100;
_root.arrivee=480;
_root.arrivee1=75;
_root.arrivee_fin=105;
_root.Ups=290;
_root.Ups_fin=590;
var marche;
var duration = 5;

function dessinligne() {
if(_root.arrivee >= _root.arrivee_fin) {
_root.arrivee-=5;
_root.DownLine.moveTo(_root.depart,"270");
_root.DownLine.lineTo(_root.arrivee,"270");
}
else if(_root.arrivee < 105 && _root.Ups <= _root.Ups_fin){
_root.DownLine.moveTo(_root.depart1,"270");
_root.DownLine.lineTo(_root.arrivee1,Ups);
_root.Ups+=4;
_root.arrivee1-=5;
}
else{
clearInterval(marche);
}
}
marche = setInterval(this, "dessinligne", duration);



2eme portion:


createEmptyMovieClip("UpLine", 1);
UpLine.lineStyle(1, 0xFFFFFF, 100, true, "none", "round", "miter", 1);
_root.depart=500;
_root.depart1=100;
_root.arrivee=480;
_root.arrivee1=80;
_root.arrivee_fin=105;
_root.Ups=160;
_root.Ups_fin=-140;
var marche;
var duration = 5;

function dessinligne() {
if(_root.arrivee >= _root.arrivee_fin) {
_root.arrivee-=5;
_root.UpLine.moveTo(_root.depart,"180");
_root.UpLine.lineTo(_root.arrivee,"180");
}
else if(_root.arrivee < 105 && _root.Ups >= _root.Ups_fin){
_root.UpLine.moveTo(_root.depart1,"180");
_root.UpLine.lineTo(_root.arrivee1,Ups);
_root.Ups-=5;
_root.arrivee1-=5;
}
else{
clearInterval(marche);
}
}
marche = setInterval(this, "dessinligne", duration);




Jzeel
0
cs_jzeel Messages postés 156 Date d'inscription mercredi 21 décembre 2005 Statut Membre Dernière intervention 10 mars 2011
21 mars 2006 à 15:17
Oupss, j'avais oublié la 2 eme protion .. alors lorsque je met les 2 portions de code ensemble il y en a une qui marche et non l'autre, meme avec les modif que tu as faites... mais séparément ils marchent.... En passant, pour ton LOGO je nèaurai pas le choix de le faire d'ici la fin de semaine car mon illustrator est un try out et il me reste 6 jours pour l'uiliser... ton logo doit faire ressortir quoi, quel est son nom? est-ce astrolabbcracker? ...@+

2eme portion:


createEmptyMovieClip("UpLine", 1);
UpLine.lineStyle(1, 0xFFFFFF, 100, true, "none", "round", "miter", 1);
_root.depart=500;
_root.depart1=100;
_root.arrivee=480;
_root.arrivee1=80;
_root.arrivee_fin=105;
_root.Ups=160;
_root.Ups_fin=-140;
var marche;
var duration = 5;

function dessinligne() {
if(_root.arrivee >= _root.arrivee_fin) {
_root.arrivee-=5;
_root.UpLine.moveTo(_root.depart,"180");
_root.UpLine.lineTo(_root.arrivee,"180");
}
else if(_root.arrivee < 105 && _root.Ups >= _root.Ups_fin){
_root.UpLine.moveTo(_root.depart1,"180");
_root.UpLine.lineTo(_root.arrivee1,Ups);
_root.Ups-=5;
_root.arrivee1-=5;
}
else{
clearInterval(marche);
}
}
marche = setInterval(this, "dessinligne", duration);


Jzeel
0
cs_bali_balo Messages postés 1378 Date d'inscription samedi 9 octobre 2004 Statut Membre Dernière intervention 1 novembre 2010 1
21 mars 2006 à 18:12
Vous pouvez pas valider la réponse ( parce que on s'est trop éloigné de la 1er question là ) et que vous parliez tous ça en message privé!!!

Moi perso j'en peu plus

bali_balo....=]
0
Rejoignez-nous