Rakkietto Eroe in grazia degli dei
Registrato: 19/05/05 08:23 Messaggi: 133 Residenza: Italia, dolce Italia (fiscalmente CH)
|
Inviato: 07 Lug 2010 08:35 Oggetto: Passaggio da Actionscript 1 a 3... errore nel codice |
|
|
Ciao a tutti... come sempre quando qualcosa non funziona ricorro a voi...
Ho un codice actionscript per flash che vorrei inserire in un portfolio Acrobat... il problema è che se lo voglio inserire come introduzione posso farlo esclusivamente se si basa su AS 3... nella migrazione automatica fatta da flash però mi segnala due errori che non riesco a correggere...
Vi posto il codice (breve) e i due errori... grazie mille a tutti
___________
#initclip
// constructor
function SpaceWord() {
// set up button functionality
this.btnSquare.onPress = function() {
// push the camera towards the word by setting destination just a bit in front
Object.environment.cam.dx = this._parent.x;
Object.environment.cam.dy = this._parent.y;
Object.environment.cam.dz = this._parent.z+Object.environment.fl*.9;
// disable and hide button
this.enabled = false;
this._visible = false;
};
// set continual function to render word
this.onEnterFrame = this.render;
}
// allow SpaceWord to inherit MovieClip properties
SpaceWord.prototype = new MovieClip();
// instance methods
SpaceWord.prototype.render = function() {
var zActual = Object.environment.fl+this.z-Object.environment.cam.z;
// has the object moved behind the camera?
if (zActual>0) {
// object is still visible
// calculate scale
var scale = Object.environment.fl/zActual;
// set position using camera as an offset
this._x = (this.x-Object.environment.cam.x)*scale;
this._y = (this.y-Object.environment.cam.y)*scale;
// set size
this._xscale = scale*100;
this._yscale = scale*100;
// set fog
this._alpha = 100 - 99 * zActual/Object.environment.fl*.5;
} else {
// object has moved behind camera
// reposition further down the line
this.z += Object.environment.fl*2;
// enable button
this.btnSquare.enabled = true;
this.btnSquare._visible = true;
}
};
SpaceWord.prototype.setWord = function(s) {
this.txtWord = s;
};
SpaceWord.prototype.setPosition = function(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
};
// Connect the class with the linkage ID for this movie clip
Object.registerClass("spaceWord", SpaceWord);
#endinitclip
___________
Gli errori riguardano la prima e l'ultima riga e sono così segnalati...
Simbolo 'spaceWord', livello 'definition' fotogramma 1, riga 1 1093: Errore di sintassi
Simbolo 'spaceWord', livello 'definition' fotogramma 1, riga 55 1093: Errore di sintassi
Grazie ancora a tutti...... |
|