진짜 조금만 울게....... 된다 ㅠㅠ 
cross domain.xml파일이 뭔지 이해를 못해서 음짤을 만들어놓고
웹에 올리면 안나오는 상태를 계속 반복
저와 같은 왕초보들에게 자세하게 설명해드리겠습니다.ㅠㅠ초보들 화이팅
메모장에 다음을 쓰시고 txt파일 확장자를 crossdomain.xml로 바꾸세요.

 
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
</cross-domain-policy>

(크로스도메인 파일 다운) 
  


 그리고 티스토리 css편집-파일 업로드에 음악과 crossdomain,xml을 업로드하세요.
그리고 액션에는 
http://cfs.tistory.com/custom/blog/55/123456/skin/images/crossdomain.xml
주소가 이런식으로 됩니다. 
다른건 다 똑같이 하시고 55/123456 이부분은 블로그마다 틀리니까
이미지보기에서 url따시면 자기 주소 나옵니다. 그것만 수정하시고
링크넣으시면 됩니다. 
음악도 마찬가지로 
http://cfs.tistory.com/custom/blog/55/123456/skin/images/음악파일이름.mp3
이런식으로 음악파일이름에는 업로드하신 파일이름 적으시면 됩니다. 음악파일을 music으로 업로드하셨으면 
http://cfs.tistory.com/custom/blog/55/123456/skin/images/music.mp3 이렇게요.
그렇게만 적으시면 되요.

스펙트럼 음짤 액션
Security.loadPolicyFile("http://cfs.tistory.com/custom/blog/55/123456/skin/images/crossdomain.xml");

var s:Sound = new Sound();
s.load(new URLRequest("http://cfs.tistory.com/custom/blog/55/123456/skin/images/음악파일이름.mp3"));
var channelObj:SoundChannel;
channelObj = s.play(0, int.MAX_VALUE);
var cl:int = 67; //스펙트럼 개수
var ba :ByteArray = new ByteArray();
var spectrum:Array = []; //스펙트럼
var spectrum2:Array = []; //스펙트럼 위의 작은 박스
var spectrumContainer:Sprite = new Sprite();
box.addChild(spectrumContainer);
spectrumContainer.scaleY = -1;
spectrumContainer.y = 470; //스펙트럼 y값
spectrumContainer.x = -20; //스펙트럼 x값
/*
막대그래프 스펙트럼 생성
*/
function makeBar(container:Sprite, w:Number,h:Number, color:Number):Shape
{
        var r:Shape = new Shape();
        container.addChild(r);
        r.graphics.beginFill(color,1);
        r.graphics.drawRect(0,0,w,h);
        r.graphics.endFill();
        return r;
}

function drawBarSpectrum():void
{
        var i:int = 0;
        var w:int = 12; // 스펙트럼 너비
        while (i<cl)
        {
                spectrum.push(makeBar(spectrumContainer, w, 1, 0xFFFFFF));
                spectrum2.push(makeBar(spectrumContainer, w,1 , 0xFFFFFF));
                var bar = spectrum[i];
                var bar2 = spectrum2[i];
                bar2.x = bar.x = i*(bar.width+1);
                i++;
        }
}
drawBarSpectrum();
/*
스펙트럼 렌더링
*/
function makeSpectrum():void
{
        SoundMixer.computeSpectrum(ba, false, 0);
        var i:int = cl;
        while (i>0)
        {
                i--;
                var ty = ba.readFloat()*80;
                spectrum[i].height -= (spectrum[i].height - ty - 100)*.7; // 100이 스펙트럼 높이
                spectrum2[i].y -= (spectrum2[i].y-(spectrum[i].y+spectrum[i].height+3));
        }
}
addEventListener(Event.ENTER_FRAME, gotoFrame);
function gotoFrame(e:Event):void
{
        makeSpectrum();
}
box.alpha = .7;

-

(스펙트럼 음짤 액션 다운) 
  


 

+플갤강의를 보고 따라했습니다. 

 

'action script/flash' 카테고리의 다른 글

노래 플레이어 만들기(JW mp3 player)  (0) 2011.11.29
flash 기초  (0) 2011.09.18
크롬 chrome missing plug in 해결방법!  (9) 2011.09.18
플립카운터 D-day카운터  (0) 2011.09.17