i was able to hear the sound using attachSound but not attachAudio! anyone please help…desperate here.
var nc:NetConnection = new NetConnection();
nc.connect(null);// ----flash communication server address----
var ns:NetStream = new NetStream(nc);
buffer._visible = false;//is a movieClip call buffer
theVideo.attachVideo(ns);
ns.play("gStarted_wifAudio.flv");
_root.createEmptyMovieClip("videoSound",_root.getNextHighestDepth());
videoSound.attachAudio(ns);
//----TESTCode----
var videoSoundObject:Sound = new Sound(videoSound);
videoSoundObject.setVolume(100);
//----setUpSoundObject----
// need to prePlay a splashimageScreen
//----topicsButtons----
gettingStarted.onRelease = function() {
buffer._visible = true;
ns.play("gStarted_wifAudio.flv");
ns.setBufferTime(2);
ns.onStatus = function(info){
if(info.code == "NetStream.Buffer.Full"){
buffer._visible = false;
}
if(info.code == "NetStream.Buffer.Empty"){
buffer._visible = true;
}
if(info.code == "NetStream.Play.Stop"){
ns.seek(0);
}
}
}
frequencyDistribution.onRelease = function() {
ns.play("FD_full screen_uncompress.flv");
}
//----progressbar & scrubber ----
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;
//----scrubber movement----
ns["onMetaData"] = function(obj) {// encode.flv in flash video exporter 1.2
duration = obj.duration;//total duration of the video
}
function videoStatus() {
amountLoaded = ns.bytesLoaded/ ns.bytesTotal;
loader.loadbar._width = amountLoaded * 264;
loader.scrub._x = ns.time / duration * 264;
}
var scrubInterval;
loader.scrub.onPress = function(){
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);//100 times perSeconds
this.startDrag(false,0,this._y,262,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function(){
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);//1000 times perSeconds
this.stopDrag();
}//encode more frames for smoother scrub function
function scrubit(){
ns.seek(Math.floor((loader.scrub._x/262)*duration));
}
//var CheckInterval = setInterval(checkStatus,100);
//function checkStatus(){
//volumeDegree = math.floor((mySlider.dragger._x/93)*100);
//videoSoundObject.setVolume(volumeDegree);
//}
//----EndOfTestCode----
mySlider.dragger.onPress = function(){
this.startDrag(false,0,this._y,93,this._y);
}
mySlider.dragger.onRelease = mySlider.dragger.onReleaseOutside = function(){
this.stopDrag();
}
closeBtn.onRelease = function () {
_level0._visible = 100;
_level1._visible = 100;
_level2._visible = 100;
_level3._visible = 100;
_level4._visible = 100;
_level5._visible = 100;
_level6._visible = 100;
_level10._visible = 100;
unloadMovie(15); //_level of this video.swf is load;
}