Vis*_*ani 1 apache-flex actionscript-3
package
{
    import flash.display.Sprite;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    public class EmbeddedSoundExample extends Sprite
    {
        [Embed(source="smallSound.mp3")]
        public var soundClass:Class;
        public function EmbeddedSoundExample()
        {
          //WHAT DOES "as" keyword DO IN THE FOLLOWING LINE ??
          //*************************************************
            var smallSound:Sound = new soundClass() as Sound;
            //COULD BE WRITTEN AS : 
            //==>>>> var smallSound:Sound = new soundClass() ???
            // OR
            ////==>>>> var smallSound:Sound = new Sound() ???
         //******************************************************
            smallSound.play();
        }
    }
}
Run Code Online (Sandbox Code Playgroud)
    |   归档时间:  |  
           
  |  
        
|   查看次数:  |  
           1356 次  |  
        
|   最近记录:  |