호기심에서 벗어나 플렉스 앱의 모든 부분을 최적화하기 위해 노력하고 있습니다. 현재, 모든 버튼/스킨을 최적화하려고합니다. 내가 사용하는 몇 개의 단추와 이들을 생성하는 데 사용하는 몇 가지 샘플 코드를 연결했습니다.플렉스 3의 스킨 버튼 방법?
더 효율적이고 사용 가능하며 전반적으로 개선하는 방법에 대해 조언 해주십시오. 감사!
당신이 볼 수 있듯이, 우리의 버튼은 매우 다를 수 있지만, 비슷한 모양과 느낌을 할 수 있습니다. 현재, 나는 이런 식으로 뭔가 설정하여 '상태 스킨'을 만드는 오전 : 다음
skin: ClassReference('com.mysite.assets.skins.NavigationButtonSkin');
을 NavigationButtonSkin은 다음과 같이 보입니다 : 나는 직진 부품의 일부를 주석
public class NavigationButtonSkin extends UIComponent {
// imports, constructor, etc
protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
// initialize fillColors, fillAlphas, roundedCorners, etc
switch(name){
case 'upSkin':
fillColors = [getStyle('backgroundColor'),getStyle('backgroundColor2')];
break;
// do the same for overSkin, downSkin, disabledSkin, etc
}
// use this.graphics to draw background
// use this.graphics to draw border on top of background
}
}
을하지만, 이 작업이 불량/비효율적 인 방법인지 그리고 개선 방법인지 알려주십시오.
감사합니다.
ProgrammaticSkin을 사용하는 자습서/책/예가 있습니까? 나는 그것을 google 할 것이고, 과거에 그것을 망쳤다. 그러나 당신이 어떤 예를 든다면, 그것은 좋을 것이다! – andrewpthorp
은 UIComponent 대신 ProgrammaticSkin에서 확장되어 작동합니다. –