[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 
dorkiedorkfromdorkt...@... 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.
 



[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] 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] Re: Detecting List width from its itemRenderer

2010-08-17 Thread Alexander





Hello Alex and others,

--- In flexcoders@yahoogroups.com, Alex Harui aha...@... 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:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
mx:HDividedBox width=100% height=100%
mx:List id=myList width=40% height=100% 
  alternatingItemColors=[0xCC, 0xFF]
  dataProvider={['a;b;c', '1;2;3', '4;5', 'd', '6;7;8']} 
  itemRenderer=RowRenderer/
mx:Label text=lt;-- Resize the list width=60%/
/mx:HDividedBox
/mx:Application

RowRenderer.mxml:

?xml version=1.0 encoding=utf-8?
mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; 
width=100% height=100% 
verticalScrollPolicy=off horizontalScrollPolicy=off

mx:Script
![CDATA[
[Bindable]
private var _scale:Number = 0.8;

override public function set data(obj:Object):void {
var i:uint;

super.data = obj;

for (i = 0; i  _btn.length; i++)
_btn[i].visible = false;

if (obj != null) {
var str:String = String(obj);
var labels:Array = str.split(/;/);
for (i = 0; i  _btn.length  i  labels.length; i++) {
_btn[i].label = labels[i];
_btn[i].visible = true;
}
}
}

override protected function measure():void {
super.measure();

measuredWidth=3 * 100 * _scale;
measuredHeight=100 * _scale;

measuredMinWidth = 3 * 50;
measuredMinHeight = 50;
}

override protected function updateDisplayList(unscaledWidth:Number, 
unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
trace(unscaledWidth + ' x ' + unscaledHeight);
_scale = (unscaledWidth  3 * 100 ? 1.2 : 0.8);

// XXX how to set the list rowHeigt=100*_scale here?
}
]]
/mx:Script

mx:HBox width=100% horizontalAlign=center
mx:Repeater id=_rpt dataProvider={[0, 1, 2]}
mx:Button id=_btn width=100 height=100 fontSize=24
  textAlign=center scaleX={_scale} scaleY={_scale}/
/mx:Repeater
/mx:HBox

/mx:Canvas





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 angelo_ano...@yahoo.com
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.

mx:DataGridColumn id=dgColCancel width=100 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] 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...

mx:AdvancedDataGridColumn width=80 headerText=Launch 
dataField=contentURL
mx:itemRenderer
mx:Component

mx:Button label=Launch click=parentDocument.goDownload();/
/mx:Component
/mx:itemRenderer
/mx:AdvancedDataGridColumn

Don

--- In flexcoders@yahoogroups.com, Angelo Anolin angelo_ano...@... 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_ano...@...
 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.
 
 mx:DataGridColumn id=dgColCancel width=100 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.





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:

mx:DataGridColumn 
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...@yahoo.com
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...

mx:AdvancedDataGridColumn width=80 headerText=Launch 
dataField=contentURL
mx:itemRenderer
mx:Component
mx:Button label=Launch click=parentDocument.goDownload();/
/mx:Component
/mx:itemRenderer
/mx:AdvancedDataGridColumn

Don

--- In flexcoders@yahoogroups.com, Angelo Anolin angelo_ano...@... 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_ano...@...
 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.
 
 mx:DataGridColumn id=dgColCancel width=100 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] 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] 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 christophe_jacque...@yahoo.fr



 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
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...@yahoo.com
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:

mx:DataGridColumn 
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...@yahoo.com
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...

mx:AdvancedDataGridColumn width=80 headerText=Launch 
dataField=contentURL
mx:itemRenderer
mx:Component
mx:Button label=Launch click=parentDocument.goDownload();/
/mx:Component
/mx:itemRenderer
/mx:AdvancedDataGridColumn

Don

--- In flexcoders@yahoogroups.com, Angelo Anolin angelo_ano...@... 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_ano...@...
 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.
 
 mx:DataGridColumn id=dgColCancel width=100 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] 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] String format

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

var num : int = 500;
http://code.google.com/p/printf-as3/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
christophe_jacque...@yahoo.frwrote:

 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] 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.

?xml version=1.0 encoding=utf-8?
s:Skin
xmlns:fx=http://ns.adobe.com/mxml/2009;
xmlns:s=library://ns.adobe.com/flex/spark
creationComplete=init();

fx:Metadata
[HostComponent(spark.components.Application)]
/fx:Metadata
 fx:Script
![CDATA[
import mx.controls.Alert;
 public function init():void {
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER_COMPLETE,changeBg);
timer.start();
}
 public function changeBg(e:TimerEvent):void {
Alert.show(Change BG);
currentState = (currentState = normal) ? anotherbg : normal;
}
 ]]
