here
function drawRoundedRectangle(mc:MovieClip,rectWidth:Number, rectHeight:Number, cornerRadius:Number, fillColor:Number, fillAlpha:Number, lineThickness:Number, lineColor:Number, lineAlpha:Number) {
with (mc) {
beginFill(fillColor, fillAlpha);
lineStyle(lineThickness, lineColor, lineAlpha);
moveTo(cornerRadius, 0);
lineTo(rectWidth - cornerRadius, 0);
curveTo(rectWidth, 0, rectWidth, cornerRadius);
lineTo(rectWidth, cornerRadius);
lineTo(rectWidth, rectHeight - cornerRadius);
curveTo(rectWidth, rectHeight, rectWidth - cornerRadius, rectHeight);
lineTo(rectWidth - cornerRadius, rectHeight);
lineTo(cornerRadius, rectHeight);
curveTo(0, rectHeight, 0, rectHeight - cornerRadius);
lineTo(0, rectHeight - cornerRadius);
lineTo(0, cornerRadius);
curveTo(0, 0, cornerRadius, 0);
lineTo(cornerRadius, 0);
endFill();
}
}
이 학습을위한
에서이 드로잉 API 발견은 엄격하게 제안한다!
this.createEmptyMovieClip("th",100);
drawRoundedRectangle(th,100,50,5,0x00f999,100,1,0x000000,100);
th.onRollOver = function() {
decrement(th);
}
th.onRollOut = function() {
increment(th);
}
function decrement(mc){
mc.onEnterFrame= function(){(th._alpha > 50)?th._alpha -= 9:delete this.onEnterFrame;}
}
function increment(mc){
mc.onEnterFrame= function(){(th._alpha < 100)?th._alpha += 5:delete this.onEnterFrame;}
}
통찰력을 주셔서 감사합니다. 그러나 여전히 전체 영역에서 clickTag 액션을 원합니다. 따라서 버튼 영역을 잘라내는 경우 클릭 태그 액션을 버튼에도 복사해야합니다. –
알았어, 사실 생각해 봤어. 나는 내 자신을 학대한다. 마우스 배치에 대한 리스너는 어떻습니까? 따라서 마우스를 놓았을 때의 버튼, 버튼 호버 애니메이션이 함수별로 호출됩니다. 맞춤 제작 버튼으로 그렇게 할 수있을거야. 그러나 당신이 구성 요소 버튼을 숙고하는 경우 .. 심층 검색이 필요합니다. [link] (http://www.hotscripts.com/category/scripts/flash/components/) – animaacija
[20 펜스] (http : // docs. brajeshwar.com/as2/Button.html)을 Button 클래스 메소드에 추가합니다. 'btt.tabEnabled = true; btt.tabIndex = 1; btt.useHandCursor = true; btt.onDragOver = true; ' – animaacija