下雪寒冰老师FL动画【开窗听雨】课录

空间课录

 主讲                              夏雪寒冰老师

课录


    
附                                                                                                                                        
习作

****** 
请 用 鼠 标 开 窗 控 制 声 音 大 小。

 


附                                                                                                                                                                                    
           语句


 mysound = new Sound();
mysound.attachSound("雨声");
mysound.start(0, 100);
mysound.setVolume(0);
lx = 左窗._x;
ly = 左窗._y;
rx = 右窗._x;
onEnterFrame = function () {
 v1 = (rx-右窗._x)/(rx-lx)*100;
 v2 = (左窗._x-lx)/(rx-lx)*100;
 if (左窗._x>右窗._x) {
  v1 = (rx-左窗._x)/(rx-lx)*100;
  v2 = (右窗._x-lx)/(rx-lx)*100;
 }
 v = v1+v2;
 mysound.setVolume(v);
};
右窗.onPress = function() {
 this.startDrag(false, lx, ly, rx, ly);
};
右窗.onMouseUp = function() {
 this.stopDrag();
};
左窗.onPress = function() {
 this.startDrag(false, lx, ly, rx, ly);
};
左窗.onMouseUp = function() {
 this.stopDrag();
};

文章评论