4,328
社区成员
发帖
与我相关
我的任务
分享
Could not resolve <ibm:CircularLinearGauge> to a component implementation. gaugex.mxml
Could not resolve <ibm:VLinearGauge> to a component implementation. gaugex.mxml
<?xml version="1.0" encoding="utf-8"?>
<!--
///////////////////////////////////////////////////////////////////////////////
// Licensed Materials - Property of IBM
// 5724-Y31,5724-Z78
// © Copyright IBM Corporation 2007, 2011. All Rights Reserved.
//
// Note to U.S. Government Users Restricted Rights:
// Use, duplication or disclosure restricted by GSA ADP Schedule
// Contract with IBM Corp.
///////////////////////////////////////////////////////////////////////////////
-->
<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"
xmlns:ibm="http://www.ibm.com/xmlns/prod/ilog/elixir/2010" xmlns:local="*"
viewSourceURL="srcview/index.html"
creationComplete="init()">
<fx:Declarations>
<s:GlowFilter id="glow" color="0xFFFFFF" alpha="0.4" blurX="10"
blurY="10" quality="2" strength="2"/>
<s:Animate id="animate1" target="{carGauge}" duration="5000"
effectEnd="restartAnimate(animate1, 7)">
<s:motionPaths>
<s:SimpleMotionPath property="value1" valueFrom="0" valueTo="4"/>
</s:motionPaths>
</s:Animate>
<s:Animate id="animate2" target="{circularLinearGauge}" duration="5000"
effectEnd="restartAnimate(animate2, 100)">
<s:motionPaths>
<s:SimpleMotionPath property="value" valueFrom="0" valueTo="4"/>
</s:motionPaths>
</s:Animate>
<s:Animate id="animate3" target="{verticalLinearGauge}" duration="5000"
effectEnd="restartAnimate(animate3, 100)">
<s:motionPaths>
<s:SimpleMotionPath property="value" valueFrom="0" valueTo="4"/>
</s:motionPaths>
</s:Animate>
<s:Animate id="animate4" target="{carGauge}" duration="5000"
effectEnd="restartAnimate(animate4, 100)">
<s:motionPaths>
<s:SimpleMotionPath property="value2"/>
</s:motionPaths>
</s:Animate>
</fx:Declarations>
<fx:Script>
<![CDATA[
import spark.effects.easing.Bounce;
import spark.effects.easing.Elastic;
import spark.effects.easing.Linear;
import spark.effects.easing.Power;
import spark.effects.easing.Sine;
private var easers:Array = [new Elastic(), new Bounce(), new Linear(), new Power(), new Sine()];
import spark.filters.GlowFilter;
private function init():void
{
restartAnimate(animate1, 7);
restartAnimate(animate2, 100);
restartAnimate(animate3, 100);
restartAnimate(animate4, 100);
}
private function restartAnimate(anim:Animate, max:Number):void
{
var mp:SimpleMotionPath = anim.motionPaths[0] as SimpleMotionPath;
anim.easer = easers[int(Math.random() * (easers.length-1))];
mp.valueFrom = anim.target[mp.property];
mp.valueTo = Math.random() * max;
anim.startDelay = Math.random() * 15000;
anim.duration = 5000 + Math.random() * 5000;
anim.play();
}
private function truncateNumber(o:Object):String
{
return Number(o).toFixed(2);
}
]]>
</fx:Script>
<s:Rect width="100%" height="100%">
<s:fill>
<s:LinearGradient rotation="90">
<s:entries>
<s:GradientEntry color="0x000000"/>
<s:GradientEntry color="0x323232"/>
</s:entries>
</s:LinearGradient>
</s:fill>
</s:Rect>
<s:HGroup width="100%" height="100%" paddingBottom="10"
paddingLeft="10" paddingRight="10" paddingTop="10"
gap="10">
<ibm:CircularLinearGauge id="circularLinearGauge" width="100%" height="100%" filters="{[glow]}"
trackMinimum="60" trackMaximum="100"
slideDuration="0"
liveDragging="false"
labelFormatFunction="truncateNumber"/>
<local:CarGauge id="carGauge" width="100%" height="100%"
skinClass="CarGaugeSkin"
title="@Resource(key='rpm', bundle='blackgauges')"/>
<ibm:VLinearGauge id="verticalLinearGauge" height="100%"
trackMinimum="0" trackMaximum="100"
filters="{[glow]}"
slideDuration="0"
majorTickInterval="20" minorTickInterval="10"
orientation="btt"
labelFormatFunction="truncateNumber"/>
</s:HGroup>
</s:Application>