Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Flex > Flex 2 & 3

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-30-2006, 09:44 AM   #1
vebazzo
Registered User
 
Join Date: May 2006
Posts: 2
Default Help with Effects conflicting with Legends

Hello, everybody! I have recently started to work with FLEX and I am having some problems with the showing of effects in barcharts when using Legends.

Basically, if I don't define a Legend for my barchart, the "SeriesSlide" Effect works properly. However, if I set the dataProvider for the Legend, the effect no longer appears.

The code is shown below. The data itself is not included, but I think that only with the script the problem will be spotted by those with more experience in Flex. I thank you all already!


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">

<mx:Script>
<![CDATA[
import com.xfactorstudio.xml.xpath.*;
import mx.charts.AxisRenderer;
import comp.*;


static var xml_doc = new XML();
var asPath:String;
function loadData(){
_global.asPath = "data.xml";
xml_doc.ignoreWhite = true;
xml_doc.onLoad = function(success){
if (success){
_root.initComponents();
_root.defineLegend();
} else {
alert("Error while loading XML document");
}
}
xml_doc.load(_global.asPath);
}

function initComponents(){

mPanel0.title = "Panel0";

var query1 = "/units/datasection/chart3/months";
var data1:Array = XPath.selectNodes(xml_doc,query1);
var dp1:Array = _root.createDataProvider(data1);
barchart1.dataProvider = dp1;
barchart1.horizontalAxis.dataProvider = dp1;
barchart1.verticalAxis.dataProvider = dp1;

barchart1.series[0].showDataEffect = "Effect1";
barchart1.series[0].hideDataEffect = "Effect2";
barchart1.series[0].name = "name";

barchart1.horizontalAxisRenderer.title = "title1";
barchart1.verticalAxisRenderer.title = "title2";
}

function defineLegend(){
legend1.dataProvider = "barchart1";
}

]]>
</mx:Script>

<mx:Effect>
<mx:SeriesSlide direction="up" duration="800" easing="" elementOffset="10" name="Effect1" />
<mx:SeriesSlide direction="down" duration="800" easing="" elementOffset="10" name="Effect2" />
<mx:SeriesSlide direction="right" duration="800" easing="" elementOffset="10" name="Effect21" />
<mx:SeriesSlide direction="left" duration="800" easing="" elementOffset="10" name="Effect22" />
<mx:SeriesInterpolate duration="1200" offset="20" name="Interpolate" />
<mxissolve alphaFrom="0" alphaTo="100" duration="800" name="BlendIn" />
<mxissolve alphaFrom="100" alphaTo="0" duration="800" name="BlendOut" />
</mx:Effect>

<mx:Panel id="mPanel0" styleName="panel" backgroundColor="#FFF9FF" height="100%" width="100%">
<mx:HBox styleName="layoutMargin" height="100%" width="100%">
<mx:BarChart id="barchart1" height="100%" width="100%" showDataTips="true">
<mx:verticalAxisRenderer>
<mx:AxisRenderer styleName="axis" />
</mx:verticalAxisRenderer>
<mx:horizontalAxisRenderer>
<mx:AxisRenderer />
</mx:horizontalAxisRenderer>
<mx:horizontalAxis>
<mx:LinearAxis minimum="0.465" interval="0.001" maximum="0.467"/>
</mx:horizontalAxis>
<mx:verticalAxis>
<mx:CategoryAxis categoryField="month"/>
</mx:verticalAxis>
<mx:series>
<mx:Array>
<mx:BarSeries xField="loans"/>
</mx:Array>
</mx:series>
</mx:BarChart>
<mx:Legend id="legend1"/>
</mx:HBox>
</mx:Panel>
</mx:Application>
vebazzo is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sound Effects jimmyhay Other Flash General Questions 2 12-16-2005 01:08 AM
questions about some effects Marcel Animation and Effects 11 12-09-2004 03:53 PM
"PJ" and "Supreme 4" Components, flash text effects. patrickjv Components 1 04-29-2004 07:31 PM
After Effects & Flash? tenoch Animation and Effects 47 02-12-2004 10:43 AM
Effects grimm Animation and Effects 4 08-13-2002 09:47 PM


All times are GMT. The time now is 07:43 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.