[flexcoders] Filter Function

2010-06-18 Thread AJC2357
Message-ID: hvghmp+5...@egroups.com
User-Agent: eGroups-EW/0.82
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Mailer: Yahoo Groups Message Poster
X-Yahoo-Post-IP: 65.220.14.229
X-Yahoo-Newman-Property: groups-compose
Sender: not...@yahoogroups.com
X-Yahoo-GPoster: aodetby1efmysj42354a

Hi guys,

I want to filter an arraycollection using a combobox to return data for sev=
eral countries.  But I only want values shown if they are greater than 9.  =
Any ideas why the following code wouldn't work?


private function filter(item:Object): Boolean {
var s:String =3D cb1.selectedItem.valueOf();
return item.s  9;
}

private function startFilter(): void {
myAC.filterFunction =3D filter;
myAC.refresh();
sortThis();
}


If I type in 'return item.Brazil  9;' it works.  But if I select Brazil in=
 the combobox it does not... even though I can pass the variable s to a lab=
el, which returns 'Brazil' properly.  Seems like 's' variable is fine, but =
the item.s framework is flawed.

Any help much appreciated.  Thanks

Alex



[flexcoders] Re: Filter Function

2010-06-18 Thread AJC2357


Not sure strange characters of code were added to previous post.  This should 
be clean. 
 
 private function filter(item:Object): Boolean {
var s:String = cb1.selectedItem.valueOf();
return item.s  9;
 }

 private function startFilter(): void {
myAC.filterFunction = filter;
myAC.refresh();
 }





[flexcoders] Re: Filter Function

2010-06-18 Thread AJC2357
And nevermind. I got it.

return item[s]!

--- In flexcoders@yahoogroups.com, AJC2357 ajc2...@... wrote:

 
 
 Not sure strange characters of code were added to previous post.  This should 
 be clean. 
  
  private function filter(item:Object): Boolean {
   var s:String = cb1.selectedItem.valueOf();
   return item.s  9;
  }
   
  private function startFilter(): void {
   myAC.filterFunction = filter;
   myAC.refresh();
  }





[flexcoders] Actionscript sum function

2009-12-18 Thread AJC2357
Is there really no way to sum a simple array w/o adding element by element?

var myArray:Array = [1,2,3,4,5];

I've found min and max functions, but nothing to sum...

Any tips appreciated!





[flexcoders] Simplfying Repetitive Code

2009-12-16 Thread AJC2357
Hi all, 

If I have a function like this.

private function changeSeries(): void {
series1.yField = 'male';
series2.yField = 'male';
series3.yField = 'male';
series4.yField = 'male';
series5.yField = 'male';
series6.yField = 'male';
series7.yField = 'male';
series8.yField = 'male';
series9.yField = 'male';
series10.yField = 'male';
}

Is there an easy way to simplify it?  Something like

private function changeSeries(): void {
something to indicate i equaling zero through ten
series[i] = 'male';
}

Any code help would be much appreciated!

Alex



[flexcoders] Re: Simplfying Repetitive Code

2009-12-16 Thread AJC2357
Thanks so much, Tibor.

This structure - this[series+i] - was what I needed!

--- In flexcoders@yahoogroups.com, Tibor ballai.t...@... wrote:

 Hi Alex,
 
 You can use a for loop.
 
 for (var i:uint=1; i=10; i++){
   this[series+i].yField = 'male';
 }
 
 Hope this helps,
 
 Tibor.
 
 www.tiborballai.com
 
 --- In flexcoders@yahoogroups.com, AJC2357 ajc2357@ wrote:
 
  Hi all, 
  
  If I have a function like this.
  
  private function changeSeries(): void {
  series1.yField = 'male';
  series2.yField = 'male';
  series3.yField = 'male';
  series4.yField = 'male';
  series5.yField = 'male';
  series6.yField = 'male';
  series7.yField = 'male';
  series8.yField = 'male';
  series9.yField = 'male';
  series10.yField = 'male';
  }
  
  Is there an easy way to simplify it?  Something like
  
  private function changeSeries(): void {
  something to indicate i equaling zero through ten
  series[i] = 'male';
  }
  
  Any code help would be much appreciated!
  
  Alex
 





[flexcoders] e4x Filtering Success

2009-09-23 Thread AJC2357
(partially...)

I was able to filter through e4x via mx:XML and the dataProvider as follows...

mx:XML id=data source=sep.xml format=e4x/
mx:PieChart width=100% height=100% dataProvider={data.Location.(region == 
'Asia' )}

How can I add an additional filter argument from here?  Using the  technique 
gave me error that entity name must immediately follow 

I want to filter something like: region = Asia AND GDP/capita = 1  

Thanks!



[flexcoders] Re: Declaring New Variable from XML Source

2009-09-20 Thread AJC2357
Thanks - new issue.  Getting error 1131: Classes must not be nested The var 
testInfo loads fine. But when I try to filter down - using private var 
jane:XMLList = testData.(country == India); - I get nothing.  I've played 
around with argument order but with no success.

Any ideas?  

