많이 찾았지만 성공하지 못했지만 아무도이 문제를 경험 한 적이 없습니다. 나는 displayObject
을 가지고 있습니다. 예를 들어 두 개의 필터를 적용하고 싶습니다. 두 개의 필터를 inner=true
, 두 번째 필터를 inner=false
, 두 개를 dropShadowFilter
, 두 번째 필터를 inner=true
, 다른 하나는 inner=false
이라고 말하면됩니다. 설명서에 설명 된대로 필터는 filters
배열에 나타나는 순서대로 적용됩니다. 따라서 외부 그림자 필터를 먼저 배치하면 두 번째 필터가 생성 된 그림자에도 적용됩니다. 주문 변경은 철저한 해결책이 아니며 문제가 계속되고 다른 필터를 적용하면 별난 효과를 다시 재생할 수 있습니다.여러 개의 필터를 적용했지만 계단식 배열이 아닙니다. 필터 배열의 이전 필터에 다음 필터를 적용하십시오.
나는 이것을 피할 방법을 찾고 있는데, 은 원래의 개체에 모두 적용된 필터를 가지고 있으며, 다른 필터에 의해 수정되지 않았습니다.
감사합니다.
몇 가지 빠른 테스트를 작성하는 데 유용한 코드 단편 아래에.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<s:DropShadowFilter id="dropShadowOuter"
inner="false"
distance="65"
color="#000000"
alpha="0.4"/>
<s:DropShadowFilter id="dropShadowInner"
inner="true"
distance="9"
color="#f3f951"
alpha="1"/>
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.core.UIComponent;
protected function applyFilters_clickHandler(event:MouseEvent):void
{
(OutIn.textDisplay as UIComponent).filters = [dropShadowOuter,dropShadowInner];
(InOut.textDisplay as UIComponent).filters = [dropShadowInner,dropShadowOuter];
(Out.textDisplay as UIComponent).filters = [dropShadowInner];
(In.textDisplay as UIComponent).filters = [dropShadowOuter];
}
]]>
</fx:Script>
<s:VGroup>
<s:Button id="applyFilters" label="apply filters" click="applyFilters_clickHandler(event)"/>
<s:TextArea id="OutIn"
text="EXAMPLE TEXT"
width="600" height="200"
fontFamily="Arial Black"
fontSize="72"/>
<s:TextArea id="InOut" text="EXAMPLE TEXT"
width="600" height="200"
fontFamily="Arial Black"
fontSize="72"/>
<s:TextArea id="Out"
text="EXAMPLE TEXT"
width="600" height="200"
fontFamily="Arial Black"
fontSize="72"/>
<s:TextArea id="In"
text="EXAMPLE TEXT"
width="600" height="200"
fontFamily="Arial Black"
fontSize="72"/>
</s:VGroup>
</s:Application>