/fx:Script

s:states
s:State name=normal /
s:State name=disabled /
s:State name=anotherbg/
/s:states
 s:transitions
s:Transition
s:Fade target={backgroundRect2}/
/s:Transition
/s:transitions

s:Rect id=backgroundRect left=0 right=0 top=0 bottom=0
includeIn=normal
s:fill
s:LinearGradient rotation=90
s:GradientEntry color=#00 /
s:GradientEntry color=#99 /
/s:LinearGradient
/s:fill
/s:Rect
 s:Rect id=backgroundRect2 left=0 right=0 top=0 bottom=0
includeIn=anotherbg
s:fill
s:LinearGradient rotation=90
s:GradientEntry color=#99 /
s:GradientEntry color=#00 /
/s:LinearGradient
/s:fill
/s:Rect

s:Group id=contentGroup width=100% height=100% minWidth=0
minHeight=0 /

/s:Skin


[flexcoders] Re: Animate Application Background

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

?xml version=1.0 encoding=utf-8?
s:Skin
xmlns:fx=http://ns.adobe.com/mxml/2009;
xmlns:s=library://ns.adobe.com/flex/spark
creationComplete=init();

fx:Metadata
[HostComponent(spark.components.Application)]
/fx:Metadata
 fx:Script
![CDATA[
import mx.controls.Alert;
 private var timer:Timer;
 public function init():void {
timer = new Timer(2000);
timer.addEventListener(TimerEvent.TIMER, changeBg);
timer.start();
}
 public function changeBg(e:TimerEvent):void {
currentState = (currentState == normal) ? anotherbg : normal;
}
 ]]
/fx:Script

s:states
s:State name=normal /
s:State name=disabled /
s:State name=anotherbg/
/s:states
 s:transitions
s:Transition
s:Fade targets={[backgroundRect,backgroundRect2]}/
/s:Transition
/s:transitions

s:Rect id=backgroundRect left=0 right=0 top=0 bottom=0
includeIn=normal
s:fill
s:LinearGradient rotation=90
s:GradientEntry color=#00 /
s:GradientEntry color=#99 /
/s:LinearGradient
/s:fill
/s:Rect
 s:Rect id=backgroundRect2 left=0 right=0 top=0 bottom=0
includeIn=anotherbg
s:fill
s:LinearGradient rotation=90
s:GradientEntry color=#99 /
s:GradientEntry color=#00 /
/s:LinearGradient
/s:fill
/s:Rect

s:Group id=contentGroup width=100% height=100% minWidth=0
minHeight=0 /

/s:Skin


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


On Tue, Aug 17, 2010 at 11:20 AM, Dan Vega danv...@gmail.com 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.

 ?xml version=1.0 encoding=utf-8?
 s:Skin
 xmlns:fx=http://ns.adobe.com/mxml/2009;
  xmlns:s=library://ns.adobe.com/flex/spark
 creationComplete=init();

 fx:Metadata
 [HostComponent(spark.components.Application)]
 /fx:Metadata
  fx:Script
 ![CDATA[
 import mx.controls.Alert;
  public function init():void {
 var timer:Timer = new Timer(1000);
  timer.addEventListener(TimerEvent.TIMER_COMPLETE,changeBg);
 timer.start();
  }
  public function changeBg(e:TimerEvent):void {
  Alert.show(Change BG);
 currentState = (currentState = normal) ? anotherbg : normal;
  }
  ]]
  /fx:Script

 s:states
 s:State name=normal /
 s:State name=disabled /
  s:State name=anotherbg/
 /s:states
  s:transitions
 s:Transition
 s:Fade target={backgroundRect2}/
  /s:Transition
 /s:transitions

 s:Rect id=backgroundRect left=0 right=0 top=0 bottom=0
 includeIn=normal
 s:fill
 s:LinearGradient rotation=90
 s:GradientEntry color=#00 /
  s:GradientEntry color=#99 /
 /s:LinearGradient
 /s:fill
 /s:Rect
  s:Rect id=backgroundRect2 left=0 right=0 top=0 bottom=0
 includeIn=anotherbg
  s:fill
 s:LinearGradient rotation=90
 s:GradientEntry color=#99 /
  s:GradientEntry color=#00 /
 /s:LinearGradient
  /s:fill
 /s:Rect

 s:Group id=contentGroup width=100% height=100% minWidth=0
 minHeight=0 /

 /s:Skin