// Structure of XML file APAC.xml //
data
Location
regrank6/regrank
countryChina/country
regionAsia/region
reg08184/reg08
reg09584/reg09
regp2.8/regp
regn200/regn
ex08767/ex08
ex09100/ex09
exp3.9/exp
exn263/exn
/Location
 /data

// My MXML File //
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical 
creationComplete=testData.send()

mx:HTTPService url=assets/APAC.xml id=testData result=xmlHandler(event) 
resultFormat=e4x/


mx:Script
![CDATA[

[Bindable] public var testInfo:XMLList;

private var jane:XMLList = testData.(country == India);   


--- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote:

 Use an e4x expression.  They all return XMLList, so watch for that if you
 need to assign a result to an XML var.  If you are sure there is only one
 node in the result, do var xmlResult:XML = xmllistResult[0];
 
  
 
 See the documentation for e4x syntax and usage, post back here if you have a
 specific question or problem.
 
  
 
 Tracy Spratt,
 
 Lariat Services, development services available
 
   _  
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of AJC2357
 Sent: Thursday, September 17, 2009 11:28 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Declaring New Variable from XML Source
 
  
 
   
 
 Hello, 
 
 I have a large XML file that I use with Flex to graphically display specific
 data. For example, it is easy to create a graph that shows GDP by country.
 (which creates a graph for all countries in XML file)
 
 But how can narrow or filter these searches? 
 
 I want to have the graph show only the countries that are in region x for
 instance. Can anyone show me how to create a new variable that is derived
 from a subset of the XML file? 
 
 I am new to actionscript but the logic would seem to be: create new variable
 from XML source based on a given criteria (i.e., region == Asia)
 
 Any help?





[flexcoders] Declaring New Variable from XML Source

2009-09-17 Thread AJC2357
Hello, 

I have a large XML file that I use with Flex to graphically display specific 
data.  For example, it is easy to create a graph that shows GDP by country. 
(which creates a graph for all countries in XML file)

But how can narrow or filter these searches? 

I want to have the graph show only the countries that are in region x for 
instance. Can anyone show me how to create a new variable that is derived from 
a subset of the XML file?  

I am new to actionscript but the logic would seem to be:  create new variable 
from XML source based on a given criteria (i.e., region == Asia)

Any help?



[flexcoders] Sorting XML number values in datagrid

2009-09-10 Thread AJC2357
Hi all, 

Looking for a simple solution to properly sorting number values in a datagrid.

I'm sure many of you have run across this limitation.  Trying to sort something 
like {1,5,100) turns into (1,100,5) because it is read a string and not numeric.

Suggestions?  Thanks, 

Alex



[flexcoders] Re: Adding Percent to the label field on the left

2009-08-30 Thread AJC2357
This is from a few years ago and seems simple enough.  Any solutions?

I'm dealing with the same issue - trying to display percentage data and 
including the % sign.

Thanks!

--- In flexcoders@yahoogroups.com, patricklemiuex patrick_f...@... wrote:

 I created a column chart and I want to add a percent sign to each of
 the values on the verticalAxis.  How do I do this?
 
 Thanks,
 Patrick





[flexcoders] Re: Password Protection in Flex

2009-08-27 Thread AJC2357
Does not need to be that secure.  Will be sending a randomized link (ex: 
www.example.com/FSDF3453459324_234hn) directly to client.  

I don't even have to deal with usernames, just one password that would make the 
dashboard functional.  

I will check out your website.  Thanks for your time.

Alex

--- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote:

 Certainly, but it is a very complex subject with many solutions.  Few of
 them are implemented in Flex alone.  How secure is secure?  Where and how do
 you want to maintain your list of user/passwords?  Do you need to hash them
 or will you send them in clear text?  Do you need to use https?
 
  
 
 I have a simple log-in example on cflex.net, but it is not suitable for
 sensitive data.
 
  
 
 Tracy Spratt,
 
 Lariat Services, development services available
 
   _  
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of AJC2357
 Sent: Wednesday, August 26, 2009 3:46 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Password Protection in Flex
 
  
 
   
 
 Hello, 
 
 I am new to flex but am immensely enjoying the charting/dashboard
 capabilities. 
 
 As I begin to put sensitive data together for certain clients, I am
 wondering if there is a way to password protect the swf output.
 
 For instance, I would like to send a link to a client with their requested
 business-intell dashboard. When he/she opens this link, I want the first
 screen of the swf file to ask for a password. Once the password it entered
 correctly, the dashboard becomes functional.
 
 Any code suggestions or links to relevant examples? Thanks in advance,
 
 Alex





[flexcoders] Password Protection in Flex

2009-08-26 Thread AJC2357
Hello, 

I am new to flex but am immensely enjoying the charting/dashboard capabilities. 
 

As I begin to put sensitive data together for certain clients, I am wondering 
if there is a way to password protect the swf output.

For instance, I would like to send a link to a client with their requested 
business-intell dashboard.  When he/she opens this link, I want the first 
screen of the swf file to ask for a password.  Once the password it entered 
correctly, the dashboard becomes functional.

Any code suggestions or links to relevant examples? Thanks in advance,

Alex