Sign in to follow this  
usmanajmal

Programmatically Setting Value Of Led

Recommended Posts

How can I set the value of HLED via Actionscript?

 

HLED:

<components:FusionWidgets id="levelWidget" FCChartType="HLED" x="10" y="-20" width="510" height="100" FCDataURL="Level.xml" />

 

Level.xml:

<?xml version="1.0" encoding="UTF-8"?>
<chart chartBottomMargin="5" lowerLimit="0" upperLimit="100" lowerLimitDisplay="Low" upperLimitDisplay="High" numberSuffix="%25" showTickMarks="1" tickValueDistance="0" majorTMNumber="5" majorTMHeight="4" minorTMNumber="0" showTickValues="1" decimalPrecision="0" ledGap="1" ledSize="1" ledBoxBgColor="333333" ledBorderColor="666666" borderThickness="2" chartRightMargin="20">
<colorRange>
<color minValue="0" maxValue="30" code="00FF00"/>
<color minValue="30" maxValue="50" code="FFFF00"/>
<color minValue="50" maxValue="100" code="FF0000"/>
</colorRange>
<value>40</value>
</chart>

 

But now I want to change the value HLED by something like: levelWidget.value=100?

I don't care if I have to discard the use of Level.xml. Level.xml is not necessary for me.

Can I do this or is changing the XML is the only way out?

 

Thanks.

Share this post


Link to post
Share on other sites

Ummm. I tried passing XML from Actionscript as:

 

<components:FusionWidgets id="levelWidget" FCChartType="HLED" x="10" y="-20" width="510" height="100"/>

 

levelWidget.FCDataXML="<?xml version='1.0' encoding='UTF-8'?><chart chartBottomMargin='5' lowerLimit='0' upperLimit='100' lowerLimitDisplay='Low' upperLimitDisplay='High' numberSuffix='' showTickMarks='1' tickValueDistance='0' majorTMNumber='5' majorTMHeight='4' minorTMNumber='0' showTickValues='1' decimalPrecision='0' ledGap='1' ledSize='1' ledBoxBgColor='FFFFFF' ledBorderColor='666666' borderThickness='0' chartRightMargin='20' background='0' bgColor='FFFFFF' showBorder='0'><colorRange><color minValue='0' maxValue='30' code='00FF00'/><color minValue='30' maxValue='50' code='FFFF00'/><color minValue='50' maxValue='100' code='FF0000'/></colorRange><value>20</value></chart>"

 

But this returned "Error in loading data" error. Is there anything wrong with the XML string?

Share this post


Link to post
Share on other sites

Hi,

 

Please note that there is no need to reset the XML to change the value.

 

The code below will change the HLED widget value.

levelWidget.FCSetData(100);

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this