Re: [flexcoders] Re: What's wrong in using itemRenderer ?

2010-08-17 Thread Rishi Sahi
Hi Amy,

Thanks..

One more question , Is there any different rule to add itemrender on
categorized grids ? For example, Here is my sample code to for Hazard and
Status column ,

var col1:AdvancedDataGridColumn = new AdvancedDataGridColumn();
var col2:AdvancedDataGridColumn = new
AdvancedDataGridColumn();
//data for column 1
col1.headerText="Hazard"
col1.dataField = "hazard";
col1.itemRenderer = new RenderCategory();
cols.push(col1);
//data for column 2
   col2.headerText="Status"
col2.dataField = "status";
col2.itemRenderer = new RenderCategory();
cols.push(col2);

But when I view my grid , It only applies to Status column ,

[image: 1.PNG]

But if I remove grouping , rendering applies to both the columns . However,
Hazard is not a grouping field, There is another grouping field "category" .

Rishi


On Wed, Aug 18, 2010 at 10:38 AM, Amy  wrote:

>
>
> An XML node can never be equal to a string.
>
>
> --- In flexcoders@yahoogroups.com ,
> RishiShahi  wrote:
> >
> >
> > I'm trying to add itemRenderer like, but it doesn't work. However if I
> remove
> > the check it's adding the itemRenderer.
> >
> > for each (var column:XML in columns)
> > {
> > var col:AdvancedDataGridColumn = new AdvancedDataGridColumn(column);
> > col.headertext=colu...@label;
> >
> > if(column=="status") {
> > col.itemRenderer = new ClassFactory(RenderCategory);
> > }
> >
> > col.width=Number(colu...@width);
> > cols.push(col);
> > }
> > --
> > View this message in context:
> http://old.nabble.com/What%27s-wrong-in-using-itemRenderer---tp29449236p29449236.html
> > Sent from the FlexCoders mailing list archive at Nabble.com.
> >
>
>  
>
<<1.PNG>>

[flexcoders] Re: Null object error on test for null

2010-08-17 Thread Sunil D
Which line does the null pointer error occur on? 

Not that this is you problem, but I always check for null when casting with 
'as'. 

Sunil

--- In flexcoders@yahoogroups.com, Tom McNeer  wrote:
>
> In the function below, I begin by testing to see if a particular object is
> null (the array of ComboBoxes that represent the children of a Repeater,
> which may or may not exist). The element is defined in MXML, though of
> course it may be null.
> 
> But if it *is *null, a null object reference error is thrown. Could someone
> please explain this for me? (SDK 3.5, by the way).
> 
> public function handleFilterChange():void{
> if(filterCombo!=null){
> for(var i:int=0;i for(var j:int=0;j var cb:ComboBox = filterCombo[i][j] as
> ComboBox;
> cb.selectedItem=null;
> }
> }
> }
> }
> 
> -- 
> Thanks,
> 
> Tom
> 
> Tom McNeer
> MediumCool
> http://www.mediumcool.com
> 1735 Johnson Road NE
> Atlanta, GA 30306
> 404.589.0560
>




[flexcoders] Re: What's wrong in using itemRenderer ?

2010-08-17 Thread Amy
An XML node can never be equal to a string.

--- In flexcoders@yahoogroups.com, RishiShahi  wrote:
>
> 
> I'm trying to add itemRenderer like, but it doesn't work. However if I remove
> the check it's adding the itemRenderer. 
> 
> for each (var column:XML in columns)
> {
> var col:AdvancedDataGridColumn = new AdvancedDataGridColumn(column); 
> col.headertext=colu...@label;
> 
>  if(column=="status") {
> col.itemRenderer = new ClassFactory(RenderCategory);
>  }
>   
>col.width=Number(colu...@width);   
>cols.push(col);
>   }
> -- 
> View this message in context: 
> http://old.nabble.com/What%27s-wrong-in-using-itemRenderer---tp29449236p29449236.html
> Sent from the FlexCoders mailing list archive at Nabble.com.
>




Re: [flexcoders] How to get the width of the Itemrenderer in a List

2010-08-17 Thread dorkie dork from dorktown
Spark. If the item renderer item is outside of the Lists visible area then
it returns width or height 0 or sometimes index out of bounds errors. It
seems items aren't created if they haven't been scrolled into view yet and
if they have but they aren't in view currently then I think it's returning
width and height as 0. I've made sure to set useVirtualLayout false.



I don't have the columnWidth or list height set but I have the ItemRenderer
width and height set to 32.

On Tue, Aug 17, 2010 at 8:05 PM, Alex Harui  wrote:

>
>
> Spark or MX List.  Did you confuse width for height?
>
>
>
> On 8/17/10 2:30 PM, "dorkiedorkfromdorkt...@gmail.com" <
> dorkiedorkfromdorkt...@gmail.com> wrote:
>
>
>
>
>
>
> How would I get the width of an item renderer in a list?
>
> I'm trying to fit the width of a list so that it doesn't clip an item
> renderer half way thru if there's not enough space. So if the List is 105 px
> wide and an single itemrenderer is 10 pixels wide then I want to resize the
> list to 100 pixels so item 11 doesn't show.
>
>
>
>
>
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>
>  
>


[flexcoders] 360Flex DC is coming up soon! Don't miss it!

2010-08-17 Thread John Wilker
Hey Flexcoders list!

I just wanted to pop in and make sure everyone knew that 360|Flex was coming
up fast in Washington DC. September 19-22

The full session details have been posted as a PDF here.
http://360flex.com/downloads/sessions.pdf

and you can check out the schedule here:
http://360flex.com/downloads/schedule.pdf

This past spring in San Jose we had close to 400 attendees, we're hoping to
meet or better yet, BEAT that number in DC! It's gonna be a great time, with
content that will blow you mind. There's several on this list that can back
me up on that :)

