Help, play sound after object Augmented Reality display ?

85 views
Skip to first unread message

Ahmad Romadhon

unread,
Jun 19, 2013, 9:10:46 AM6/19/13
to flartool...@googlegroups.com
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
}
     }
}

Thangaraj

unread,
Jun 19, 2013, 1:09:52 PM6/19/13
to flartoolkit-userz
Try this 

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;
private var soundChannel:SoundChannel = new SoundChannel();
  private var myURLRequest:URLRequest = new URLRequest("lagu.mp3");
private var mySound:Sound = new Sound(myURLRequest);

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);
  
 

--
 
---
You received this message because you are subscribed to the Google Groups "FLARToolKit userz" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flartoolkit-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks,
Thangaraj.S

Ahmad Romadhon

unread,
Jun 19, 2013, 1:37:34 PM6/19/13
to flartool...@googlegroups.com
Thanks for your help. :)
But still look the same as the first. :/

Daniel Ferenc Szak

unread,
Jun 19, 2013, 2:13:46 PM6/19/13
to flartool...@googlegroups.com

... i suppose You have "lagu.mp3" next to Your swf and You are running flashplayer from the very same folder, right?

--

Ahmad Romadhon

unread,
Jun 19, 2013, 2:46:47 PM6/19/13
to flartool...@googlegroups.com
Yes, I've put it in the same folder. :)
Reply all
Reply to author
Forward
0 new messages