package{
import flash.events.Event;
import org.papervision3d.objects.parsers.DAE;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.net.URLRequest;
[SWF(width=640, height=480, backgroundColor=0x808080, frameRate=30)]
public class Piramid extends PV3DARApp {
private var _Piramid;DAE;
public function Piramid() {
addEventListener (Event.INIT, _onInit);
init('Data/camera_para.dat','Data/Piramid.pat');
}
private function _onInit(e:Event):void
{
_Piramid = new DAE();
_Piramid.load('model/Piramid.dae');
_Piramid.scale = 2;
_Piramid.rotationX = 90;
_markerNode.addChild(_Piramid);
var soundChannel:SoundChannel = new SoundChannel();
var myURLRequest:URLRequest = new URLRequest("lagu.mp3");
var mySound:Sound = new Sound(myURLRequest);
soundChannel = mySound.play();
addEventListener(Event.ENTER_FRAME, _update);
}
private function _update(e:Event):void
{
_Piramid.rotationZ -= 0.5
}
}
}