2012年12月29日 星期六

2012.12.29-actionscript drag drop moiveclip 拉 move mouse

package  {
   
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
   
   
    public class moon extends MovieClip {
       
       
        public function moon() {
            buttonMode=true;
            this.addEventListener(MouseEvent.MOUSE_DOWN, ondown)  ;
            this.addEventListener(MouseEvent.MOUSE_UP, onUp)  ;
           
        }           
            protected function ondown(event:MouseEvent):void
            {    
                startDrag();
            }
           
            protected function onUp(evt:MouseEvent):void
        {
            evt.target.stopDrag();
        }
    }
   
}

2011.12.28-actionscript collision 碰撞


var  b1:ball1=new ball();
var  b2:ball1=new ball();

if(b1.hitTestObject(b2)){
 trace("hit");
}

2012年12月28日 星期五

2012.12.28 sound download website

1)background music
http://freeplaymusic.com/search/category_search.php?t=v&i=1992

2) lot of sound effect
http://www.allmusiclibrary.com/free_sound_effects.php

3)gun
http://soundbible.com/tags-gun.html


4) background music
http://www.opuzz.com/displayproducts.asp?id=377&cat=Film%A0Style%A0-%A0Suspense&st=styles&pn=Film%A0Style



















2011.12.28-actionscript sound play volume changed

    import flash.media.Sound;




var BG:Sound = new BGMusic();
var myChannel:SoundChannel = new SoundChannel();
var myTransform = new SoundTransform();



myChannel =BG.play();

myTransform.volume = 0.1;
myChannel.soundTransform = myTransform;