Salve ragazzi, non riesco a capire come mai utilizzando il seguente codice actionscript per creare un cubo ed una piramide rotanti tramite il mouse, non ottengo nessun risultato....ovvero quando avvio l'anteprima del filmato (del file .fla dove includo il file actionscript) vedo tutto bianco...
Ecco il codice:
import sandy.core.data.*;
import sandy.core.group.*;
import sandy.primitive.*;
import sandy.view.*;
import sandy.core.*;
import sandy.skin.*;
import sandy.util.*;
import sandy.core.transform.*;
import sandy.events.*;
var tg2:TransformGroup = new TransformGroup();
var trans:Transform3D = new Transform3D();
trans.translate(40, 0, 0);
tg2.setTransform( trans );
tg2.addChild( pyramid );
tg1.addChild( cube ); // Aggiungiamo il cubo al gruppo tg1
tg1.addChild( tg2 ); // Aggiungiamo la piramide al gruppo tg1
bg.addChild( tg1 ); // Aggiungiamo il gruppo tg1 al gruppo principale
Mouse.addListener(this);
onMouseDown = function() {
mousedown = true;
mouseX = _xmouse;
mouseY = _ymouse;
};
onMouseUp = function() {
mousedown = false;
mouseX = _xmouse;
mouseY = _ymouse;
};
world.addEventListener(World3D.onRenderEVENT,this, rotate);
function rotate() {
if ( mousedown ) {
x += ( _ymouse - mouseY )/10;
y += ( mouseX -_xmouse )/10;
rotation.rot( x, y, z );
tg1.setTransform(rotation);
}
}
Vi ringrazio in anticipo per il vostro aiuto...

Rispondi quotando