Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Forum De Bell Tolls > [FLASH] Help con actionscript
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
JaM
######

User info:
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

Post actions:

Edit | Report | IP: Logged
Exclamation [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 :D

02-05-2004 11:09
Click Here to See the Profile for JaM Click Here to See the Blog of JaM Click here to Send JaM a Private Message Visit JaM's homepage! Find more posts by JaM Add JaM to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fabpicca
jesus robot d'acciaio

User info:
Registered: May 2002
Posts: 2166 (0.26 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno:
Time Online: 12 Days, 23:12:28 [...]
Status: Offline

Post actions:

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
Click Here to See the Profile for fabpicca Click Here to See the Blog of fabpicca Click here to Send fabpicca a Private Message Visit fabpicca's homepage! Find more posts by fabpicca Add fabpicca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
JaM
######

User info:
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

Post actions:

Edit | Report | IP: Logged

come faccio a draggare una estremita' della linea lasciando l'altra al suo posto? :pensa:

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
Click Here to See the Profile for JaM Click Here to See the Blog of JaM Click here to Send JaM a Private Message Visit JaM's homepage! Find more posts by JaM Add JaM to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fulminato1
aLTeRaZioNeGuiTaRVoiCe

User info:
Registered: Oct 2003
Posts: 2809 (0.35 al dì)
Location: a casa.
Corso: comunicazio digital
Anno: secondo?
Time Online: 30 Days, 8:54:34 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

prova a guardare qui http://flash-mx.html.it/articoli/vi...p?idarticolo=28,
è un articolo sui drawing methods, l'avevo letto tempo fa, ora non mi ricordo bene ma qualkosa per risolvere il tuo problema magari lo trovi!

__________________
www.alterazione.com www.andreaforzani.com
www.myspace.com/alterazione
www.myspace.com/festaincravilla

17-05-2004 11:28
Click Here to See the Profile for fulminato1 Click Here to See the Blog of fulminato1 Click here to Send fulminato1 a Private Message Visit fulminato1's homepage! Find more posts by fulminato1 Add fulminato1 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 11:46.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

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
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.077 seconds (58.70% PHP - 41.30% MySQL) con 22 query.