Ciao ragazzi,
ho scaricato un "template" per fare dei quiz utilizzando il Drag&Drop.
Diciamo che il file, che potrete trovare qui: http://www.ffiles.com/flash/learning...quiz_2120.html, è molto semplice se non per una piccolissma cosa: non capisco dove vada a pescare i testi nei vari pulsanti![]()
il codice, quello importante, è questo
e quello, nello specifico, che assegna il testo al campo di testo dinamico è questo:codice:import mx.transitions.Tween; strX = this._x; var ansX = _parent[ctAr]._x; var ansY = _parent[ctAr]._y; stry = this._y; hits = false; hitY = 0; var ga = 0; this.useHandCursor = false; nu_txt.text = lableD; this.onPress = function() { this.startDrag(false); this.swapDepths(_parent.getNextHighestDepth()); }; this.onRelease = onReleaseOutside=function () { stopDrag(); for (i=0; i<11; i++) { if (this.hitTest(_parent[dragAr[i]]) and hits == false) { mathPos(strX, stry); hits = true; break; } else { if (this.hitTest(_parent[targetAr[i]])) { mathPos(_parent[targetAr[i]]._x, _parent[targetAr[i]]._y); place(this._name); if (this.hitTest(_parent[ctAr])) { this.success = true; } else { this.success = false; } break; } else { mathPos(strX, stry); } } } }; function mathPos(xpos, ypos) { t1 = new Tween(this, "_x", Strong.easeOut, this._x, xpos, 0.5, true); t1 = new Tween(this, "_y", Strong.easeOut, this._y, ypos, 0.5, true); hits = false; }
Sinceramente non riesco a capire come editare il codice per fare in modo che appaia la lista di cose che mi serve -.-" Qualcuno può venirmi in contro spiegandomelo??codice:nu_txt.text = lableD;
Lo so a cosa state pensando e sì, non sono un vero genio quando si parla di ActionScript...