[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 angelo_ano...@...
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:

 mx:DataGridColumn
 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...

 mx:AdvancedDataGridColumn width=80 headerText=Launch
 dataField=contentURL
 mx:itemRenderer
 mx:Component
 mx:Button label=Launch click=parentDocument.goDownload();/
 /mx:Component
 /mx:itemRenderer
 /mx:AdvancedDataGridColumn

 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.
 
  mx:DataGridColumn id=dgColCancel width=100
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.
 




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 
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: 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:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
mx:Script
![CDATA[
import mx.events.*;

private function resizeHandler(event:ResizeEvent):void {
var list:List = event.target as List;
trace(event.oldWidth + ' - ' + list.width);
list.rowHeight = list.width / 3;
RowRenderer._scale = list.rowHeight / (100 + 20);
}
]]
/mx:Script

mx:HDividedBox width=100% height=100%
mx:List id=myList width=40% height=100% 
  alternatingItemColors=[0xCC, 0xFF]
  dataProvider={['a;b;c', '1;2;3', '4;5', 'd', '6;7;8']} 
  itemRenderer=RowRenderer resize=resizeHandler(event)/
mx:Label text=lt;-- Resize the list width=60%/
/mx:HDividedBox
/mx:Application


RowRenderer.mxml:

?xml version=1.0 encoding=utf-8?
mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; 
  width=100% height=100% 
  verticalScrollPolicy=off horizontalScrollPolicy=off

mx:Script
![CDATA[
import mx.controls.List;
[Bindable]
public static var _scale:Number = 1.0;

override public function set data(obj:Object):void {
var i:uint;

super.data = obj;

for (i = 0; i  _btn.length; i++)
_btn[i].visible = false;

if (obj != null) {
var str:String = String(obj);
var labels:Array = str.split(/;/);
for (i = 0; i  _btn.length  i  labels.length; i++) {
_btn[i].label = labels[i];
_btn[i].visible = true;
}
}
}
]]
/mx:Script

mx:HBox width=100% horizontalAlign=center
mx:Repeater id=_rpt dataProvider={[0, 1, 2]}
mx:Button id=_btn width=100 height=100 fontSize=24
  textAlign=center scaleX={_scale} scaleY={_scale}/
/mx:Repeater
/mx:HBox

/mx:Canvas


Regards
Alex




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 timh...@aol.com
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 angelo_ano...@... 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:
 
 mx:DataGridColumn 
 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...
 
 mx:AdvancedDataGridColumn width=80 headerText=Launch 
 dataField=contentURL
 mx:itemRenderer
 mx:Component
 mx:Button label=Launch click=parentDocument.goDownload();/
 /mx:Component
 /mx:itemRenderer
 /mx:AdvancedDataGridColumn
 
 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.
  
  mx:DataGridColumn id=dgColCancel width=100 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;ifilterCombo.length;i++){
for(var j:int=0;jfilterCombo[i].length;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: 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 angelo_ano...@... 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 timh...@...
 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 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:
  
  mx:DataGridColumn 
  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...
  
  mx:AdvancedDataGridColumn width=80 headerText=Launch 
  dataField=contentURL
  mx:itemRenderer
  mx:Component
  mx:Button label=Launch click=parentDocument.goDownload();/
  /mx:Component
  /mx:itemRenderer
  /mx:AdvancedDataGridColumn
  
  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.
   
   mx:DataGridColumn id=dgColCancel width=100 
   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.
  
 





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] Handling XML

2010-08-17 Thread Stephen
var xml:XML = 
library
shelf
book
chapterOnce Upon A Time/chapter
/book
/shelf
/library
;

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] 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 sd_br...@ntlworld.com wrote:






var xml:XML =
library
shelf
book
chapterOnce Upon A Time/chapter
/book
/shelf
/library
;

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] 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.

?xml version=1.0?
!-- Simple example to demonstrate the LineChart and AreaChart controls. --
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
   mx:Script
  ![CDATA[
import mx.charts.chartClasses.Series;
import mx.collections.ArrayCollection;

[Bindable]  
private 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 } ]);

private function dataFunc(series:Series, item:Object, 
fieldName:String):Object {
   trace(fieldName:  + fieldName);
   if(series.id==checkingSeries  item.type == 'checking')
return item.Amount;
   else if(series.id==savingsSeries  item.type == 'savings')
return item.Amount;
   else
return null;
   }
]]
/mx:Script
!-- Line colors --
mx:Stroke id = s1 color=blue weight=6/
mx:Stroke id = s2 color=red weight=2/


mx:Panel title=LineChart and AreaChart Controls Example 
  height=100% width=100% layout=horizontal

mx:LineChart id=linechart height=100% width=45%
  paddingLeft=5 paddingRight=5 showDataTips=true 
dataProvider={expensesAC}
 mx:horizontalAxis
mx:CategoryAxis categoryField=date/
 /mx:horizontalAxis

