|
|
|
 |
|  |
 |
JaM |
[FLASH] Help con actionscript |
02-05-2004 11:09 |
|
 |
JaM |
######

Registered: Jun 2002
Posts: 3604 (0.43 al dì)
Location: everywhere, anywhere, elsewhere...
Corso: ComDig
Anno: dott.??
Time Online: 62 Days, 16:55:46 [...]
Status: Offline
Edit | Report | IP: Logged |
[FLASH] Help con actionscript
devo disegnare dei punti che siano trascinabili uniti da delle linee
i punti, che sono dei bottoni, hanno associato questo script
code: on(press)
{
startDrag(this.punto2);
}
on(release)
{
stopDrag();
}
mentre nel frame ho definito la funzione che disegna le linee
code: function draw()
{
this.createEmptyMovieClip("drawlines", 1);
this.drawlines.lineStyle(2, 0x000000, 100);
this.drawlines.moveTo(punto1._x, punto1._y);
this.drawlines.lineTo(punto2._x, punto2._y);
this.drawlines.lineTo(punto3._x, punto3._y);
}
il problema e': come fare a ridisegnare le linee mentre trascino i pulsanti?
se richiamo la draw nell'on(release) me le ridisegna quando rilascio il punto....
ho provato a mettere nel frame, subito dopo alla dichiarazione della draw un setInterval (draw(), 100); che dovrebbe ridisegnarmi le linee ogni 100 millisecondi ma non funziona...
avete suggerimenti da darmi? dove sbaglio?
gracias
|
02-05-2004 11:09 |
|
|
|  |
 |
fabpicca |
...stupidamente....e se facessi la startDrag sulle ... |
02-05-2004 12:24 |
|
 |
fabpicca |
jesus robot d'acciaio

Registered: May 2002
Posts: 2166 (0.26 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno: 1°
Time Online: 12 Days, 23:12:28 [...]
Status: Offline
Edit | Report | IP: Logged |
...stupidamente....e se facessi la startDrag sulle linee e poi alla fine ci piazzi i punti?
__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour
"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)
|
02-05-2004 12:24 |
|
|
|  |
 |
JaM |
come faccio a draggare una estremita' della linea ... |
02-05-2004 12:43 |
|
 |
JaM |
######

Registered: Jun 2002
Posts: 3604 (0.43 al dì)
Location: everywhere, anywhere, elsewhere...
Corso: ComDig
Anno: dott.??
Time Online: 62 Days, 16:55:46 [...]
Status: Offline
Edit | Report | IP: Logged |
come faccio a draggare una estremita' della linea lasciando l'altra al suo posto? 
attualmente sto tentanto con
bottoni:
code: on(press)
{
startDrag(this.punto1);
var interval = setInterval(draw(1), 1);
}
on(release)
{
stopDrag();
clearInterval(interval);
draw(0);
}
frame:
code: function draw(n)
{
if (n==1) {x1=this._xmouse; y1=this._ymouse;}
else {x1=punto1._x; y1=punto1._y;}
if (n==2) {x2=this._xmouse; y2=this._ymouse;}
else {x2=punto2._x; y2=punto2._y;}
if (n==3) {x3=this._xmouse; y3=this._ymouse;}
else {x3=punto3._x; y3=punto3._y;}
this.createEmptyMovieClip("drawlines", 1);
this.drawlines.lineStyle(2, 0x000000, 100);
this.drawlines.moveTo(x1, y1);
this.drawlines.lineTo(x2, y2);
this.drawlines.lineTo(x3, y3);
}
draw(0);
in teoria dovrebbe partirmi il redraw delle righe quando clicco il bottone e lo sposto, fermandosi al rilascio
in pratica mi becca dove sta il mouse quando clicco, ridisegna la riga in quel punto, ma mentre trascino non fa nulla, ridisegnando la scena solo al rilascio......
|
02-05-2004 12:43 |
|
|
|  |
 |
fulminato1 |
prova a guardare qui [url]http://flash-mx.html.it/ ... |
17-05-2004 11:28 |
|
|
|  |
 |
All times are GMT. The time now is 11:46. |
|
|
 |
|
 |
|
|
|  |
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|