0

私はフラッシュが初めてで、ボリュームスライダーが作成され、すべてのボリューム機能のインスタンスが明確に作成されましたが、次のエラーが発生します

 TypeError: Error #1010: A term is undefined and has no properties. 

次のコードの正確なエラーの場所は

bgslider.mc.addEventListener(MouseEvent.MOUSE_DOWN,StartDrag);

私のプレイヤーコードは

import flash.events.MouseEvent;
import flash.media.Sound;
import flash.net.URLRequest;
import flash.media.SoundChannel;
import flash.media.SoundTransform;
import flash.events.Event;
import flash.geom.Rectangle;

btnstop.addEventListener(MouseEvent.MOUSE_OUT,StopOut);
btnstopo.addEventListener(MouseEvent.MOUSE_OVER,StopOver);
function StopOver(evt:MouseEvent):void
{
    btnstopo.visible=false;
    btnstop.visible=true;
}

function StopOut(evt:MouseEvent):void
{
    btnstop.visible=false;
    btnstopo.visible=true;
}

btnplay.addEventListener(MouseEvent.MOUSE_OUT,PlayOut);
btnplayo.addEventListener(MouseEvent.MOUSE_OVER,PlayOver);

function PlayOver(evt:MouseEvent):void
{
    btnplayo.visible=false;
    btnplay.visible=true;
}

function PlayOut(evt:MouseEvent):void
{
    btnplay.visible=false;
    btnplayo.visible=true;
}

var soundfile:URLRequest = new URLRequest('http://live32.radio.com:80/;stream1.mp3');
var channel:SoundChannel = new SoundChannel();
var sTransform:SoundTransform = new SoundTransform();

 var isplay=1;
 var myMusic:Sound = new Sound();  
 myMusic.load(soundfile);
 channel=myMusic.play(); 

btnplay.addEventListener(MouseEvent.CLICK,PlayRadio);
btnstop.addEventListener(MouseEvent.CLICK,StopRadio);

function PlayRadio(evt:Event):void
{
    if(isplay==0)
    {
        isplay=1;       
        btnplay.removeEventListener(MouseEvent.MOUSE_OUT,PlayOut);
        btnplayo.removeEventListener(MouseEvent.MOUSE_OVER,PlayOver);
        btnstop.addEventListener(MouseEvent.MOUSE_OUT,StopOut);
        btnstopo.addEventListener(MouseEvent.MOUSE_OVER,StopOver);
        SoundMixer.soundTransform = new SoundTransform(1);
        btnstop.visible=true;
        btnplay.visible=false;
    }
}

function StopRadio(evt:Event):void
{
    if(isplay==1)
    {
        btnstop.removeEventListener(MouseEvent.MOUSE_OUT,StopOut);
        btnstopo.removeEventListener(MouseEvent.MOUSE_OVER,StopOver);
        btnplay.addEventListener(MouseEvent.MOUSE_OUT,PlayOut);
        btnplayo.addEventListener(MouseEvent.MOUSE_OVER,PlayOver);
        SoundMixer.soundTransform = new SoundTransform(0);
        isplay=0;
        btnstop.visible=false;
        btnplay.visible=true;
    }
}

/*var bgslider = new MovieClip();
trace(bgslider.name);

for(var i:uint=0;i<bgslider.numChildren;i++){
trace(bgslider.getChildAt(i).name);
}*/
bgslider.mc.addEventListener(MouseEvent.MOUSE_DOWN,StartDrag);
bgslider.mc.addEventListener(MouseEvent.MOUSE_UP,StopDrag);
function StartDrag(event:MouseEvent):void
{
    bgslider.mc.startDrag(true,new Rectangle(152,37,182,0));
}
function StopDrag(event:MouseEvent):void
{
    bgslider.mc.stopDrag();
}

誰か正しい答えを教えてください、よろしくお願いします

4

1 に答える 1