At any rate, hope you all can make it, here's a special discount just for
Flexcoders members! "flexcodersrocks" saves you 10% off the $699
registration price.

By the way, $699 is for 4 days of content. 40+ sessions, from over 30
speakers, many from this list even! Check out the line up.

See you in DC!

John Wilker
Co-Founder, 360|Conferences
twitter: jwilker 
johnwilker.com | Ignite Denver |
Denwhere|
360|Flex  | 360|iDev 

“A goal is not always meant to be reached, it often serves simply as
something to aim at.”
~ Bruce Lee


Re: [flexcoders] How to get the width of the Itemrenderer in a List

2010-08-17 Thread Alex Harui
Spark or MX List.  Did you confuse width for height?


On 8/17/10 2:30 PM, "dorkiedorkfromdorkt...@gmail.com" 
 wrote:






How would I get the width of an item renderer in a list?

I'm trying to fit the width of a list so that it doesn't clip an item renderer 
half way thru if there's not enough space. So if the List is 105 px wide and an 
single itemrenderer is 10 pixels wide then I want to resize the list to 100 
pixels so item 11 doesn't show.





--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] HTTPService not updating...

2010-08-17 Thread dorkie dork from dorktown
it's prob accessing it from the cache.

instead of this,
url="reports/xml/{_reportInfo.fileName}.xml"

use this:
url="reports/xml/{_reportInfo.fileName}.xml?time={getTimer()}"

that snippet might not be bindable so add the time in code whenever you
access that file

On Tue, Aug 17, 2010 at 6:17 PM, Laurence  wrote:

