Study Flex《Ant编译swc中无法转换state》

一、介绍

在学习ANT打包Flex swc过程中你可能会遇到皮肤中state stroke等无法转换问题,本文向大家简单介绍一下解决方案,希望本文的介绍能让你有所收获。

二、分析原因(以state举例)
mx.states.State本在mx命名空间下,此时您写成s:State当然无法转换了(找不到)。
三、解决方法

引入组件就可。在sdk中的projects/spark/manifest.xml中有<component id="State" class="mx.states.State" lookupOnly="true"/>

1、在ant的build.xml文件里compc中加入<namespace uri="library://ns.adobe.com/flex/spark" manifest="${spark.dir}/manifest.xml"/>

2、在external-library-path中加入<include name="spark.swc"/>

四、注意manifest.xml

  <!-- Special Components -->
    <component id="State" class="mx.states.State" lookupOnly="true"/>
<component id="AddItems" class="mx.states.AddItems" lookupOnly="true"/>
    <component id="DataItem" class="spark.utils.DataItem"/>

<!-- Flex 3 Graphics -->
    <component id="BitmapFill" class="mx.graphics.BitmapFill" lookupOnly="true"/>
    <component id="BitmapFillMode" class="mx.graphics.BitmapFillMode" lookupOnly="true"/>
    <component id="CompoundTransform" class="mx.geom.CompoundTransform" lookupOnly="true"/>
    <component id="GradientEntry" class="mx.graphics.GradientEntry" lookupOnly="true"/>
    <component id="LinearGradient" class="mx.graphics.LinearGradient" lookupOnly="true"/>
    <component id="LinearGradientStroke" class="mx.graphics.LinearGradientStroke" lookupOnly="true"/>
    <component id="RadialGradient" class="mx.graphics.RadialGradient" lookupOnly="true"/>
    <component id="RadialGradientStroke" class="mx.graphics.RadialGradientStroke" lookupOnly="true"/>
    <component id="SolidColor" class="mx.graphics.SolidColor" lookupOnly="true"/>
    <component id="SolidColorStroke" class="mx.graphics.SolidColorStroke" lookupOnly="true"/>
    <component id="Stroke" class="mx.graphics.Stroke" lookupOnly="true"/>
    <component id="Transform" class="mx.geom.Transform" lookupOnly="true"/>

-----------------------------------------------------------------------



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值