mx:series
mx:LineSeries id=checkingSeries yField=Amount 
dataFunction=dataFunc form=curve displayName=Checking lineStroke={s1} /
mx:LineSeries id=savingsSeries yField=Amount 
dataFunction=dataFunc form=curve displayName=Savings lineStroke={s2} /
/mx:series
/mx:LineChart

 mx:Legend dataProvider={linechart}/

/mx:Panel
/mx:Application



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 aha...@adobe.com 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] 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] Re: Method for a Datagrid Button Itemrenderer

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


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



[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



[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:

?xml version=1.0 encoding=utf-8?
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 minWidth=955 minHeight=600
xmlns:components=components.*
fx:Declarations
s:ArrayList id=tool
s:Label name=label/
s:TextInput name=textInput/
s:BorderContainer name=Region/
/s:ArrayList
/fx:Declarations

fx:Script
![CDATA[
import mx.controls.Alert;
import mx.core.IUIComponent;
import mx.events.DragEvent;
import mx.managers.DragManager;

import spark.components.BorderContainer;
import spark.components.Group;
protected function dragEnterHandler(event:DragEvent):void
{

DragManager.acceptDragDrop(event.currentTarget as IUIComponent);
}


protected function dragDropHandler(event:DragEvent):void
{
event.dragInitiator.x = event.currentTarget.mouseX -
event.dragInitiator.width/2;
event.dragInitiator.y = event.currentTarget.mouseY -
event.dragInitiator.height/2;
event.currentTarget.addElement(event.dragInitiator as IUIComponent);
}




protected function tool1_dragCompleteHandler(event:DragEvent):void
{
event.dragInitiator.addEventListener(MouseEvent.DOUBLE_CLICK, goa);
}

public function goa(event:MouseEvent):void
{
Alert.show(ok);
}

]]


/fx:Script




components:Body x=106 width=955 height=400
dragEnter=dragEnterHandler(event)
dragDrop=dragDropHandler(event) y=0
doubleClickEnabled=true  mouseEnabled=true/


components:Tool x=800 y=400 dataProvider={tool}
dragComplete=tool1_dragCompleteHandler(event) /
/s:Application


and the Tool component:

?xml version=1.0 encoding=utf-8?
s:SkinnableDataContainer xmlns:fx=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
s:layout
s:VerticalLayout/
/s:layout
fx:Declarations
!-- Place non-visual elements (e.g., services, value objects) here --
/fx:Declarations

fx:Script
![CDATA[
import flash.utils.flash_proxy;

import mx.core.DragSource;
import mx.core.IUIComponent;
import mx.managers.DragManager;
import mx.utils.object_proxy;

import spark.components.Label;
import spark.components.supportClasses.ItemRenderer;
public function mouseDownHandler(event:MouseEvent):void
{
//  var dragSrc:Object = event.currentTarget ;


// var className:String = getQualifiedClassName(dragSrc);
//var klass:Class = getDefinitionByName(className) as Class;
//var proxy:* = new klass();



DragManager.doDrag(event.currentTarget as IUIComponent,null,event);
}


]]


/fx:Script

s:itemRenderer 
fx:Component 
s:ItemRenderer 


s:HGroup 
s:Label text={data}
mouseDown=outerDocument.mouseDownHandler(event)/

/s:HGroup
/s:ItemRenderer
/fx:Component
/s:itemRenderer

/s:SkinnableDataContainer


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





[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] HTTPService not updating...

2010-08-17 Thread Laurence
Ok.  I have the following HTTP Service declared:
mx:HTTPService id=reportDataRPC
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. nbsp;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. nbsp;

-Jake



-- Sent from my Palm Pre
On Aug 17, 2010 6:23 PM, Laurence lt;lmacne...@comcast.netgt; wrote: 


nbsp;



  



  
  
  
Ok.  I have the following HTTP Service declared:

lt;mx:HTTPService id=reportDataRPC

url=reports/xml/{_reportInfo.fileName}.xml

result=rdHandler(event);

fault=rpcFaultHandler(event);/gt;



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 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 lmacne...@comcast.net wrote:



 Ok. I have the following HTTP Service declared:
 mx:HTTPService id=reportDataRPC
 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] 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 
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 http://twitter.com/jwilker
johnwilker.com | Ignite Denver http://ignitedenver.org|
Denwherehttp://denwhere.com|
360|Flex http://360flex.com | 360|iDev http://360idev.com

“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 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.

s:HorizontalLayout 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 aha...@adobe.com 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] 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 rishi.s...@... 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.





[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 tmcn...@... 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;ifilterCombo.length;i++){
 for(var j:int=0;jfilterCombo[i].length;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





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 amyblankens...@bellsouth.net wrote:



 An XML node can never be equal to a string.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 RishiShahi rishi.s...@... 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