>
>
> Ok. I have the following HTTP Service declared:
>  url="reports/xml/{_reportInfo.fileName}.xml"
> result="rdHandler(event);"
> fault="rpcFaultHandler(event);"/>
>
> In the init() function (which is called when the 'show' event happens,
> because the page it's on happens to be part of a ViewStack) I have the
> following line:
> reportDataRPC.send();
>
> This loads the data from the .xml file and in the "rdHandler" function lets
> me put that data into my various ArrayCollections and whatnot... That's
> working fine... At least, the FIRST time...
>
> Every subsequent time, the result-set is exactly the same as the first time
> -- even if the .xml file it's reading has changed in the interim.
>
> If I completely shut-down the program and re-load it, then I finally get
> the new .xml file in there.
>
> So, how do I get it to give me a complete refresh of the data? I've tried
> calling 'reportDataRPC.clearResult()' and 'reportDataRPC.disconnect()' after
> storing the data in my ArrayCollections, but that didn't seem to do anything
> at all...
>
> I'm at a complete loss -- it's totally unacceptable to not be able to get
> the new data when the underlying .xml file changes. Can someone point me in
> the right direction?
>
> Thanks,
> Laurence MacNeill
> Mableton, Georgia, USA
>
>  
>


Re: [flexcoders] HTTPService not updating...

2010-08-17 Thread Jake Churchill
It might be getting cached.  Try adding a timestamp to the end of the url 
(ie url/myfile.xml?timestamp={currentTimeStamp} ).

Before you all the .send() method, reset the timestamp variable to the current 
time.  

-Jake



-- Sent from my Palm Pre
On Aug 17, 2010 6:23 PM, Laurence  wrote: 


 



  



  
  
  
Ok.  I have the following HTTP Service declared:





In the init() function (which is called when the 'show' event happens, because 
the page it's on happens to be part of a ViewStack) I have the following line:

reportDataRPC.send();



This loads the data from the .xml file and in the "rdHandler" function lets me 
put that data into my various ArrayCollections and whatnot...  That's working 
fine...  At least, the FIRST time...



Every subsequent time, the result-set is exactly the same as the first time -- 
even if the .xml file it's reading has changed in the interim.



If I completely shut-down the program and re-load it, then I finally get the 
new .xml file in there.



So, how do I get it to give me a complete refresh of the data?  I've tried 
calling 'reportDataRPC.clearResult()' and 'reportDataRPC.disconnect()' after 
storing the data in my ArrayCollections, but that didn't seem to do anything at 
all...



I'm at a complete loss -- it's totally unacceptable to not be able to get the 
new data when the underlying .xml file changes.  Can someone point me in the 
right direction?



Thanks,

Laurence MacNeill

Mableton, Georgia, USA






 









  
  
  









[flexcoders] HTTPService not updating...

2010-08-17 Thread Laurence
Ok.  I have the following HTTP Service declared:


In the init() function (which is called when the 'show' event happens, because 
the page it's on happens to be part of a ViewStack) I have the following line:
reportDataRPC.send();

This loads the data from the .xml file and in the "rdHandler" function lets me 
put that data into my various ArrayCollections and whatnot...  That's working 
fine...  At least, the FIRST time...

Every subsequent time, the result-set is exactly the same as the first time -- 
even if the .xml file it's reading has changed in the interim.

If I completely shut-down the program and re-load it, then I finally get the 
new .xml file in there.

So, how do I get it to give me a complete refresh of the data?  I've tried 
calling 'reportDataRPC.clearResult()' and 'reportDataRPC.disconnect()' after 
storing the data in my ArrayCollections, but that didn't seem to do anything at 
all...

I'm at a complete loss -- it's totally unacceptable to not be able to get the 
new data when the underlying .xml file changes.  Can someone point me in the 
right direction?

Thanks,
Laurence MacNeill
Mableton, Georgia, USA




[flexcoders] how to disable the rest of application when one combo box is open

2010-08-17 Thread coder3

Hi 

I have a combo box, if it's open, user needs to make a selection to close
it. so, if nothing is selected, the combo box will keep opening. 

my question is, when the combo box is open, i want to disable the rest of
the application, how do i do it?

thanks
C
-- 
View this message in context: 
http://old.nabble.com/how-to-disable-the-rest-of-application-when-one-combo-box-is-open-tp29449306p29449306.html
Sent from the FlexCoders mailing list archive at Nabble.com.



[flexcoders] Drag and Drop toolbox

2010-08-17 Thread juvemihaido
Well, in the toolbox the are labels for the components.I want to drag 
the label and drop the component.After that i want to double click the 
component to show an alert.

The Application:


http://ns.adobe.com/mxml/2009";
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
xmlns:components="components.*">
























and the Tool component:


http://ns.adobe.com/mxml/2009";
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100" height="100">





























It drops only the labels and the double click doesn't work.
any ideas?
Thank You





[flexcoders] Insert Image in Rich Text Editor

2010-08-17 Thread mailstosrini
Hi,

I want to insert an image in to rich text editor. After complete the image 
insertion i need to update in the database.

Please do the needful for my requirement

Thanks in advance

Regards
Srini



Re: [flexcoders] Why can't I change the highlight color of Spark text?

2010-08-17 Thread Jeff Gomes

Assuming you want to set it for all text areas, you could experiment 
with the global styles selectionColor and focusedTextSelectionColor.

-Jeff

At 02:14 8/17/2010, dorkie dork from dorktown wrote:


>I've spent soo much time trying to find how to do this.
>
>I'm using, sparkTextArea.selectAll() to select text but I've found 
>no way to change the highlight color.
>
>JP



Re: [flexcoders] Re: Method for a Datagrid Button Itemrenderer

2010-08-17 Thread Wesley Acheson
sorry that should have been owner.dispatchEvent()


[flexcoders] How to get the width of the Itemrenderer in a List

2010-08-17 Thread dorkie dork from dorktown
How would I get the width of an item renderer in a list?

I'm trying to fit the width of a list so that it doesn't clip an item
renderer half way thru if there's not enough space. So if the List is 105 px
wide and an single itemrenderer is 10 pixels wide then I want to resize the
list to 100 pixels so item 11 doesn't show.


Re: [flexcoders] Why can't I change the highlight color of Spark text?

2010-08-17 Thread dorkie dork from dorktown
Thanks. It was working all along. I was using textarea.selectRange(). Since
I was pressing a button to select the text the textarea was always
"unfocused" so I wasn't seeing the effect of that style. I
added unfocusedTextSelectionColor as well.

On Tue, Aug 17, 2010 at 12:07 PM, Alex Harui  wrote:

>
>
> focusedTextSelectionColor?
>
>
>
> On 8/17/10 2:14 AM, "dorkiedorkfromdorkt...@gmail.com" <
> dorkiedorkfromdorkt...@gmail.com> wrote:
>
>
>
>
>
>
> I've spent soo much time trying to find how to do this.
>
> I'm using, sparkTextArea.selectAll() to select text but I've found no way
> to change the highlight color.
>
> JP
>
>
>
>
>
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>
>  
>


[flexcoders] Possible to filter data by Type for LineChart series?

2010-08-17 Thread eb
All of the data examples I see for Flex charting are simply string months and 
number attributes, but that doesn't mesh with normal query results. Let's say 
this is my dataset from a query (returns all my withdrawals for the month). 

//my data
var expensesAC:ArrayCollection = new ArrayCollection( [
 { date: "1/12/10", type: 'checking', Amount: 450 },
 { date: "1/13/10", type: 'savings', Amount: 600 },
 { date: "1/15/10", type: 'checking', Amount: 300 },
 { date: "1/19/10", type: 'savings', Amount: 900 },
 { date: "1/20/10", type: 'checking', Amount: 500 } ]);

I'd like to have a 2-line chart...1 line for checking and 1 line for savings, 
but no lines appear. I tried implementing a dataFunction and debugging shows 
it's returns values at the correct type, but that doesn't work (no lines 
appear). Any ideas?
  
Here's the full mxml...if you remove the dataFunction attribute from the 2 
LineSeries, then the map (as expected) draws both lines on top of each other. 
Thanks in advance.



http://www.adobe.com/2006/mxml";>
   
  









 

 







 






Re: [flexcoders] Handling XML

2010-08-17 Thread Alex Harui

There is no “eval” in actionscript.  To pass XMLLIst a string it would have to 
be a string that can be converted to XML, not something that references 
variables.

On 8/17/10 1:40 PM, "Stephen"  wrote:






var xml:XML =



Once Upon A Time



;

var path1:XMLList = xml.shelf.book.chapter;
trace("path1: " + path1.text()); // output: "path1: Once Upon A Time"

var string:String = "xml.shelf.book.chapter";
var path2:XMLList = XMLList("xml.shelf.book.chapter");
trace("path2: " + path2.text()); // output: "path1:"

Why do I get no output with the second trace, it looks like
the XMLList() dosn't work, any tips would be great.

- Criptopus






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


[flexcoders] Handling XML

2010-08-17 Thread Stephen
var xml:XML = 



Once Upon A Time



;

var path1:XMLList = xml.shelf.book.chapter;
trace("path1: " + path1.text()); // output: "path1: Once Upon A Time"

var string:String = "xml.shelf.book.chapter";
var path2:XMLList = XMLList("xml.shelf.book.chapter");
trace("path2: " + path2.text()); // output: "path1:"

Why do I get no output with the second trace, it looks like
the XMLList() dosn't work, any tips would be great.

- Criptopus



Re: [flexcoders] Re: Method for a Datagrid Button Itemrenderer

2010-08-17 Thread Wesley Acheson
>
> in my datagrid, i have declared
> creationComplete="myDataGrid_CreationComplete()"
>
> In my itemrenderer, I have placed a code :
>
> override protected function clickHandler(event:MouseEvent) :void
> {
>   dispatchEvent(new Event('myTest', true));
> }
>
>
try


override protected function clickHandler(event:MouseEvent) :void
{
  parent.dispatchEvent(new Event('myTest', true));
}


see:
http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html

for some info


[flexcoders] Re: Method for a Datagrid Button Itemrenderer

2010-08-17 Thread turbo_vb
Not that I know of.  You could avoid all of this by just listening for the 
DataGrid's itemClick event. (mx.events.ListEvent)  In the result handler you 
could check if ( event.itemRenderer is btnRenderer ) { do your thing }

-TH

--- In flexcoders@yahoogroups.com, Angelo Anolin  wrote:
>
> 
> 
> Would it be possible to simply add it to the MXML file where I am declaring 
> the 
> datagrid, instead of subclassing it?
> 
> Thanks.
> 
> 
> 
> From: turbo_vb 
> To: flexcoders@yahoogroups.com
> Sent: Tue, 17 August, 2010 8:30:29
> Subject: [flexcoders] Re: Method for a Datagrid Button Itemrenderer
> 
>   
> Hi Angelo,
> 
> You're close.  You'll need to declare the event in the DataGrid.  A simple 
> subclass should do the trick.  This way you can add the event listener in 
> mxml 
> too:
> 
> package myPackage
> {
> import mx.controls.DataGrid;
> 
> [Event( name="myTest", type="flash.events.Event")]
> 
> public class MyDataGrid extends DataGrid
> {
> 
> }
> }
> 
> -TH--- In flexcoders@yahoogroups.com, Angelo Anolin  wrote:
> >
> > I have written the following scripts, and yet this does not seem to work.
> > 
> > in my MXML file (main)
> > 
> > private function myDataGrid_CreationComplete() :void
> > {
> >   myDataGrid.addEventListener('myTest', myTesting);
> > }
> > 
> > private function myTesting() :void
> > {
> >   Alert.show('This event should have been called!');
> > }
> > 
> > 
> > in my datagrid, i have declared
> > creationComplete="myDataGrid_CreationComplete()"
> > 
> > In my itemrenderer, I have placed a code :
> > 
> > override protected function clickHandler(event:MouseEvent) :void
> > {
> >   dispatchEvent(new Event('myTest', true));
> > }
> > 
> > For some reason, this does not seem to work. From what I have read mostly, 
> > this 
> >
> > should be able to do the trick.
> > 
> > Any input and ideas appreciated. Thanks..
> > 
> > 
> > 
> > 
> > From: Angelo Anolin angelo_anolin@
> > To: flexcoders@yahoogroups.com
> > Sent: Tue, 17 August, 2010 8:34:07
> > Subject: Re: [flexcoders] Re: Method for a Datagrid Button Itemrenderer
> > 
> > 
> > Hi Don,
> > 
> > Thanks for the reply.
> > 
> > I do am able to do the same using an in-line itemrenderer.
> > 
> > But right now, my itemrenderer is an external AS file.
> > 
> > So I declare my MXML like:
> > 
> >  > id="dgActionColumn" width="100" visible="true" 
> >itemRenderer="myButtonItemRenderer"
> >  />
> > 
> > Where myButtonItemRenderer is an external AS file which extends the button.
> > 
> > Now, where I declare the datagrid, I am writing a function which I need to 
> > wire 
> >
> > up to the itemrenderer so that on the click of the button, that method is 
> > dispatched.
> > 
> > Thanks.
> > 
> > 
> > 
> > 
> > 
> > 
> > From: fusionpage fusionpage@
> > To: flexcoders@yahoogroups.com
> > Sent: Tue, 17 August, 2010 8:29:11
> > Subject: [flexcoders] Re: Method for a Datagrid Button Itemrenderer
> > 
> > 
> > I typically use code like this to call a method in the parent MXML page 
> > that 
> > contains the dataGrid...
> > 
> >  > dataField="contentURL">
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > Don
> > 
> > --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_anolin@ wrote:
> > >
> > > I know someone has encountered this before. 
> > > 
> > > Better to rephrase this one I guess.
> > > 
> > > I have an MXML file, where I have a method.  In that MXML file, I have a 
> > > datagrid, where one of the columns, I created an external itemrenderer.  
> > > The 
> 
> > > itemrenderer is a button.  When I click that button, I want that button 
> > > to 
> >call 
> >
> > >
> > > the method in the MXML file (so that I could re-use the button on other 
> > > datagrids). 
> > > 
> > > Thanks.
> > > 
> > > 
> > > 
> > > 
> > > From: Angelo Anolin angelo_anolin@
> > > To: flexcoders@yahoogroups.com
> > > Sent: Mon, 16 August, 2010 13:54:33
> > > Subject: [flexcoders] Method for a Datagrid Button Itemrenderer
> > > 
> > > 
> > > Hi Flexcoders,
> > > 
> > > I have a datagrid and an button itemrenderer named btnRenderer.as
> > > 
> > > I have set this button as an itemRenderer in one of my datagrid columns.
> > > 
> > >  > > itemRenderer="btnRenderer" 
> />
> > > 
> > > I need to respond to an click event on button, passing some of the value 
> > > from 
> >
> > > the dataProvider attached to the datagrid.
> > > 
> > > Should I place my codes on the mxml file where my datagrid is declared?  
> > > How 
> 
> > > would the btnRenderer know that the method is called?
> > > 
> > > Thanks.
> > >
> >
>




[flexcoders] Null object error on test for null

2010-08-17 Thread Tom McNeer
In the function below, I begin by testing to see if a particular object is
null (the array of ComboBoxes that represent the children of a Repeater,
which may or may not exist). The element is defined in MXML, though of
course it may be null.

But if it *is *null, a null object reference error is thrown. Could someone
please explain this for me? (SDK 3.5, by the way).

public function handleFilterChange():void{
if(filterCombo!=null){
for(var i:int=0;ihttp://www.mediumcool.com
1735 Johnson Road NE
Atlanta, GA 30306
404.589.0560


Re: [flexcoders] Re: Method for a Datagrid Button Itemrenderer

2010-08-17 Thread Angelo Anolin


Would it be possible to simply add it to the MXML file where I am declaring the 
datagrid, instead of subclassing it?

Thanks.



From: turbo_vb 
To: flexcoders@yahoogroups.com
Sent: Tue, 17 August, 2010 8:30:29
Subject: [flexcoders] Re: Method for a Datagrid Button Itemrenderer

  
Hi Angelo,

You're close.  You'll need to declare the event in the DataGrid.  A simple 
subclass should do the trick.  This way you can add the event listener in mxml 
too:

package myPackage
{
import mx.controls.DataGrid;

[Event( name="myTest", type="flash.events.Event")]

public class MyDataGrid extends DataGrid
{

}
}

-TH--- In flexcoders@yahoogroups.com, Angelo Anolin  wrote:
>
> I have written the following scripts, and yet this does not seem to work.
> 
> in my MXML file (main)
> 
> private function myDataGrid_CreationComplete() :void
> {
>   myDataGrid.addEventListener('myTest', myTesting);
> }
> 
> private function myTesting() :void
> {
>   Alert.show('This event should have been called!');
> }
> 
> 
> in my datagrid, i have declared
> creationComplete="myDataGrid_CreationComplete()"
> 
> In my itemrenderer, I have placed a code :
> 
> override protected function clickHandler(event:MouseEvent) :void
> {
>   dispatchEvent(new Event('myTest', true));
> }
> 
> For some reason, this does not seem to work. From what I have read mostly, 
> this 
>
> should be able to do the trick.
> 
> Any input and ideas appreciated. Thanks..
> 
> 
> 
> 
> From: Angelo Anolin angelo_ano...@...
> To: flexcoders@yahoogroups.com
> Sent: Tue, 17 August, 2010 8:34:07
> Subject: Re: [flexcoders] Re: Method for a Datagrid Button Itemrenderer
> 
> 
> Hi Don,
> 
> Thanks for the reply.
> 
> I do am able to do the same using an in-line itemrenderer.
> 
> But right now, my itemrenderer is an external AS file.
> 
> So I declare my MXML like:
> 
>  id="dgActionColumn" width="100" visible="true" 
>itemRenderer="myButtonItemRenderer"
>  />
> 
> Where myButtonItemRenderer is an external AS file which extends the button.
> 
> Now, where I declare the datagrid, I am writing a function which I need to 
> wire 
>
> up to the itemrenderer so that on the click of the button, that method is 
> dispatched.
> 
> Thanks.
> 
> 
> 
> 
> 
> 
> From: fusionpage fusionp...@...
> To: flexcoders@yahoogroups.com
> Sent: Tue, 17 August, 2010 8:29:11
> Subject: [flexcoders] Re: Method for a Datagrid Button Itemrenderer
> 
> 
> I typically use code like this to call a method in the parent MXML page that 
> contains the dataGrid...
> 
>  dataField="contentURL">
> 
> 
> 
> 
> 
> 
> 
> Don
> 
> --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_anolin@ wrote:
> >
> > I know someone has encountered this before. 
> > 
> > Better to rephrase this one I guess.
> > 
> > I have an MXML file, where I have a method.  In that MXML file, I have a 
> > datagrid, where one of the columns, I created an external itemrenderer.  
> > The 

> > itemrenderer is a button.  When I click that button, I want that button to 
>call 
>
> >
> > the method in the MXML file (so that I could re-use the button on other 
> > datagrids). 
> > 
> > Thanks.
> > 
> > 
> > 
> > 
> > From: Angelo Anolin angelo_anolin@
> > To: flexcoders@yahoogroups.com
> > Sent: Mon, 16 August, 2010 13:54:33
> > Subject: [flexcoders] Method for a Datagrid Button Itemrenderer
> > 
> > 
> > Hi Flexcoders,
> > 
> > I have a datagrid and an button itemrenderer named btnRenderer.as
> > 
> > I have set this button as an itemRenderer in one of my datagrid columns.
> > 
> > 
> > 
> > I need to respond to an click event on button, passing some of the value 
> > from 
>
> > the dataProvider attached to the datagrid.
> > 
> > Should I place my codes on the mxml file where my datagrid is declared?  
> > How 

> > would the btnRenderer know that the method is called?
> > 
> > Thanks.
> >
>

 


  

[flexcoders] Re: Detecting List width from its itemRenderer

2010-08-17 Thread Alexander
Hello again,

I thought I've found a solution by using 
the List's resize event to change the size 
of its items, but while it works for the 
simple test case listed below, it goes 
into endless loop in my real app with more 
complex layout and I see the traces:

resize list: 0 -> 480
resize list: 480 -> 480
resize list: 480 -> 464
resize list: 464 -> 464
resize list: 464 -> 480
resize list: 480 -> 480
resize list: 480 -> 464
resize list: 464 -> 464
...


TestCase.mxml:


http://www.adobe.com/2006/mxml";>











RowRenderer.mxml:


http://www.adobe.com/2006/mxml"; 
  width="100%" height="100%" 
  verticalScrollPolicy="off" horizontalScrollPolicy="off">














Regards
Alex




Re: [flexcoders] Why can't I change the highlight color of Spark text?

2010-08-17 Thread Alex Harui
focusedTextSelectionColor?


On 8/17/10 2:14 AM, "dorkiedorkfromdorkt...@gmail.com" 
 wrote:






I've spent soo much time trying to find how to do this.

I'm using, sparkTextArea.selectAll() to select text but I've found no way to 
change the highlight color.

JP





--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


[flexcoders] Re: Method for a Datagrid Button Itemrenderer

2010-08-17 Thread turbo_vb
Hi Angelo,
You're close.  You'll need to declare the event in the DataGrid.  A
simple subclass should do the trick.  This way you can add the event
listener in mxml too:

package myPackage

{

import mx.controls.DataGrid;




[Event( name="myTest", type="flash.events.Event" )]




public class MyDataGrid extends DataGrid

{




}

}




-TH
--- In flexcoders@yahoogroups.com, Angelo Anolin 
wrote:
>
> I have written the following scripts, and yet this does not seem to
work.
>
> in my MXML file (main)
>
> private function myDataGrid_CreationComplete() :void
> {
>   myDataGrid.addEventListener('myTest', myTesting);
> }
>
> private function myTesting() :void
> {
>   Alert.show('This event should have been called!');
> }
>
>
> in my datagrid, i have declared
> creationComplete="myDataGrid_CreationComplete()"
>
> In my itemrenderer, I have placed a code :
>
> override protected function clickHandler(event:MouseEvent) :void
> {
>   dispatchEvent(new Event('myTest', true));
> }
>
> For some reason, this does not seem to work. From what I have read
mostly, this
> should be able to do the trick.
>
> Any input and ideas appreciated. Thanks..
>
>
>
> 
> From: Angelo Anolin angelo_ano...@...
> To: flexcoders@yahoogroups.com
> Sent: Tue, 17 August, 2010 8:34:07
> Subject: Re: [flexcoders] Re: Method for a Datagrid Button
Itemrenderer
>
>
> Hi Don,
>
> Thanks for the reply.
>
> I do am able to do the same using an in-line itemrenderer.
>
> But right now, my itemrenderer is an external AS file.
>
> So I declare my MXML like:
>
>  id="dgActionColumn" width="100" visible="true"
itemRenderer="myButtonItemRenderer"
>  />
>
> Where myButtonItemRenderer is an external AS file which extends the
button.
>
> Now, where I declare the datagrid, I am writing a function which I
need to wire
> up to the itemrenderer so that on the click of the button, that method
is
> dispatched.
>
> Thanks.
>
>
>
>
>
> 
> From: fusionpage fusionp...@...
> To: flexcoders@yahoogroups.com
> Sent: Tue, 17 August, 2010 8:29:11
> Subject: [flexcoders] Re: Method for a Datagrid Button Itemrenderer
>
>
> I typically use code like this to call a method in the parent MXML
page that
> contains the dataGrid...
>
>  dataField="contentURL">
> 
> 
> 
> 
> 
> 
>
> Don
>
> --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_anolin@ wrote:
> >
> > I know someone has encountered this before.
> >
> > Better to rephrase this one I guess.
> >
> > I have an MXML file, where I have a method.  In that MXML file, I
have a
> > datagrid, where one of the columns, I created an external
itemrenderer.  The
> > itemrenderer is a button.  When I click that button, I want that
button to call
> >
> > the method in the MXML file (so that I could re-use the button on
other
> > datagrids).
> >
> > Thanks.
> >
> >
> >
> > 
> > From: Angelo Anolin angelo_anolin@
> > To: flexcoders@yahoogroups.com
> > Sent: Mon, 16 August, 2010 13:54:33
> > Subject: [flexcoders] Method for a Datagrid Button Itemrenderer
> >
> >
> > Hi Flexcoders,
> >
> > I have a datagrid and an button itemrenderer named btnRenderer.as
> >
> > I have set this button as an itemRenderer in one of my datagrid
columns.
> >
> > 
> >
> > I need to respond to an click event on button, passing some of the
value from
> > the dataProvider attached to the datagrid.
> >
> > Should I place my codes on the mxml file where my datagrid is
declared?  How
> > would the btnRenderer know that the method is called?
> >
> > Thanks.
> >
>



[flexcoders] Re: Animate Application Background

2010-08-17 Thread Dan Vega
OOOPs...pulled a dumb one there, I was listening for complete..this works.


http://ns.adobe.com/mxml/2009";
xmlns:s="library://ns.adobe.com/flex/spark"
creationComplete="init();">


[HostComponent("spark.components.Application")]

 








 













 













Thank You
Dan Vega
danv...@gmail.com
http://www.danvega.org/


On Tue, Aug 17, 2010 at 11:20 AM, Dan Vega  wrote:

> I am trying to do a simple animation with a flex app skin between 2
> backgrounds. Why does this not work? The function changeBG does not get
> called as expected. Its really weird though because every now and then it
> does. I would expect it to get called every second with the following code.
>
> 
>  xmlns:fx="http://ns.adobe.com/mxml/2009";
>  xmlns:s="library://ns.adobe.com/flex/spark"
> creationComplete="init();">
>
> 
> [HostComponent("spark.components.Application")]
> 
>  
> 
>  
>
> 
> 
> 
>  
> 
>  
> 
> 
>  
> 
>
>  includeIn="normal">
> 
> 
> 
>  
> 
> 
> 
>   includeIn="anotherbg">
>  
> 
> 
>  
> 
>  
> 
>
>  minHeight="0" />
>
> 
>
>
>


[flexcoders] Animate Application Background

2010-08-17 Thread Dan Vega
I am trying to do a simple animation with a flex app skin between 2
backgrounds. Why does this not work? The function changeBG does not get
called as expected. Its really weird though because every now and then it
does. I would expect it to get called every second with the following code.


http://ns.adobe.com/mxml/2009";
xmlns:s="library://ns.adobe.com/flex/spark"
creationComplete="init();">


[HostComponent("spark.components.Application")]

 








 













 













Re: [flexcoders] String format

2010-08-17 Thread meaglith
http://code.google.com/p/printf-as3/

var num : int = 500;
var str : String = printf('000%d',
num);
trace(str); //'000500'

---
Blog: http://douhua.im
Twitter: http://twitter.com/genedna
Website: http://douhua.im
---


On Tue, Aug 17, 2010 at 10:22 PM, Christophe
wrote:

> Hello,
>
> I have an int : 500
>
> And I would like to have a string with 0 before.
>
> String : 000500
>
> How to format such a string ?
>
> Thank you,
> Christophe,
>
>
>
> 
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location:
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> Links
>
>
>
>


[flexcoders] Accessing Network Drive in AIR

2010-08-17 Thread sdl1326

I have created an AIR application that accesses files on the network
drive. Each machine that is running the AIR app may have a different
letter/drive mapped to the network drive. Therefore, in order to
alleviate drive mapping issues, I wanted to simply use the absolute
network path to the file(s), i.e.




\\network-drive-location\department folder\config.xml




However, that doesn't seem to work as it consistently throws an error.
Is is possible to load files using this type of path or do I need to
have a letter associated with the path, i.e.




N:\network-drive-location\department folder\config.xml






Thanks for the assistance.



Re: [flexcoders] Re: Method for a Datagrid Button Itemrenderer

2010-08-17 Thread Angelo Anolin
I have written the following scripts, and yet this does not seem to work.

in my MXML file (main)

private function myDataGrid_CreationComplete() :void
{
  myDataGrid.addEventListener('myTest', myTesting);
}

private function myTesting() :void
{
  Alert.show('This event should have been called!');
}


in my datagrid, i have declared
creationComplete="myDataGrid_CreationComplete()"

In my itemrenderer, I have placed a code :

override protected function clickHandler(event:MouseEvent) :void
{
  dispatchEvent(new Event('myTest', true));
}

For some reason, this does not seem to work. From what I have read mostly, this 
should be able to do the trick.

Any input and ideas appreciated. Thanks..




From: Angelo Anolin 
To: flexcoders@yahoogroups.com
Sent: Tue, 17 August, 2010 8:34:07
Subject: Re: [flexcoders] Re: Method for a Datagrid Button Itemrenderer

  
Hi Don,

Thanks for the reply.

I do am able to do the same using an in-line itemrenderer.

But right now, my itemrenderer is an external AS file.

So I declare my MXML like:



Where myButtonItemRenderer is an external AS file which extends the button.

Now, where I declare the datagrid, I am writing a function which I need to wire 
up to the itemrenderer so that on the click of the button, that method is  
dispatched.

Thanks.






From: fusionpage 
To: flexcoders@yahoogroups.com
Sent: Tue, 17 August, 2010 8:29:11
Subject: [flexcoders] Re: Method for a Datagrid Button Itemrenderer

  
I typically use code like this to call a method in the parent MXML page that 
contains the dataGrid...









Don

--- In flexcoders@yahoogroups.com, Angelo Anolin  wrote:
>
> I know someone has encountered this before. 
> 
> Better to rephrase this one I guess.
> 
> I have an MXML file, where I have a method.  In that MXML file, I have a 
> datagrid, where one of the columns, I created an external itemrenderer.  The 
> itemrenderer is a button.  When I click that button, I want that button to 
> call 
>
> the method in the MXML file (so that I could re-use the button on other 
> datagrids). 
> 
> Thanks.
> 
> 
> 
> 
> From: Angelo Anolin 
> To: flexcoders@yahoogroups.com
> Sent: Mon, 16 August, 2010 13:54:33
> Subject: [flexcoders] Method for a Datagrid Button Itemrenderer
> 
> 
> Hi Flexcoders,
> 
> I have a datagrid and an button itemrenderer named btnRenderer.as
> 
> I have set this button as an itemRenderer in one of my datagrid columns.
> 
> 
> 
> I need to respond to an click event on button, passing some of the value from 
> the dataProvider attached to the datagrid.
> 
> Should I place my codes on the mxml file where my datagrid is declared?  How 
> would the btnRenderer know that the method is called?
> 
> Thanks.
>



 


  

Re: [flexcoders] String format

2010-08-17 Thread Csomák Gábor
var num:int=500
var myString:string="000"+num.toString();
trace(myString) //traces 000500

2010/8/17 Christophe 

>
>
> Hello,
>
> I have an int : 500
>
> And I would like to have a string with 0 before.
>
> String : 000500
>
> How to format such a string ?
>
> Thank you,
> Christophe,
>
>  
>


[flexcoders] String format

2010-08-17 Thread Christophe
Hello, 

I have an int : 500 

And I would like to have a string with 0 before.

String : 000500 

How to format such a string ?

Thank you,
Christophe, 



Re: [flexcoders] Re: Method for a Datagrid Button Itemrenderer

2010-08-17 Thread Angelo Anolin
Hi Don,

Thanks for the reply.

I do am able to do the same using an in-line itemrenderer.

But right now, my itemrenderer is an external AS file.

So I declare my MXML like:



Where myButtonItemRenderer is an external AS file which extends the button.

Now, where I declare the datagrid, I am writing a function which I need to wire 
up to the itemrenderer so that on the click of the button, that method is 
dispatched.

Thanks.






From: fusionpage 
To: flexcoders@yahoogroups.com
Sent: Tue, 17 August, 2010 8:29:11
Subject: [flexcoders] Re: Method for a Datagrid Button Itemrenderer

  
I typically use code like this to call a method in the parent MXML page that 
contains the dataGrid...









Don

--- In flexcoders@yahoogroups.com, Angelo Anolin  wrote:
>
> I know someone has encountered this before. 
> 
> Better to rephrase this one I guess.
> 
> I have an MXML file, where I have a method.  In that MXML file, I have a 
> datagrid, where one of the columns, I created an external itemrenderer.  The 
> itemrenderer is a button.  When I click that button, I want that button to 
> call 
>
> the method in the MXML file (so that I could re-use the button on other 
> datagrids). 
> 
> Thanks.
> 
> 
> 
> 
> From: Angelo Anolin 
> To: flexcoders@yahoogroups.com
> Sent: Mon, 16 August, 2010 13:54:33
> Subject: [flexcoders] Method for a Datagrid Button Itemrenderer
> 
> 
> Hi Flexcoders,
> 
> I have a datagrid and an button itemrenderer named btnRenderer.as
> 
> I have set this button as an itemRenderer in one of my datagrid columns.
> 
> 
> 
> I need to respond to an click event on button, passing some of the value from 
> the dataProvider attached to the datagrid.
> 
> Should I place my codes on the mxml file where my datagrid is declared?  How 
> would the btnRenderer know that the method is called?
> 
> Thanks.
>


 


  

[flexcoders] Re: Method for a Datagrid Button Itemrenderer

2010-08-17 Thread fusionpage
I typically use code like this to call a method in the parent MXML page that 
contains the dataGrid...










Don

--- In flexcoders@yahoogroups.com, Angelo Anolin  wrote:
>
> I know someone has encountered this before. 
> 
> Better to rephrase this one I guess.
> 
> I have an MXML file, where I have a method.  In that MXML file, I have a 
> datagrid, where one of the columns, I created an external itemrenderer.  The 
> itemrenderer is a button.  When I click that button, I want that button to 
> call 
> the method in the MXML file (so that I could re-use the button on other 
> datagrids).  
> 
> Thanks.
> 
> 
> 
> 
> From: Angelo Anolin 
> To: flexcoders@yahoogroups.com
> Sent: Mon, 16 August, 2010 13:54:33
> Subject: [flexcoders] Method for a Datagrid Button Itemrenderer
> 
>   
> Hi Flexcoders,
> 
> I have a datagrid and an button itemrenderer named btnRenderer.as
> 
> I have set this button as an itemRenderer in one of my datagrid columns.
> 
> 
> 
> I need to respond to an click event on button, passing some of the value from 
> the dataProvider attached to the datagrid.
> 
> Should I place my codes on the mxml file where my datagrid is declared?  How 
> would the btnRenderer know that the method is called?
> 
> Thanks.
>




Re: [flexcoders] Method for a Datagrid Button Itemrenderer

2010-08-17 Thread Angelo Anolin
I know someone has encountered this before. 

Better to rephrase this one I guess.

I have an MXML file, where I have a method.  In that MXML file, I have a 
datagrid, where one of the columns, I created an external itemrenderer.  The 
itemrenderer is a button.  When I click that button, I want that button to call 
the method in the MXML file (so that I could re-use the button on other 
datagrids).  

Thanks.




From: Angelo Anolin 
To: flexcoders@yahoogroups.com
Sent: Mon, 16 August, 2010 13:54:33
Subject: [flexcoders] Method for a Datagrid Button Itemrenderer

  
Hi Flexcoders,

I have a datagrid and an button itemrenderer named btnRenderer.as

I have set this button as an itemRenderer in one of my datagrid columns.



I need to respond to an click event on button, passing some of the value from 
the dataProvider attached to the datagrid.

Should I place my codes on the mxml file where my datagrid is declared?  How 
would the btnRenderer know that the method is called?

Thanks.

 


  

[flexcoders] Re: Detecting List width from its itemRenderer

2010-08-17 Thread Alexander





Hello Alex and others,

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
> The renderer should be given an explicitWidth by the time its measure() 
> method gets called.  That would be a good time to choose a different size 
> avatar and report a different measuredHeight.

my problem is: when I increase the item size in my renderer,
I don't know how to change the rowHeight of the parent List
and thus the items are cut off.

I've prepared a reduced test case demonstrating my problem -

TestCase.mxml:


http://www.adobe.com/2006/mxml";>






RowRenderer.mxml:


http://www.adobe.com/2006/mxml"; 
width="100%" height="100%" 
verticalScrollPolicy="off" horizontalScrollPolicy="off">

















[flexcoders] Why can't I change the highlight color of Spark text?

2010-08-17 Thread dorkie dork from dorktown
I've spent soo much time trying to find how to do this.

I'm using, sparkTextArea.selectAll() to select text but I've found no way to
change the highlight color.

JP


[flexcoders] What's wrong in using itemRenderer ?

2010-08-17 Thread RishiShahi

I'm trying to add itemRenderer like, but it doesn't work. However if I remove
the check it's adding the itemRenderer. 

for each (var column:XML in columns)
{
var col:AdvancedDataGridColumn = new AdvancedDataGridColumn(column); 
col.headertext=colu...@label;

 if(column=="status") {
col.itemRenderer = new ClassFactory(RenderCategory);
 }

   col.width=Number(colu...@width); 
   cols.push(col);
}
-- 
View this message in context: 
http://old.nabble.com/What%27s-wrong-in-using-itemRenderer---tp29449236p29449236.html
Sent from the FlexCoders mailing list archive at Nabble.com.



[flexcoders] Re: Push verse Poll in Flash Player

2010-08-17 Thread Alexander
I think it's worth trying, because trying to read
an integer this way won't waste any CPU cycles -
Flash/Flex probably run select() or poll() internally
and just sleep - until anything arrives over the socket.

(Versus trying to pull anything every 30 seconds -
that will cost you CPU and also feel delayed).

And whenever an integer arrives, then you could
use that number to indicate how many records have 
changed at your backend, so that you can use it to 
provide feedback on the progress to the user
while fetching the updated data over HTTP.

Regards
Alex

--- In flexcoders@yahoogroups.com, dorkie dork from dorktown 
 wrote:
>
> good idea :) that'll work
> 
> On Mon, Aug 16, 2010 at 2:42 AM, Alexander Farber <
> alexander.far...@...> wrote:
> 
> >
> >
> > An idea: you could open a socket connection
> > (because of corporate proxies best would be the port 80)
> > and try to read an integer:
> >
> > private function handleTcpData(event:Event):void {
> > while(_socket.bytesAvailable) {
> > try{
> > var i:int = _socket.readInt();
> > fetchHttpData(i);
> > }catch(e:Error){
> > // incomplete integer, will be read by another handleTcpData call
> > return;
> > }
> > }
> > }
> >
> > and whenever an integer arrives from your backend,
> > your client could read the whole data over HTTP.
> >