ok... andebbero fatte un po' di correzioni... cominciamo:
io ho preferito dichiarare in _root num e shapes nelle mie prove
quindi farò riferimento ad essi come _root.num e _root.shapes invece di usare _global.
le modifiche sono in rosso
//per salvare i dati
codice:
on (press) {
dati = SharedObject.getLocal("draw");
if (dati.data.forme == undefined ) {
dati.data.forme = new Array();
}
lunghezza = _root.shapes.length ;
for (i=0; i<lunghezza; i++) {
dati.data.forme[i] = _root.shapes[i];
}
dati.flush();
}
//per recuperare i dati
codice:
on (press) {
dati = SharedObject.getLocal("draw");
lunghezza = dati.data.forme.length ;
shapesRec = new Array();
for (i=0; i<lunghezza; i++) {
shapesRec[i] = dati.data.forme[i];
initDrawing();
selectColourThicknessAlpha(shapesRec.colore, shapesRec.thickness, alpha);
drawLine(shapesRec[i].start_X, shapesRec[i].start_Y, shapesRec[i].endX, shapesRec[i].endY, true);
}
}