[flexcoders] Re: Error 1189: Attempt to delete the fixed property.

2008-12-04 Thread Tim Hoff

Thanks Gordon

--- In flexcoders@yahoogroups.com, Gordon Smith [EMAIL PROTECTED] wrote:

 In your doSomething() static function, 'arr' is a local variable and
therefore ceases to exist when doSomething() returns. Therefore the
Array object that it points to becomes eligible for garbage collection.

 If 'arr' were a static var, doSomething() should set it to null before
returning if you want to make the Array object eligible for garbage
collection. Otherwise the static var, which always exists, would
continue to point to it and prevent the Array object from being GCd.

 Gordon Smith
 Adobe Flex SDK Team

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Paul Andrews
 Sent: Wednesday, December 03, 2008 5:46 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Error 1189: Attempt to delete the fixed
property.


 - Original Message -
 From: devenhariyani
[EMAIL PROTECTED]mailto:devenhariyani%40yahoo.com
 To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
 Sent: Thursday, December 04, 2008 1:21 AM
 Subject: [flexcoders] Error 1189: Attempt to delete the fixed
property.

  hello,
 
  I'm having some very confusing problems with memory leaks. in one
  particular function, I dynamically create a new Array(), and when i
  try to delete it I get a compile time error. a simplified version of
  the function looks like:
 
  public static function doSomething():void {
  var arr:Array = new Array();
 
  //do somestuff with the array
 
  delete(arr);
  }
 
  When compiling I get the error:
 
  Error 1189: Attempt to delete the fixed property arr. Only
  dynamically defined properties can be deleted.

 The array isn't added dynamically - it's declared so you may not
delete it.

 The storage allocated for the array will be eligible for garbage
collection
 (provided nothing else is referencing the array) when you leave the
 function - it's no longer in scope.

 In other circumatsnces, you can make the array eligible for garbage
 collection by setting arr to null (provided nothing else is
referencing the
 array).

 Paul

 
  In a different situation, I also get similar problems. For example,
  when I have a private property that is part of my Application class
i
  assign dynamic data to it during the life of the app, but i cannot
  delete it.
 
  --Deven






[flexcoders] Auto expand TreeView on open - How?

2008-12-04 Thread pbrendanc
I want to auto expand my menu treeview immediately on open - the
following code is called from thecreationComplete=initTree(); and
expands the first node only. 

Is there a way to expand all nodes - I can't seem to get this to work.
(Other have reported problems so I wonder if this is supported)?

TIA,
Patrick

(The data provider for the tree is an XMLList)

mx:XMLList id=menuData  
node label=Data Management
node label=Registration/
node label=Customer List/
/node
node label=System Administration
node label=Add Users/
/node 


private function initTree():void {

//Expands first visible Tree Item
menuTree.expandItem(menuTree.firstVisibleItem,true);  
}   
 



[flexcoders] What Am I doing Wrong, View will not update when bound data is changed.

2008-12-04 Thread donvoltz
Using Cairngorm, I am maintaining an ArrayCollection of a custom data
type. This data is bound to the view, however, when I update the data
in the ArrayCollection, the view is not updated until I redraw all of
the custom components. Is there a way for each component to respond
when I modify the data?

Here is the code

CUSTOM COMPONENT

?xml version=1.0 encoding=utf-8?
mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; width=100%
height=100% borderStyle=outset cornerRadius=20
mx:Script
![CDATA[
import com.dynamicmedicalventures.or_metrics.RoomModel;
import mx.events.FlexEvent;

[Bindable]
private var _data:RoomModel;

override public function set data(value:Object):void{
if(value != null){
super.data = value;
this._data = value as RoomModel;
}
dispatchEvent(new 
FlexEvent(FlexEvent.DATA_CHANGE));
super.invalidateProperties();

}

override protected function commitProperties():void {
super.commitProperties();
if(data != _data){
_data = data as RoomModel;
}
}


]]
/mx:Script

mx:Label x=10 y=10 fontSize=14 fontWeight=bold
id=roomTitle text={_data.roomData.roomName}/
mx:Image x=846 y=10 id=roomStatus/
mx:List x=10 y=86 width=580 height=312 id=caseList
dragEnabled=true dropEnabled=true dataProvider={_data.caseList} /
mx:Label x=10 y=60 text=Case List/
mx:Label x=618 y=60 text=Main Staff/
mx:Label x=618 y=204 text=Misc Staff/
mx:List x=618 y=86 width=163 id=mainList height=110
dataProvider={_data.mainStaff} /
mx:List x=619 y=230 id=miscList width=163 height=110
dataProvider={_data.miscStaff} /
mx:Label x=10 y=415 text=Equipment List/
mx:HorizontalList x=10 y=441 width=580
dataProvider={_data.equipmentList} /
mx:Label x=619 y=360 text=Messages amp; Alerts/
mx:TextArea x=619 y=389 width=259 height=112/

/mx:Canvas

In the main application I am adding many of these custom components to
a VBOX, here is that code snippit

for (var i:int = 0; imodelLocator.RoomModelCollection.length; i++){
var newRoom:RoomView = new RoomView()
newRoom.data = 
modelLocator.RoomModelCollection.getItemAt(i);
if(allRoomsBox) {
allRoomsBox.addChild(newRoom);
}
}


Thanks for any help

Don



[flexcoders] Generic itemRenderer for Canvas based controls

2008-12-04 Thread simonjpalmer
I have a TileList control that I want to populate at runtime with a
collection of custom controls determined by preferences held on the
user which I retrieve after they log in.  All of the custom controls
are based on Canvas.  

My current approach is to have an Array into which I push the
appropriate controls after login success and bind that array as the
dataProvider on my TileList control.  The trouble is that the controls
don't get rendered because there is no itemRenderer defined for the
TileList.

So I attempted to create a generic itemRenderer based on Canvas which
overrides the set data() method and adds the inbound control as a child...

override public function set data(value:Object):void
{
if (value == null) return;
var cvs:Canvas = value as Canvas;
this.addChild(cvs);
}

However, this throws index out of bounds errors doing a getChild(0)
deep in the bowels of the framework code associated with the dynamic
itemRenderer component, which I don't seem to be able to overcome in
spite of altering the sequence in which things get created, and
fiddling around with the creationPolicy of the custom controls.

So I'm a bit stuck and wondering whether there is a different approach
or I'm just doing something wrong.

Any ideas?



[flexcoders] Re: Flex and Java Communication

2008-12-04 Thread simonjpalmer
--- In flexcoders@yahoogroups.com, saritha [EMAIL PROTECTED] wrote:

 Hi,
 
 How to communicate between Flex and Java?


There are two main ways and which you choose depends largely on the
future needs of your clients.  

If you need a generic API on your server because you are going to
implement a variety of clients, or you want to open up your
application for other people to code against, then a web service on
the Java end and HTTPService in your Flex code is definitely the way
to go.

However, if you are looking for speed and small packet size and
squeezing the most out of your app, then you should use AMF via RPC,
i.e. remote objects and BlazeDS.  You'll have a tight binding between
your types on both sides and the API can be very clean and tailored
specifically to your needs.  I find it more elegant and there's less
code to maintain.

I have used both but prefer the remote object approach as I think that
coding for possible future scenarios tends to unnecessarily dilute my
current app and I'd prefer to take the performance advantages of AMF.
 It's a trade-off I am happy to make and you need to make the same
judgement.



[flexcoders] Re: Footer row with a DataGrid

2008-12-04 Thread simonjpalmer
I also looked at Alex's code and decided I wanted something a little
more suited to my peculiar needs.  I implemented a custom control
which has two data grids, one for the data and one for the totals at
the bottom.  I also added some fancy code to cope with making totals
in different ways (e.g. aggregating averages - the old sum(x)/n vs
sum(x/n) problem) and to handle formatting.

It is not as clean an interface as I would like, but it is pretty
useful and it now appears in lots of places in my UI.  There is a
known bug where the column widths are misaligned when trhe control
first shows, but my users seems to be able to live with that.

If you contact me at simon.palmer @ gmail.com I'll send you some code
and you can perhaps adopt it for your own needs.  If I could figure
out a host who would allow swf's I'd post it on my blog.

--- In flexcoders@yahoogroups.com, Guy Morton [EMAIL PROTECTED] wrote:

 Hi people
 
 What is the best way to achieve a footer row in a DataGrid?
 
 I want to be able to set the values in the footer row myself, ie I  
 don't need it to do any fancy calculations.
 
 I found this:
 
 http://blogs.adobe.com/aharui/2008/03/flex_3_datagrid_footers.html
 
 Does anyone have a better idea as to how to proceed?
 
 TIA
 
 Guy





[flexcoders] Re: Parallel requests using RemoteObject with RTMP

2008-12-04 Thread Juan Carlos M.
More information here:
http://bugs.adobe.com/jira/browse/BLZ-184

HTTPChannel does process requests in parallel because it uses
flash.net.URLLoader under the covers which does not batch requessts
(only flash.net.NetConnection batches requests and that is used by
AMFChannel as Seth explained).

any workaround?

--- In flexcoders@yahoogroups.com, mmormando [EMAIL PROTECTED] wrote:

 It doesn't have anything to do with Flex, its IE. IE 6 and I believe
 7, and Firefox 2 all default to only allow 2 downloads from a single
 subdomain. I got that from the folks at Yahoo that bring us the YSlow
 stuff. If you are using an Apache front end you could make your
 request to multiple subdomains, e.g. data1.yourdomain.com and
 data2.yourdomain.com would let you go to 4, conversely if you have
 control of all the computers hitting your service there are registry
 tweaks you can set, something along the lines of
 max_server_connections, that's from memory so don't take it as
 doctrine. I've also read that IE 8 beta defaults to something like 30.
 I'm using Firefox 3 and set it to 30, as well as allowed it to use
 http pipelining, up to 30 requests per socket, and things seem to just
 scream!!
 Good luck
 Mike





[flexcoders] Re: Parallel requests using RemoteObject with RTMP

2008-12-04 Thread Juan Carlos M.
More information here:
http://bugs.adobe.com/jira/browse/BLZ-184

Steps to reproduce:
1. Make a series of call to the destination through RemoteObject.
2. Player will batch them up and send in one HTTP request
3. Server will process those request sequentially and response only
after all the request are finished.

that is the same issue for me
- I'm using RemoteObject with amfphp
- Concurrency.MULTIPLE doesn't work.
- this technique neither works
http://weblogs.macromedia.com/pent/archives/2005/02/operating_in_pa.html
  
HTTPChannel does process requests in parallel because it uses
flash.net.URLLoader under the covers which does not batch requessts
(only flash.net.NetConnection batches requests and that is used by
AMFChannel as Seth explained).

any workaround?

--- In flexcoders@yahoogroups.com, mmormando [EMAIL PROTECTED] wrote:

 It doesn't have anything to do with Flex, its IE. IE 6 and I believe
 7, and Firefox 2 all default to only allow 2 downloads from a single
 subdomain. I got that from the folks at Yahoo that bring us the YSlow
 stuff. If you are using an Apache front end you could make your
 request to multiple subdomains, e.g. data1.yourdomain.com and
 data2.yourdomain.com would let you go to 4, conversely if you have
 control of all the computers hitting your service there are registry
 tweaks you can set, something along the lines of
 max_server_connections, that's from memory so don't take it as
 doctrine. I've also read that IE 8 beta defaults to something like 30.
 I'm using Firefox 3 and set it to 30, as well as allowed it to use
 http pipelining, up to 30 requests per socket, and things seem to just
 scream!!
 Good luck
 Mike





[flexcoders] Re: Parallel requests using RemoteObject with RTMP

2008-12-04 Thread Juan Carlos M.
More information here:
http://bugs.adobe.com/jira/browse/BLZ-184

I have a similar issue

Steps to reproduce:
1. Make a series of calls to the destination through RemoteObject.
2. Player sends only 2 http requests at a time. The other calls remain
in a queue 
(We expected a more parallel behavior of the RemoteObject)

My environment:
- I'm using RemoteObject with amfphp
- Concurrency.MULTIPLE doesn't work.
- this technique neither works
http://weblogs.macromedia.com/pent/archives/2005/02/operating_in_pa.html

HTTPChannel does process requests in parallel because it uses
flash.net.URLLoader under the covers which does not batch requessts
(only flash.net.NetConnection batches requests and that is used by
AMFChannel as Seth explained).

any workaround?




--- In flexcoders@yahoogroups.com, mmormando [EMAIL PROTECTED] wrote:

 It doesn't have anything to do with Flex, its IE. IE 6 and I believe
 7, and Firefox 2 all default to only allow 2 downloads from a single
 subdomain. I got that from the folks at Yahoo that bring us the YSlow
 stuff. If you are using an Apache front end you could make your
 request to multiple subdomains, e.g. data1.yourdomain.com and
 data2.yourdomain.com would let you go to 4, conversely if you have
 control of all the computers hitting your service there are registry
 tweaks you can set, something along the lines of
 max_server_connections, that's from memory so don't take it as
 doctrine. I've also read that IE 8 beta defaults to something like 30.
 I'm using Firefox 3 and set it to 30, as well as allowed it to use
 http pipelining, up to 30 requests per socket, and things seem to just
 scream!!
 Good luck
 Mike





[flexcoders] errorTip fontSize break the tooltip? Possible bug?

2008-12-04 Thread fotis.chatzinikos
Hi, the following works:

.errorTip 
{
color: #FF;
/*fontSize: 11;*/
fontWeight: bold;
shadowColor: #00;
borderColor: #FF;
borderStyle: errorTipAbove;
paddingBottom: 4;
paddingLeft: 4;
paddingRight: 4;
paddingTop: 4;
}

If I un-comment fontSize, the font gets bigger but the tooltip text
gets outside of the tooltips 'area'. Ie text length is 200 pixels and
tooltips area 150 pixels... Is the tooltip's area calculations
hardcoded to font size 9?

Fotis



[flexcoders] itemrenderer rollover event seems no sensitive

2008-12-04 Thread Fu Di
hello everyone

i wrote a itemrenderer in datagird  which extends DataGridItemRenderer, and i 
listened MouseEvent.ROLL_OVER and MouseEvent.ROLL_OUT events. but when the 
mouse rollover the  itemrenderer it is not sensitive, may be the mouse just 
over the  itemrenderer's character 
it will be triggered.

 thanks 


foodyi



  

RE: [flexcoders] Re: Embedding fonts dynamically...

2008-12-04 Thread Wildbore, Brendon
Hi,

One way of achieving this is two have a number of different stylesheets with 
the embedded fonts in them.
Use the stylemanager class to change the stylesheet to display the font you 
would like.

Eg.

var oldStyleFile:String = /css/basicfont.swf;

try{
  StyleManager.unloadStyleDeclarations(oldStyleFile);
}catch(err:Error){trace(error removing oldStyleFile style);}

//add new theme
var newStyleFile:String = /css/funkyfont.swf;

try{
  StyleManager.loadStyleDeclarations(newStyleFile);
}catch(err:Error){trace(error loading newStyleFile style);}


Hope this helps




From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
tchredeemed
Sent: Thursday, 4 December 2008 7:37 a.m.
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Embedding fonts dynamically...


How would I do that?

Also, do you know of any way to tell if the user has a font already,
and I will only embed it if they need it (don't want to load a font
that they already have...)



Re: [flexcoders] how can i get a columnIndex from an item in my TileList?

2008-12-04 Thread Aaron Hardy
Just a thought (though not an answer), it might be a better idea if within
your custom tooltip component you evaluated the space needed by your tooltip
compared to the space between your cursor and the side of the stage, then
move the tooltip accordingly.  That way you're taken care of regardless of
the position or size of your tilelist or the items inside the tilelist.
Hope that's relevant.

Aaron

On Wed, Dec 3, 2008 at 11:21 AM, blc187 [EMAIL PROTECTED] wrote:

   I have a TileList that displays images.
 I'd like to be able to mouseover one of the images and get the index
 of the column it's in.
 Is there any way to get a row or column index on MouseOver?

 For context, I am displaying a custom tooltip on mouseover and I'd
 like to be able to tell if I'm mousing over the last image in the row
 so that I can prevent my tooltip from displaying offscreen.

  



[flexcoders] IE 6 and flash player 10 - will not open deployed Flex application URL

2008-12-04 Thread joseph_freemaker
Deployed a FB 3.0.2/Flex SDK 3.2 application for flash player 10.

One workstation using IE6 can open the flex application running from
Tomcat.

Others using IE6 cannot load the flex application URL. They get a
blank screen.

All of the IE6 browsers are at similar IE6 release levels, have popup
blocking off, and javascript enabled. 

The only difference is that the working workstation lists a Flash
Player 10 Plugin installed. 

The others have a Shockwave Flash Object 10 installed.

Has any one encountered this issue? Is so what is the solution and how
does one trouble shoot this type issue?

Thanks in advance.



[flexcoders] Re: WebService using a bindable hostname

2008-12-04 Thread fishburn_david
I managed to get this working finally.

I couldn't manage to change it with any of the options I listed.

But what did work was using the FlexBuilder 3 interface and importing
the WebService.  Then using the code it called.

Fairly significant work around, but it did work.






[flexcoders] Components as chart annotationElements

2008-12-04 Thread moardonuts
Hello all,

I have a chart with a few annotation elements.  The first is a canvas that 
covers the whole 
thing and does stuff like allowing me to drag the chart around. Then I added 
another 
canvas that contained a box.  Basically I'm working out away to add some 
draggable 
vertical cursors. I wasn't liking the mouseOver behavior of the VRule; It only 
fired on the 
edges and not over the magical box between the edges.  So, I made a 2 pixel 
wide Box 
with a filled in background (seems a little ghetto, I know).  It worked right 
when wrapped 
in a Canvas with 100% height and width.

So as a little proof of concept, the following code worked how I wanted.  The 
chart was 
draggable everywhere except when the mouse was directly over the cursors.

mx:annotationElements  
 mx:Canvas id=chartArea width=100% height=100% buttonMode=true
  mouseDown=initiateDrag(theChart) /
 mx:Canvas width=100% height=100%
   mx:Box id=cursor x=50 height=100% width=2 
   backgroundColor=#00 /
 /mx:Canvas
/mx:annotationElements


As I wanted to add more properties and logic to the cursor, I extracted it out 
into a 
component.  Now the component is a Canvas base, with the Box in it just as 
above, and 
some actionScript.  And the above code now looks like:

mx:annotationElements
 mx:Canvas id=chartArea width=100% height=100% buttonMode=true
  mouseDown=initiateDrag(theChart) /
 local:Cursor id=cursor x=50 width=10 /
/mx:annotationElements

The problem is that now, no matter how I set widths (in the main app or within 
the 
component), cursor covers chartArea starting at x and extending right to 
the end.  The 
box width within the component works fine, but the whole canvas acts like 100% 
width 
starting at x, no matter what.  That prevents the dragging and mouseOver 
behaviors I 
want on chartArea.  So for example, with the above, I can drag the chart as 
long as I press 
the mouseDown between 0 and 49 for x, and anywhere from 50 and beyond fires the 
mouseOver for the cursor instead.  If you add more than one cursor, the 
layering 
continues in the same manner.

So my question is, why does extracting it out to a component change that?   
What should I 
be doing to get the original behavior where the whole component can just be the 
width I 
set? 


Thanks!



[flexcoders] Draw a threshold line on a chart

2008-12-04 Thread lyonjudah
Hello,
I need to be able to draw a horizontal line (threshold) starting from 
a specific value on the Y axis, across the width of the chart. The 
value is set by the user, and when the chart first displays the line 
is not to show. Once the user input the threshold number the line 
displays.  I've tried the examples that show the line between two data 
points, but that doesn't work if there is on one column of data on the 
chart, and I'm being pressed to display the line the whole width of 
the chart, not just between columns.  Help.  Thanks in advance for all 
your help.



[flexcoders] handle large data sets from SOAP service

2008-12-04 Thread Michelle Davis
Hi all,

Can someone show me sample on how to handle large data sets from SOAP service?  
I'm desperate 
for helps.
 
Thanks,
Michelle.


  

[flexcoders] How do i implement e4x like filters in my custom class

2008-12-04 Thread ADK
I have built a galaxy of data structures, in a hierarchical order. I 
can easily transverse and zero-on onto the object given a few params.


Now what i want to do is write an E4X like statement like:

var myObject:Object = car.objects().(name() == radiator  @id 
==PART2234  @r==12);

and it calls name() of my carpart object, and retrieve id, r. my 
carpart class is dynamic

Here are a few points on my class.

1. Objects() will return an Array of various car parts like radiator, 
carb, hoses, enginebox etc etc
2. i wanna avoid filtering using filter function callbacks in 
arraycollection. just wanna enable use of e4x like expressions in 
my class
3. all my classes returned by objects() are of type class partbase 
which does not have a base class (like XML, XMLList)


I opened Global.as. and looked at XMLList nd XML class headers.. 
pretty straight, has no base class nothing at all to raise eyebrows.


Oh i get an run time error:

TypeError: Error #1123: Filter operator not supported on type 
com.parts.EngineBlock
an object of com.parts.EngineBlock was in the first of the Objects 
array...

Thanks a ton,


ady




[flexcoders] Flex and iTunes Cover Flow

2008-12-04 Thread Ravichandran J
Dear Friends,
 
Do any articles, books or video tutorials are there to leanr about coverflow in 
flex.
 
Thanking you,
 
Ravichandran J
Bangalore


  

[flexcoders] Re: how to play partially downloaded local flv file ?

2008-12-04 Thread cedvilleneuve
Thank you for replying.

Another test was to read the file with another player (VLC) while 
writing to it as described in my original post. And this worked. 

So the problem is more with the flash video player than with the 
stream used for writing the file.
I tried live option with no more success on the video player.
It seems that it behaves differently when reading local file and when 
reading a stream from http or rtmp server.

Any ideas ?



[flexcoders] Resetting an application's view for new user

2008-12-04 Thread Aaron Hardy
Hey flexers,

I have a hefty AIR application with many different view combinations, 
forms filled with data, etc.  When a user logs out and a different user 
logs in, I need the application to be reset so that everything looks 
as though no other user was previously logged in.  I've ran into two 
solutions:

1) Reset all the forms, views, etc to their original state when the 
first user logs out.  This can be tricky getting everything back to its 
initial state.
2) Make the main view (what would be the main application file in option 
#1) a separate component.  When the user logs out, let the whole 
component get garbage collected.  When the new user logs in, 
reinstantiate the main view to ensure its all in its initial state once 
again.  With this option, there's not as much worrying about whether 
you've successfully reset everything since it's a brand new instance.  
However, processing time and memory management may be a new issue to 
deal with.

So, I'm curious, how do you folks go about this in your projects?  Thanks!

Aaron


[flexcoders] Re: Fwd: Filtering the List Entries depending upon the text entered in text Input box

2008-12-04 Thread david.keutgens
--- In flexcoders@yahoogroups.com, anuj181 [EMAIL PROTECTED] wrote:

 --- In flexcoders@yahoogroups.com, anuj181 anuj181@ wrote:
 
 Hi All
 This is somehow regarding the question I have asked few weeks back.
 Unfortunately I have to stop this task at that time and now need to
 work on that. My need is that I have some entries in the List as an
 arrayCollection and there is text input box and I like to have list to
 filter the data as soon as user starts typing text. I have attached
 the so far developed code. I need as soon as user types On, the list
 below should only show first entry which is 'One-Device'. I attached
 the code but it is not working as I want. This is going to be just my
 dummy working prototype and once this module has been made working
 then i am going to merge this module into my Main Project.
 
 Also if anyone has any better idea about how to figure this thing out
 that will be great and instead of arrayColection if we can achieve the
 same function laity that would be helpful too.
 Thanks a lot
 Anuj 
 
 /**CODE/
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
   layout=absolute
   initialize=init() 
   width=100% height=100%
   horizontalScrollPolicy=off
 mx:Script
   ![CDATA[   
   
 import mx.managers.PopUpManager;
 import mx.effects.DefaultTileListEffect;  
 import mx.rpc.events.ResultEvent;
 import mx.controls.Alert;
 import mx.collections.ArrayCollection;
 import mx.effects.easing.Elastic;
 
 [Bindable]
 public var ac:ArrayCollection = new

ArrayCollection([One-Device,Two-Device,Three-Device,Four-Device,Five-Device,Six-Device]);
   
 [Bindable]
 public var filterText:String = '';
   
   private function doChange():void
 {
 this.filterText = txtSearch.text;
 this.ac.refresh();
 }
 
 private function init():void
 {
 ac.filterFunction = processFilter; 
 }
 private function processFilter(item:Object):Boolean
 {
   var result:Boolean=false;
   if(!DevicesList.labelField.length ||

DevicesList.labelField.toUpperCase().indexOf(this.filterText.toUpperCase())=0)
   result=true;
   
   return result;
 }
 private function seeLabel(evt:Event):void
 {
   var alrt:Alert=Alert.show(evt.currentTarget.toString());
 }
 
   ]]
 /mx:Script
   mx:List x=74 y=228 width=229 height=238 dataProvider={ac}
 id=DevicesList/mx:List
   mx:TextInput x=74 y=198 id=txtSearch change=doChange()/
   
   
 /mx:Application
 
 --- End forwarded message ---



When a collection gets filtered, the filter function is applied to
each item of a collection separately. So the passed parameter for the
filter function is always an item of your collection. In your case the
collection contains strings. The filter function receives the string,
all you have to do in the function is to compare it to your filterText
string.

To do that Josh casted the passed parameter as a string to compare it
to the filterText variable.

-- 
david keutgens
software consultant
cynergy australia

web | http://www.cynergysystems.com.au





[flexcoders] Checkbox in a DataGrid - how check without selecting the line.

2008-12-04 Thread garyq22
Hi Everyone

I have a CheckBox set as the renderer/editor for a column in my
DataGrid and I would like users to be able to check and uncheck the
boxes on different rows without selecting or changing the selection of
the current grid row.

Is this possible? Any help would be very much appreciated.

Thanks

Gary Q




[flexcoders] Re: People with blogs

2008-12-04 Thread oneworld95
The main things that bust code listings are the  and  signs. Use the
ASCII codes for these: lt; and gt; to have them generate correctly.
Here's my blog post about it; although it's for Blogger posts, it
should also work for Wordpress:
http://devharbor.blogspot.com/2008/10/how-to-display-html-in-blogger-posts.html

-Alex

--- In flexcoders@yahoogroups.com, Nate Pearson [EMAIL PROTECTED] wrote:

 Sorry this is a little off topic.  I'm trying to start a flex blog
but I'm not sure how to copy code 
 from flex builder into Wordpress and have the formating stay the
same.  Is there some plugin 
 that you use?  How do you guys do it?
 
 Thanks a lot!
 
 -Nate





RE: [flexcoders] What Am I doing Wrong, View will not update when bound data is changed.

2008-12-04 Thread Dimitrios Gianninas
Is the [Bindable] tag present at the top of the RoomModel declaration?
 
Dimitrios Gianninas
RIA Developer Team Lead
Optimal Payments Inc.
 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of donvoltz
Sent: Thursday, December 04, 2008 4:06 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] What Am I doing Wrong, View will not update when bound 
data is changed.



Using Cairngorm, I am maintaining an ArrayCollection of a custom data
type. This data is bound to the view, however, when I update the data
in the ArrayCollection, the view is not updated until I redraw all of
the custom components. Is there a way for each component to respond
when I modify the data?

Here is the code

CUSTOM COMPONENT

?xml version=1.0 encoding=utf-8?
mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml 
http://www.adobe.com/2006/mxml  width=100%
height=100% borderStyle=outset cornerRadius=20
mx:Script
![CDATA[
import com.dynamicmedicalventures.or_metrics.RoomModel;
import mx.events.FlexEvent;

[Bindable]
private var _data:RoomModel;

override public function set data(value:Object):void{
if(value != null){
super.data = value;
this._data = value as RoomModel;
}
dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
super.invalidateProperties();

}

override protected function commitProperties():void {
super.commitProperties();
if(data != _data){
_data = data as RoomModel;
}
}


]]
/mx:Script

mx:Label x=10 y=10 fontSize=14 fontWeight=bold
id=roomTitle text={_data.roomData.roomName}/
mx:Image x=846 y=10 id=roomStatus/
mx:List x=10 y=86 width=580 height=312 id=caseList
dragEnabled=true dropEnabled=true dataProvider={_data.caseList} /
mx:Label x=10 y=60 text=Case List/
mx:Label x=618 y=60 text=Main Staff/
mx:Label x=618 y=204 text=Misc Staff/
mx:List x=618 y=86 width=163 id=mainList height=110
dataProvider={_data.mainStaff} /
mx:List x=619 y=230 id=miscList width=163 height=110
dataProvider={_data.miscStaff} /
mx:Label x=10 y=415 text=Equipment List/
mx:HorizontalList x=10 y=441 width=580
dataProvider={_data.equipmentList} /
mx:Label x=619 y=360 text=Messages amp; Alerts/
mx:TextArea x=619 y=389 width=259 height=112/

/mx:Canvas

In the main application I am adding many of these custom components to
a VBOX, here is that code snippit

for (var i:int = 0; imodelLocator.RoomModelCollection.length; i++){
var newRoom:RoomView = new RoomView()
newRoom.data = modelLocator.RoomModelCollection.getItemAt(i);
if(allRoomsBox) {
allRoomsBox.addChild(newRoom);
}
}

Thanks for any help

Don



 

-- 
WARNING
---
This electronic message and its attachments may contain confidential, 
proprietary or legally privileged information, which is solely for the use of 
the intended recipient.  No privilege or other rights are waived by any 
unintended transmission or unauthorized retransmission of this message.  If you 
are not the intended recipient of this message, or if you have received it in 
error, you should immediately stop reading this message and delete it and all 
attachments from your system.  The reading, distribution, copying or other use 
of this message or its attachments by unintended recipients is unauthorized and 
may be unlawful.  If you have received this e-mail in error, please notify the 
sender.

AVIS IMPORTANT
--
Ce message électronique et ses pièces jointes peuvent contenir des 
renseignements confidentiels, exclusifs ou légalement privilégiés destinés au 
seul usage du destinataire visé.  L'expéditeur original ne renonce à aucun 
privilège ou à aucun autre droit si le présent message a été transmis 
involontairement ou s'il est retransmis sans son autorisation.  Si vous n'êtes 
pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, 
veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses 
pièces jointes, de votre système.  La lecture, la distribution, la copie ou 
tout autre usage du présent message ou de ses pièces jointes par des personnes 
autres que le destinataire visé ne sont pas autorisés et pourraient être 
illégaux.  Si vous avez reçu ce courrier électronique par erreur, veuillez en 
aviser l'expéditeur.



[flexcoders] Re: Draw a threshold line on a chart

2008-12-04 Thread simonjpalmer
Try Ely Greenfield's DataDrawingCanvas which is available on
quietlyscheming.com.  You can put pretty much what you want where you
want with that approach.

--- In flexcoders@yahoogroups.com, lyonjudah [EMAIL PROTECTED] wrote:

 Hello,
 I need to be able to draw a horizontal line (threshold) starting from 
 a specific value on the Y axis, across the width of the chart. The 
 value is set by the user, and when the chart first displays the line 
 is not to show. Once the user input the threshold number the line 
 displays.  I've tried the examples that show the line between two data 
 points, but that doesn't work if there is on one column of data on the 
 chart, and I'm being pressed to display the line the whole width of 
 the chart, not just between columns.  Help.  Thanks in advance for all 
 your help.





[flexcoders] Re: flex login popup help needed pleaseeeeeeeee

2008-12-04 Thread valdhor
I think that there is enough info in this thread for you to make a
start. I showed you how to create the popup login window. You can
return a success or failure code from your coldfusion code. When this
comes back you change the state to your admin state on success or
throw up an alert box on failure.

You should start your coding with what you know and when you come
across a problem, post the problematic code and we will try to help.

HTH


Steve


--- In flexcoders@yahoogroups.com, stinasius [EMAIL PROTECTED] wrote:

 thanks but that post does not really shed light on how to develop a
 simple login system in flex and coldfusion where login details like
 username and password are stored and pulled from a database. bruce
 phillps

http://www.brucephillips.name/blog/index.cfm/2007/3/16/Developing-A-Login-System-For-A-Flex-Application-With-A-ColdFusion-and-Database-Backend-Part-1;
 has a good example bt the only thing i need to know is how to handle
 login success from a popup login window. for example if i have a main
 application with a view stack that has two views the first one a
 general view and the second one an admin view where one has to click
 on a button on the main application to get a popup login window to
 login to see the admin view. thanks





Re: [flexcoders] Re: People with blogs

2008-12-04 Thread Peter Witham
I have been using the CodeHighlighter plug-in for WordPress
http://ideathinking.com/wiki/index.php/WordPress:CodeHighlighterPlugin

For a little while now and love it, you can see it in action at my site
www.uibuzz.com

Hope this helps,
Peter.

On Thu, Dec 4, 2008 at 7:27 AM, oneworld95 [EMAIL PROTECTED] wrote:

   The main things that bust code listings are the  and  signs. Use the
 ASCII codes for these: lt; and gt; to have them generate correctly.
 Here's my blog post about it; although it's for Blogger posts, it
 should also work for Wordpress:

 http://devharbor.blogspot.com/2008/10/how-to-display-html-in-blogger-posts.html

 -Alex

 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Nate
 Pearson [EMAIL PROTECTED] wrote:
 
  Sorry this is a little off topic. I'm trying to start a flex blog
 but I'm not sure how to copy code
  from flex builder into Wordpress and have the formating stay the
 same. Is there some plugin
  that you use? How do you guys do it?
 
  Thanks a lot!
 
  -Nate
 

  




-- 
Peter Witham
http://www.evolutiondata.com
Internet and Multimedia developer
Certified Flash Designer.


[flexcoders] Flex with virtual frame buffer

2008-12-04 Thread netdeep
I have to run an automated version of my flex app on a headless server so I'm 
using a virtual frame buffer (Xvfb) running on 
Solaris in an oc4j container.

I can get the following command to 'apparently' launch the app:

String cmd = /bin/sh DISPLAY=:5  /opt/sfw/bin/firefox + url+ -width 1600 
-height 1200;

I say apparently because it does not cause any errors.  But when I send 
messages to the flex app via BlazeDS for it to do it's 
thing...they never get there.  I know the program works because it is fine in 
my localhost development environment, but 
how do I get the app to launch with a virtual frame buffer or more generally, 
on a headless server?





[flexcoders] Re: Auto expand TreeView on open - How?

2008-12-04 Thread valdhor
Taking the Expanding a Tree Node example from the Flex 3 Tree Control
help at
http://livedocs.adobe.com/flex/3/html/help.html?content=dpcontrols_8.htm\
l and modifying it slightly I get this example:

?xml version=1.0?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute
 creationComplete=initApp()
 mx:Script
   ![CDATA[
 import mx.collections.XMLListCollection;

 [Bindable] private var treeData:XML =
 root
 node label=Monkeys
 node label=South America
 node label=Coastal/
 node label=Inland/
 /node
 node label=Africa isBranch=true/
 node label=Asia isBranch=true/
 /node
 node label=Sharks
 node label=South America isBranch=true/
 node label=Africa isBranch=true/
 node label=Asia 
 node label=Coastal/
 node label=Inland/
 /node
 /node
 /root;

 private function initApp():void
 {
 var nodeList:XMLListCollection = myTree.dataProvider as
XMLListCollection;
 var nodes:XMLList = nodeList.source;
 expandSubNodes(nodes);
 }

 private function expandSubNodes(nodes:XMLList):void
 {
 for(var i:int = 0 ; i  nodes.length() ; i++)
 {
 var n:XML = nodes[i];
 if(n.children() != null)
 {
 myTree.expandItem(n,true,false);
 expandSubNodes(n.children());
 }
 else
 {
 break;
 }
 }
 }
   ]]
 /mx:Script
 mx:Tree id=myTree y=50 width=221 height=257
horizontalCenter=0
 dataProvider={treeData.node} labelField=@label/
/mx:Application

HTH



Steve


--- In flexcoders@yahoogroups.com, pbrendanc [EMAIL PROTECTED] wrote:

 I want to auto expand my menu treeview immediately on open - the
 following code is called from thecreationComplete=initTree(); and
 expands the first node only.

 Is there a way to expand all nodes - I can't seem to get this to work.
 (Other have reported problems so I wonder if this is supported)?

 TIA,
 Patrick

 (The data provider for the tree is an XMLList)

  mx:XMLList id=menuData 
  node label=Data Management
   node label=Registration/
   node label=Customer List/
  /node
  node label=System Administration
   node label=Add Users/
  /node


 private function initTree():void {

 //Expands first visible Tree Item
 menuTree.expandItem(menuTree.firstVisibleItem,true);
 }




[flexcoders] Re: handle large data sets from SOAP service

2008-12-04 Thread valdhor
I don't know about everybody else, but I could do with some more details.

Are you having problems getting the data, displaying it or something else?

What do you mean by handle?

If you could expand on what you are trying to do we may be able to
point you in the right direction.


Steve


--- In flexcoders@yahoogroups.com, Michelle Davis [EMAIL PROTECTED] wrote:

 Hi all,
 
 Can someone show me sample on how to handle large data sets from
SOAP service?  I'm desperate 
 for helps.
  
 Thanks,
 Michelle.





[flexcoders] Can a control be a child of more than one parent?

2008-12-04 Thread simonjpalmer
I have a set of controls that I want to share between two different
containers, one ViewStack and one Repeater.  I create the controls
inline as children of the ViewStack and then I pass their references
to a custom ItemRenderer in the Repeater.  In the custom ItemRenderer
I add them as a child.  

When I inspect the parent property in the debugger I see that it is
the itemRendererer and not their original parent.  Is that to be
expected?  Can a control be a child of more than one parent?



Re: [flexcoders] Can a control be a child of more than one parent?

2008-12-04 Thread Paul Andrews
- Original Message - 
From: simonjpalmer [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, December 04, 2008 2:50 PM
Subject: [flexcoders] Can a control be a child of more than one parent?


I have a set of controls that I want to share between two different
 containers, one ViewStack and one Repeater.  I create the controls
 inline as children of the ViewStack and then I pass their references
 to a custom ItemRenderer in the Repeater.  In the custom ItemRenderer
 I add them as a child.

 When I inspect the parent property in the debugger I see that it is
 the itemRendererer and not their original parent.  Is that to be
 expected?  Can a control be a child of more than one parent?

A control can only have one parent on the display list, though there can be 
multiple references to a control. I'm not sure if I entirely follow your 
description though.

If  you have controls sitting in two different containers, they will be 
different instances of the control.

Paul 



RE: [flexcoders] Flash being cached

2008-12-04 Thread Robert Byrne

In IE:

Tools - General - Settings (Temporary Internet Files) - Every visit to the 
page (first radio option)

Personally I liked the HTML wrapper option best as a solution for developers 
and clients.  

--- On Tue, 12/2/08, Wildbore, Brendon [EMAIL PROTECTED] wrote:
From: Wildbore, Brendon [EMAIL PROTECTED]
Subject: RE: [flexcoders] Flash being cached
To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com
Date: Tuesday, December 2, 2008, 2:57 PM








 
 







If you have the developer toolbar plugin installed
on firefox, use that to disable the browser cache (make sure there is a tick
next to disable cache under the disable dropdown)… works like a charm for
me. 

   









From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of flexaustin

Sent: Wednesday, 3 December 2008
5:28 a.m.

To: flexcoders@yahoogroups.com

Subject: [flexcoders] Flash being
cached 



   







Is there a way to prevent your swf file from being
cached? I would

like to prevent this in production and when using the template files

(in bin-debug and bin-release) . When using these two html files my

browser seems to cache the swf requiring me to do a couple of

cntrl-r's and sometimes a clear cache in Firefoxs options.



Anyone else have this issue?  







 






  

Re: [flexcoders] People with blogs

2008-12-04 Thread Aaron Hardy
For Wordpress I use the WP-Syntax plugin.  Here's an example of what it
turns out like:

http://aaronhardy.com/flex/finding-the-nearest-component-in-flex/

Now if I could just get more width on my page and less width on my code. :P

Aaron

On Wed, Dec 3, 2008 at 9:42 PM, Nate Pearson [EMAIL PROTECTED] wrote:

   Sorry this is a little off topic. I'm trying to start a flex blog but
 I'm not sure how to copy code
 from flex builder into Wordpress and have the formating stay the same. Is
 there some plugin
 that you use? How do you guys do it?

 Thanks a lot!

 -Nate

  



Re: [flexcoders] Re: handle large data sets from SOAP service

2008-12-04 Thread Michelle Davis
Hi Steve,
Thanks for reading my email.

The problems I'm having are how to get million of records from web service thru 
SOAP and display those records thru pagination.
  
Currently I’m using ArrayCollection to store the data after receive from the 
server thru SOAP service and using DataGrid to display.  When the data contains 
5000+ records it chokes up.
 
Thanks,
Michelle.
  



 




From: valdhor [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, December 4, 2008 6:28:34 AM
Subject: [flexcoders] Re: handle large data sets from SOAP service


I don't know about everybody else, but I could do with some more details.

Are you having problems getting the data, displaying it or something else?

What do you mean by handle?

If you could expand on what you are trying to do we may be able to
point you in the right direction.

Steve

--- In [EMAIL PROTECTED] ups.com, Michelle Davis [EMAIL PROTECTED] . wrote:

 Hi all,
 
 Can someone show me sample on how to handle large data sets from
SOAP service?  I'm desperate 
 for helps..
  
 Thanks,
 Michelle.


 


  

[flexcoders] Re: Draw a threshold line on a chart

2008-12-04 Thread Oscar Cortes


   I had to solve the same problem some time ago and entered this post in
the Flex Cookbook:

Drawing a horizontal line across a columnChart

http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails\
postId=2041productId=2loc=en_US
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetail\
spostId=2041productId=2loc=en_US

Oscar Cortes

http://www.holaflex.com http://www.holaflex.com

--- In flexcoders@yahoogroups.com, lyonjudah [EMAIL PROTECTED] wrote:

 Hello,
 I need to be able to draw a horizontal line (threshold) starting from
 a specific value on the Y axis, across the width of the chart. The
 value is set by the user, and when the chart first displays the line
 is not to show. Once the user input the threshold number the line
 displays. I've tried the examples that show the line between two data
 points, but that doesn't work if there is on one column of data on the
 chart, and I'm being pressed to display the line the whole width of
 the chart, not just between columns. Help. Thanks in advance for all
 your help.





Re: [flexcoders] Flex and iTunes Cover Flow

2008-12-04 Thread Jules Suggate
Hi Ravichandran,

Yep, check out http://dougmccune.com/blog/2007/11/03/coverflow-flex-component/

:)

J


On Fri, Dec 5, 2008 at 01:40, Ravichandran J [EMAIL PROTECTED] wrote:
 Dear Friends,

 Do any articles, books or video tutorials are there to leanr about coverflow
 in flex.

 Thanking you,

 Ravichandran J
 Bangalore
 


RE: [flexcoders] Flex TextArea Limited by number of lines.

2008-12-04 Thread Keith Reinfeld
My approach is to simply reject any change that would exceed the maxLines
setting. 

The following is presented sans the requisite class structure. 
Create a component that extends TextArea, then:  

var tf:TextField = TextField(this.textField);
var maxLines:uint = 5; // however many lines (getter/setter)
var storedInput:String = ;

private function onChange(event:Event):void
{
if (tf.numLines  maxLines)
{
tf.text = storedInput;
}else{
// Handle editable TextArea bugs
storedInput = tf.text;
 } 
}

Issues: 
There is a bug in the TextArea component (editable=true) where any given
line will fail to wrap so long as the last character in the line is a space
(also, the insertion cursor disappears beyond the right edge of the field.)
But this can be managed. 
Using htmlText just makes a mess (the insertion cursor has a mind of its
own.)  
Regards, 

-Keith 
http://keithreinfeld.home.comcast.net
http://keithreinfeld.home.comcast.net/ 
 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Gordon Smith
Sent: Wednesday, December 03, 2008 7:27 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Flex TextArea Limited by number of lines.

This hasn't been a common request. What is your use case for allowing a user
to type up to, say, three lines but no more? Most UIs I've seen limit the
number of characters you can type, not the number of lines.
 
I think you have two choices: use the 'textInput' event to limit the amount
of text that goes in, or use the 'change' event to remove excess text that
has already gone in.
 
Which are you trying, and what problems are you running into?
 
Gordon Smith
Adobe Flex SDK Team
 
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of tchredeemed
Sent: Wednesday, December 03, 2008 7:09 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Flex TextArea Limited by number of lines.
 
Has anyone ever done this? Seen any tutorials on this? It seems that a
good amount of people would want something like this.

I keep running into issues with it, and it is very frustrating!
 
attachment: winmail.dat

Re: [flexcoders] Re: Setting a specific row in the ADG to editable vs. the entire grid?

2008-12-04 Thread Adrian Williams

Hi Tim,

   Thanks for the slick move here...that works to do exactly what I 
needed.  It works perfectly for the ADG.


Thanks!
Adrian

Tim Hoff wrote:



Hi Adrian,

As far as I know, you can't allow editing of specific cells/rows by
default. You can however add an event listener for the
itemEditBeginning event. In the event handler function, if the cell/row
meets you're editable criteria, allow the function to set the
editedItemPosition property. Otherwise, call the preventDefault()
method, to prevent editing. I haven't tried this for ADG, but maybe
this will help.

-TH

--- In flexcoders@yahoogroups.com 
mailto:flexcoders%40yahoogroups.com, Adrian Williams [EMAIL PROTECTED] 
wrote:


 Hi All,

 I have a new question that I haven't seen anyone hit yet.

 I have my ADG that is not editable...however, I need to be able to
 make a couple of specific rows editable so the user can modify the
 values in the cells of the row. All of the documentation seems to
 identify setting up columns to be editable and not, but I've not seen
 anything on how to setup a specific row as editable.

 Anyone done this or know the trick?

 Thanks!
 Adrian


 


[flexcoders] Printing ADG - Livedocs code results in printing gray box

2008-12-04 Thread Adrian Williams

Hi all,

   I posted this problem awhile back with no response and am going to 
try again before I call Adobe.  I've seen others with the same issue, 
but no resolutions pending.


   I have used the code from Adobe's labs website:
http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:_Advanced_DataGrid

   The problem is that when using this function, as written, and I try 
to print my ADG, all that is output from the printer is a gray box. Has 
anyone else found the solution to this one?


   Here is the code:

   private function doPrint():void
   {
   var printJob:FlexPrintJob = new FlexPrintJob(); // 
Create an instance of the FlexPrintJob class.
   var printADG:PrintAdvancedDataGrid = new 
PrintAdvancedDataGrid(); // Initialize the PrintAdvancedDataGrid control.
  
   if (printJob.start() == true)

   {
   printADG.includeInLayout = false; // Exclude the 
PrintAdvancedDataGrid control from layout.
   printADG.source = memberRpt; // Provide the data 
source for the report
   addChild(printADG); // Add the print-specific 
control to the application. 
   printJob.addObject(printADG, 
FlexPrintJobScaleType.MATCH_WIDTH); // Add the object to print. Scale it 
to fit width of page.

   printJob.send(); // Send the job to the printer.
   removeChild(printADG); // Remove the print-specific 
control to free memory.

   }
   }

Many thanks,
Adrian


[flexcoders] Re: Invalid Login error connecting to salesforce.com using as3salesforce.swc

2008-12-04 Thread Anthony DeBonis
All my Flex/AS code still works with my ID that I have been using for 
9+months.

I am using as3Salesforce.swc 52KB in size

as3Salesforce.swc is provide by SalesForce.com under 
developer.force.com  so you would need to post a issue with them I 
believe.





Re: [flexcoders]Correction! Printing ADG - Livedocs code results in printing gray box

2008-12-04 Thread Adrian Williams
I pointed to the wrong link.  I am actually using the example given in 
the livedocs material and not the labs.  Here is the correct link:


http://livedocs.adobe.com/flex/3/langref/mx/printing/PrintAdvancedDataGrid.html

Adrian

Adrian Williams wrote:


Hi all,

I posted this problem awhile back with no response and am going to 
try again before I call Adobe.  I've seen others with the same issue, 
but no resolutions pending.


I have used the code from Adobe's labs website:
http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:_Advanced_DataGrid

The problem is that when using this function, as written, and I 
try to print my ADG, all that is output from the printer is a gray 
box. Has anyone else found the solution to this one?


Here is the code:

private function doPrint():void
{
var printJob:FlexPrintJob = new FlexPrintJob(); // 
Create an instance of the FlexPrintJob class.
var printADG:PrintAdvancedDataGrid = new 
PrintAdvancedDataGrid(); // Initialize the PrintAdvancedDataGrid control.
   
if (printJob.start() == true)

{
printADG.includeInLayout = false; // Exclude the 
PrintAdvancedDataGrid control from layout.
printADG.source = memberRpt; // Provide the data 
source for the report
addChild(printADG); // Add the print-specific 
control to the application. 
printJob.addObject(printADG, 
FlexPrintJobScaleType.MATCH_WIDTH); // Add the object to print. Scale 
it to fit width of page.

printJob.send(); // Send the job to the printer.
removeChild(printADG); // Remove the 
print-specific control to free memory.

}
}

Many thanks,
Adrian

 


RE: [flexcoders] Resetting an application's view for new user

2008-12-04 Thread Tracy Spratt
Here is what I do:

  public function logOff():void

  {

var ur:URLRequest = new URLRequest(_sAppUrl);

navigateToURL(ur,_self);

  }//logOff

 

_sAppUrl comes from the browser: location.href

 

Tracy



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Aaron Hardy
Sent: Wednesday, December 03, 2008 10:32 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Resetting an application's view for new user

 

Hey flexers,

I have a hefty AIR application with many different view combinations, 
forms filled with data, etc. When a user logs out and a different user 
logs in, I need the application to be reset so that everything looks 
as though no other user was previously logged in. I've ran into two 
solutions:

1) Reset all the forms, views, etc to their original state when the 
first user logs out. This can be tricky getting everything back to its 
initial state.
2) Make the main view (what would be the main application file in option

#1) a separate component. When the user logs out, let the whole 
component get garbage collected. When the new user logs in, 
reinstantiate the main view to ensure its all in its initial state once 
again. With this option, there's not as much worrying about whether 
you've successfully reset everything since it's a brand new instance. 
However, processing time and memory management may be a new issue to 
deal with.

So, I'm curious, how do you folks go about this in your projects?
Thanks!

Aaron

 



[flexcoders] Design of treeviews

2008-12-04 Thread Haykel BEN JEMIA
Hi,

anyone knows about documents describing the design of tree views? I really
need design documents, if possible with UML diagrams. Is there perhaps
something about the Flex TreeView control?

Thanks,

Haykel Ben Jemia

Allmas
Web  RIA Development
http://www.allmas-tn.com


RE: [flexcoders] Re: handle large data sets from SOAP service

2008-12-04 Thread Tracy Spratt
If you do not control the Web service itself, then you will probably need to 
get the data server-side and implement your own paging.

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
Michelle Davis
Sent: Thursday, December 04, 2008 10:53 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: handle large data sets from SOAP service

 

Hi Steve,

Thanks for reading my email.

 

The problems I'm having are how to get million of records from web service thru 
SOAP and display those records thru pagination.

  

Currently I’m using ArrayCollection to store the data after receive from the 
server thru SOAP service and using DataGrid to display.  When the data contains 
5000+ records it chokes up.

 

Thanks,

Michelle.

  

 

 


 

 



From: valdhor [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, December 4, 2008 6:28:34 AM
Subject: [flexcoders] Re: handle large data sets from SOAP service

I don't know about everybody else, but I could do with some more details.

Are you having problems getting the data, displaying it or something else?

What do you mean by handle?

If you could expand on what you are trying to do we may be able to
point you in the right direction.

Steve

--- In [EMAIL PROTECTED] ups.com mailto:flexcoders%40yahoogroups.com , 
Michelle Davis [EMAIL PROTECTED] . wrote:

 Hi all,
 
 Can someone show me sample on how to handle large data sets from
SOAP service?  I'm desperate 
 for helps.
  
 Thanks,
 Michelle.


 

 



RE: [flexcoders] What Am I doing Wrong, View will not update when bound data is changed.

2008-12-04 Thread Tracy Spratt
How are you updating the item?  If you use the collection API, the UI should 
update.  If you are directly assigning a value to an item property, then you 
should call itemUpdated(item).

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
Dimitrios Gianninas
Sent: Thursday, December 04, 2008 8:32 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] What Am I doing Wrong, View will not update when 
bound data is changed.

 

Is the [Bindable] tag present at the top of the RoomModel declaration?

 

Dimitrios Gianninas

RIA Developer Team Lead

Optimal Payments Inc.

 

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of donvoltz
Sent: Thursday, December 04, 2008 4:06 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] What Am I doing Wrong, View will not update when bound 
data is changed.

Using Cairngorm, I am maintaining an ArrayCollection of a custom data
type. This data is bound to the view, however, when I update the data
in the ArrayCollection, the view is not updated until I redraw all of
the custom components. Is there a way for each component to respond
when I modify the data?

Here is the code

CUSTOM COMPONENT

?xml version=1.0 encoding=utf-8?
mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml 
http://www.adobe.com/2006/mxml  width=100%
height=100% borderStyle=outset cornerRadius=20
mx:Script
![CDATA[
import com.dynamicmedicalventures.or_metrics.RoomModel;
import mx.events.FlexEvent;

[Bindable]
private var _data:RoomModel;

override public function set data(value:Object):void{
if(value != null){
super.data = value;
this._data = value as RoomModel;
}
dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
super.invalidateProperties();

}

override protected function commitProperties():void {
super.commitProperties();
if(data != _data){
_data = data as RoomModel;
}
}


]]
/mx:Script

mx:Label x=10 y=10 fontSize=14 fontWeight=bold
id=roomTitle text={_data.roomData.roomName}/
mx:Image x=846 y=10 id=roomStatus/
mx:List x=10 y=86 width=580 height=312 id=caseList
dragEnabled=true dropEnabled=true dataProvider={_data.caseList} /
mx:Label x=10 y=60 text=Case List/
mx:Label x=618 y=60 text=Main Staff/
mx:Label x=618 y=204 text=Misc Staff/
mx:List x=618 y=86 width=163 id=mainList height=110
dataProvider={_data.mainStaff} /
mx:List x=619 y=230 id=miscList width=163 height=110
dataProvider={_data.miscStaff} /
mx:Label x=10 y=415 text=Equipment List/
mx:HorizontalList x=10 y=441 width=580
dataProvider={_data.equipmentList} /
mx:Label x=619 y=360 text=Messages amp; Alerts/
mx:TextArea x=619 y=389 width=259 height=112/

/mx:Canvas

In the main application I am adding many of these custom components to
a VBOX, here is that code snippit

for (var i:int = 0; imodelLocator.RoomModelCollection.length; i++){
var newRoom:RoomView = new RoomView()
newRoom.data = modelLocator.RoomModelCollection.getItemAt(i);
if(allRoomsBox) {
allRoomsBox.addChild(newRoom);
}
}

Thanks for any help

Don

AVIS IMPORTANT

WARNING

Ce message électronique et ses pièces jointes peuvent contenir des 
renseignements confidentiels, exclusifs ou légalement privilégiés destinés au 
seul usage du destinataire visé. L'expéditeur original ne renonce à aucun 
privilège ou à aucun autre droit si le présent message a été transmis 
involontairement ou s'il est retransmis sans son autorisation. Si vous n'êtes 
pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, 
veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses 
pièces jointes, de votre système. La lecture, la distribution, la copie ou tout 
autre usage du présent message ou de ses pièces jointes par des personnes 
autres que le destinataire visé ne sont pas autorisés et pourraient être 
illégaux. Si vous avez reçu ce courrier électronique par erreur, veuillez en 
aviser l'expéditeur.

This electronic message and its attachments may contain confidential, 
proprietary or legally privileged information, which is solely for the use of 
the intended recipient. No privilege or other rights are waived by any 
unintended transmission or unauthorized retransmission of this message. If you 
are not the intended recipient of this message, or if you have received it in 
error, you should immediately stop reading this message and delete it and all 
attachments from your system. The reading, distribution, copying or other use 
of this message or its attachments by unintended recipients is unauthorized and 
may be unlawful. If you have received this e-mail in error, please notify the 
sender.

 



[flexcoders] Disable Column reordering on Advanced Data Grid?

2008-12-04 Thread scottyale2008
Is it possible to disable column reordering on Advanced Data Grid? 
I've looked at all the properties and I don't see one such as
(allowHeaderMove, allowHeaderReorder, etc.)

Thanks!



Re: [flexcoders] People with blogs

2008-12-04 Thread john fisher
Nate, along with the other two plugin suggestions I can tell you that
with various WP plugins you can get. *anything* to display inside your WP.
I have an (internal) demo running now that allows raw html, swf files,
php code to run in WP pages or posts. Beware of security issues with the
php
ajaxed-wp  exec-php  raw-html
John

Nate Pearson wrote:
 Sorry this is a little off topic.  I'm trying to start a flex blog but I'm 
 not sure how to copy code 
 from flex builder into Wordpress and have the formating stay the same.  Is 
 there some plugin 
 that you use?  How do you guys do it?

 Thanks a lot!

 -Nate


   


RE: [flexcoders] People with blogs

2008-12-04 Thread Chet Haase

My more manual approach is to simply type my blog in DreamWeaver and to 
copy/paste the raw HTML code into the Edit HTML view of my blogging page. 
This does all the transformation of 's into escape codes for me.

But my blog is on blogger.com, which has pretty bad support for coding in 
general - it's more tuned to wysiwig editing of normal text. I've heard that 
wordpress has better support for code-oriented blogs.

Chet.



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Aaron 
Hardy
Sent: Thursday, December 04, 2008 7:48 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] People with blogs


For Wordpress I use the WP-Syntax plugin.  Here's an example of what it turns 
out like:

http://aaronhardy.com/flex/finding-the-nearest-component-in-flex/

Now if I could just get more width on my page and less width on my code. :P

Aaron
On Wed, Dec 3, 2008 at 9:42 PM, Nate Pearson [EMAIL PROTECTED]mailto:[EMAIL 
PROTECTED] wrote:

Sorry this is a little off topic. I'm trying to start a flex blog but I'm not 
sure how to copy code
from flex builder into Wordpress and have the formating stay the same. Is there 
some plugin
that you use? How do you guys do it?

Thanks a lot!

-Nate




Re: [flexcoders] Fwd: Filtering the List Entries depending upon the text entered in text Input box

2008-12-04 Thread anuj sharma
Hi Josh
Thanks a lot, That works perfectly for my arrayCollection. Now I already
have a project in which the data provider for my List is Array and I need
the same filter functionality for the Array. can we do this filter for Array
too or do i have to change the code of my project and instead of array I
need to store complete data in ArrayCollection instead of Array and then
made that filter working. It's just lot of work to change the existing
workign code with my harsh deadline.
Please let me know which is the best way.
Again I highly appreciate your help
Anuj

On Wed, Dec 3, 2008 at 7:25 PM, Josh McDonald [EMAIL PROTECTED] wrote:

   private function processFilter(item:Object):Boolean
 {
 return
 String(item).toUpperCase().indexOf(filterText.toUpperCase()) = 0;
 }

 -Josh

 --
 Therefore, send not to know For whom the bell tolls. It tolls for thee.

 Like the cut of my jib? Check out my Flex blog!

 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]
 :: http://flex.joshmcdonald.info/
 :: http://twitter.com/sophistifunk
  



[flexcoders] Re: Embedding fonts dynamically...

2008-12-04 Thread tchredeemed
Will this allow me to actually embed fonts dynamically? or to just use
fonts that I have already embedded?



[flexcoders] Bounce: Favorite Flex/Flash drawing tool component

2008-12-04 Thread schneiderjim
I was wondering whether anyone had any suggestions/favorites for a
flex/flash based drawing tool component. That is, be able to load an
image (from server) on to a canvas, mark it up with the standard
drawing tools, then save back to the server. Don't need to maintain
the graphics layers. Ideally be able to pick from list of
templates for drawing starting point.

Anyone?

Restriction: We are still on Flex 2 (backend = java)



Re: [flexcoders] Resetting an application's view for new user

2008-12-04 Thread Aaron Hardy
That's a good idea.  I wonder if there's a way to do something similar in
AIR considering you can't make the AIR executable restart itself (from what
I know...without a bridge like Merapi).  Maybe there's a way to essentially
reload the contents of the AIR app without actually re-starting the
executable?

Thank you very much for your feedback!

Aaron

On Thu, Dec 4, 2008 at 11:15 AM, Tracy Spratt [EMAIL PROTECTED] wrote:

Here is what I do:

   *public* *function* logOff():*void*

   {

 *var* ur:URLRequest = *new* URLRequest(_sAppUrl);

 navigateToURL(ur,*_self*);

   }*//logOff*



 _sAppUrl comes from the browser: location.href



 Tracy
  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Aaron Hardy
 *Sent:* Wednesday, December 03, 2008 10:32 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Resetting an application's view for new user



 Hey flexers,

 I have a hefty AIR application with many different view combinations,
 forms filled with data, etc. When a user logs out and a different user
 logs in, I need the application to be reset so that everything looks
 as though no other user was previously logged in. I've ran into two
 solutions:

 1) Reset all the forms, views, etc to their original state when the
 first user logs out. This can be tricky getting everything back to its
 initial state.
 2) Make the main view (what would be the main application file in option
 #1) a separate component. When the user logs out, let the whole
 component get garbage collected. When the new user logs in,
 reinstantiate the main view to ensure its all in its initial state once
 again. With this option, there's not as much worrying about whether
 you've successfully reset everything since it's a brand new instance.
 However, processing time and memory management may be a new issue to
 deal with.

 So, I'm curious, how do you folks go about this in your projects? Thanks!

 Aaron

  



Re: [flexcoders] Disable Column reordering on Advanced Data Grid?

2008-12-04 Thread Adrian Williams
We had a similar challenge except we needed to persist to the DB the 
rearrangement of columns...to do this, we extended the event class for 
our listeners so we could capture column selection events...You might 
try using the same thing and  on column selected, perform a 
preventDefault() which would halt any action from happening...


Here's the class:

package com.ftdna
{
   import flash.events.Event;

   public class ColumnSelectedEvent extends Event
   {
   public var colIdx:int;
   public static const COLUMN_SELECTED:String = columnSelected;
   public static const LABEL_SELECTED:String = labelSelected;
   public static const COLUMN_DROP_TARGET:String = columnDropTarget;
  
   public function ColumnSelectedEvent(type:String, colIdx:int)

   {
   super(type);
   this.colIdx = colIdx;
   }
  
   override public function clone():Event

   {
   return new ColumnSelectedEvent(type, colIdx);
   }
  
   }

}

And here is an application of the class:


adg.addEventListener(ColumnSelectedEvent.COLUMN_SELECTED, denySelect)

private function denySelect(event:ColumnSelectedEvent):void
{
   if (event.type == ColumnSelectedEvent.COLUMN_SELECTED)
  event.preventDefault();
}

HTH,
Adrian

scottyale2008 wrote:


Is it possible to disable column reordering on Advanced Data Grid?
I've looked at all the properties and I don't see one such as
(allowHeaderMove, allowHeaderReorder, etc.)

Thanks!

 


[flexcoders] Component Life Cycle

2008-12-04 Thread pratikshah83
Hi Guys, 

I had a question regarding the component life cycle. I am extending 
flex charts and adding my custom style to it. 

But when I load the chart I see the default flex axis being shown and 
than it would disappear and my styled axis shows up. I am wondering 
where do I style my axis such that default flex components are not 
rendered. 

Currently I am doing my custom styling in initialize() method. Please 
let me know which component life cycle method show I be doing the 
styling. 

Your replies would be appreciated. 

Thanks
Pratik 





RE: [flexcoders] Checkbox in a DataGrid - how check without selecting the line.

2008-12-04 Thread Alex Harui
You can prevent the visuals from being displayed by overriding drawItem()

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of garyq22
Sent: Thursday, December 04, 2008 3:53 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Checkbox in a DataGrid - how check without selecting the 
line.


Hi Everyone

I have a CheckBox set as the renderer/editor for a column in my
DataGrid and I would like users to be able to check and uncheck the
boxes on different rows without selecting or changing the selection of
the current grid row.

Is this possible? Any help would be very much appreciated.

Thanks

Gary Q



RE: [flexcoders] itemrenderer rollover event seems no sensitive

2008-12-04 Thread Alex Harui
There is a two pixel gap based on paddingTop and paddingBottom.  Maybe that's 
what you're seeing?

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Fu Di
Sent: Thursday, December 04, 2008 12:31 AM
To: flex coders
Subject: [flexcoders] itemrenderer rollover event seems no sensitive

hello everyone

i wrote a itemrenderer in datagird  which extends DataGridItemRenderer, and i 
listened MouseEvent.ROLL_OVER and MouseEvent.ROLL_OUT events. but when the 
mouse rollover the  itemrenderer it is not sensitive, may be the mouse just 
over the  itemrenderer's character
it will be triggered.

thanks


foodyi





RE: [flexcoders] Generic itemRenderer for Canvas based controls

2008-12-04 Thread Alex Harui
Flex 3 should have the createItemRenderer() method.  Override that and return 
an IListItemRenderer of your choice

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
simonjpalmer
Sent: Thursday, December 04, 2008 1:54 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Generic itemRenderer for Canvas based controls


I have a TileList control that I want to populate at runtime with a
collection of custom controls determined by preferences held on the
user which I retrieve after they log in. All of the custom controls
are based on Canvas.

My current approach is to have an Array into which I push the
appropriate controls after login success and bind that array as the
dataProvider on my TileList control. The trouble is that the controls
don't get rendered because there is no itemRenderer defined for the
TileList.

So I attempted to create a generic itemRenderer based on Canvas which
overrides the set data() method and adds the inbound control as a child...

override public function set data(value:Object):void
{
if (value == null) return;
var cvs:Canvas = value as Canvas;
this.addChild(cvs);
}

However, this throws index out of bounds errors doing a getChild(0)
deep in the bowels of the framework code associated with the dynamic
itemRenderer component, which I don't seem to be able to overcome in
spite of altering the sequence in which things get created, and
fiddling around with the creationPolicy of the custom controls.

So I'm a bit stuck and wondering whether there is a different approach
or I'm just doing something wrong.

Any ideas?



Re: [flexcoders] Fwd: Filtering the List Entries depending upon the text entered in text Input box

2008-12-04 Thread anuj sharma
I would be able to successfully implement the same code with Array instead
of ArrayCollection but there is no method name array.refresh, However there
is method named ArrayCollection.refresh which is responsible for refreshing
my list. How do I refresh my array?Does anybody know equivalent method to
refresh array in the list? Below is the code except in the processfilter I
need to refresh array.
Thanks for your help
Anuj
/***CODE*/

mx:Script
![CDATA[

import mx.managers.PopUpManager;
import mx.effects.DefaultTileListEffect;
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
import mx.effects.easing.Elastic;

[Bindable]
public var ac:ArrayCollection = new
ArrayCollection([One-Device,Two-Device,Three-Device,Four-Device,Five-Device,Six-Device]);
[Bindable]
  public var arr:Array=[One,Second,Third];
[Bindable]
public var filterText:String = '';

private function doChange():void
{
this.filterText = txtSearch.text;
//this.ac.refresh();
}

private function init():void
{
arr.filter(processFilter);
}
private function processFilter(item:Object,index:int,
array:Array):Boolean
{
return
String(item).toUpperCase().indexOf(filterText.toUpperCase()) = 0;

}
private function seeLabel(evt:Event):void
{
var alrt:Alert=Alert.show(evt.currentTarget.toString());
}

]]
/mx:Script
mx:List x=74 y=228 width=229 height=238 dataProvider={arr}
id=DevicesList/mx:List
mx:TextInput x=74 y=198 id=txtSearch change=doChange()/


On Thu, Dec 4, 2008 at 11:05 AM, anuj sharma [EMAIL PROTECTED] wrote:

 Hi Josh
 Thanks a lot, That works perfectly for my arrayCollection. Now I already
 have a project in which the data provider for my List is Array and I need
 the same filter functionality for the Array. can we do this filter for Array
 too or do i have to change the code of my project and instead of array I
 need to store complete data in ArrayCollection instead of Array and then
 made that filter working. It's just lot of work to change the existing
 workign code with my harsh deadline.
 Please let me know which is the best way.
 Again I highly appreciate your help
 Anuj


 On Wed, Dec 3, 2008 at 7:25 PM, Josh McDonald [EMAIL PROTECTED] wrote:

   private function processFilter(item:Object):Boolean
 {
 return
 String(item).toUpperCase().indexOf(filterText.toUpperCase()) = 0;
 }

 -Josh

 --
 Therefore, send not to know For whom the bell tolls. It tolls for thee.

 Like the cut of my jib? Check out my Flex blog!

 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]
 :: http://flex.joshmcdonald.info/
 :: http://twitter.com/sophistifunk
  





Re: [flexcoders] Component Life Cycle

2008-12-04 Thread Aaron Hardy
I think I understand your question.  Try throwing this in your component
(outside of any methods/properties) and tweaking for your needs:

// Default styles
//
private static var classConstructed:Boolean = classConstruct();

/**
 * @private
 * Creates default styles that can be overridden by the developer.
 */
private static function classConstruct():Boolean {
var styleDeclaration:CSSStyleDeclaration =
StyleManager.getStyleDeclaration('Cursor');

if (!styleDeclaration) {
styleDeclaration = new CSSStyleDeclaration();
}

styleDeclaration.defaultFactory = function():void {
this.color = 0xFF;
}

StyleManager.setStyleDeclaration('Cursor', styleDeclaration,
false);

return true;
}


Note that Cursor is the component's name.  This way of setting a default
style personally seems rather unorthodox but it's the only way I've seen
that works.  I hope a better/developer-friendly approach is offered in
future versions of Flex.

Aaron

On Thu, Dec 4, 2008 at 12:27 PM, pratikshah83 [EMAIL PROTECTED]wrote:

   Hi Guys,

 I had a question regarding the component life cycle. I am extending
 flex charts and adding my custom style to it.

 But when I load the chart I see the default flex axis being shown and
 than it would disappear and my styled axis shows up. I am wondering
 where do I style my axis such that default flex components are not
 rendered.

 Currently I am doing my custom styling in initialize() method. Please
 let me know which component life cycle method show I be doing the
 styling.

 Your replies would be appreciated.

 Thanks
 Pratik

  



RE: [flexcoders] Resetting an application's view for new user

2008-12-04 Thread Wildbore, Brendon
If you have an initialisation process which resets all state variables when the 
application starts you could just run that process again?


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Aaron 
Hardy
Sent: Friday, 5 December 2008 8:22 a.m.
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Resetting an application's view for new user


That's a good idea.  I wonder if there's a way to do something similar in AIR 
considering you can't make the AIR executable restart itself (from what I 
know...without a bridge like Merapi).  Maybe there's a way to essentially 
reload the contents of the AIR app without actually re-starting the executable?

Thank you very much for your feedback!

Aaron
On Thu, Dec 4, 2008 at 11:15 AM, Tracy Spratt [EMAIL PROTECTED]mailto:[EMAIL 
PROTECTED] wrote:

Here is what I do:

  public function logOff():vo id

  {

var ur:URLRequest = new URLRequest(_sAppUrl);

navigateToURL(ur,_self);

  }//logOff



_sAppUrl comes from the browser: location.href



Tracy



From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of Aaron Hardy
Sent: Wednesday, December 03, 2008 10:32 PM
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: [flexcoders] Resetting an application's view for new user



Hey flexers,

I have a hefty AIR application with many different view combinations,
forms filled with data, etc. When a user logs out and a different user
logs in, I need the application to be reset so that everything looks
as though no other user was previously logged in. I've ran into two
solutions:

1) Reset all the forms, views, etc to their original state when the
first user logs out. This can be tricky getting everything back to its
initial state.
2) Make the main view (what would be the main application file in option
#1) a separate component. When the user logs out, let the whole
component get garbage collected. When the new user logs in,
reinstantiate the main view to ensure its all in its initial state once
again. With this option, there's not as much worrying about whether
you've successfully reset everything since it's a brand new instance.
However, processing time and memory management may be a new issue to
deal with.

So, I'm curious, how do you folks go about this in your projects? Thanks!

Aaron




RE: [flexcoders] Resetting an application's view for new user

2008-12-04 Thread Tracy Spratt
Doh!, I missed the AIR. (I know, the fifth word, capitalized and all
that. Mea culpa.)  Maybe someone with some AIR experience else will be
able to help.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Aaron Hardy
Sent: Thursday, December 04, 2008 2:22 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Resetting an application's view for new user

 

That's a good idea.  I wonder if there's a way to do something similar
in AIR considering you can't make the AIR executable restart itself
(from what I know...without a bridge like Merapi).  Maybe there's a way
to essentially reload the contents of the AIR app without actually
re-starting the executable?

Thank you very much for your feedback!

Aaron

On Thu, Dec 4, 2008 at 11:15 AM, Tracy Spratt [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

Here is what I do:

  public function logOff():void

  {

var ur:URLRequest = new URLRequest(_sAppUrl);

navigateToURL(ur,_self);

  }//logOff

 

_sAppUrl comes from the browser: location.href

 

Tracy



From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
On Behalf Of Aaron Hardy
Sent: Wednesday, December 03, 2008 10:32 PM
To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com 
Subject: [flexcoders] Resetting an application's view for new user

 

Hey flexers,

I have a hefty AIR application with many different view combinations, 
forms filled with data, etc. When a user logs out and a different user 
logs in, I need the application to be reset so that everything looks 
as though no other user was previously logged in. I've ran into two 
solutions:

1) Reset all the forms, views, etc to their original state when the 
first user logs out. This can be tricky getting everything back to its 
initial state.
2) Make the main view (what would be the main application file in option

#1) a separate component. When the user logs out, let the whole 
component get garbage collected. When the new user logs in, 
reinstantiate the main view to ensure its all in its initial state once 
again. With this option, there's not as much worrying about whether 
you've successfully reset everything since it's a brand new instance. 
However, processing time and memory management may be a new issue to 
deal with.

So, I'm curious, how do you folks go about this in your projects?
Thanks!

Aaron

 

 



[flexcoders] Re: Flash being cached

2008-12-04 Thread John Luke Mills
There is a Firefox extension called  johnnycache that lets you supply a list
of sites not to cache.  I put all the servers I work on there so I always
get the newest version.



RE: [flexcoders] Fwd: Filtering the List Entries depending upon the text entered in text Input box

2008-12-04 Thread Alex Harui
There's an autocomplete combobox out there somewhere that probably does what 
you want

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of anuj 
sharma
Sent: Thursday, December 04, 2008 11:44 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Fwd: Filtering the List Entries depending upon the 
text entered in text Input box


I would be able to successfully implement the same code with Array instead of 
ArrayCollection but there is no method name array.refresh, However there is 
method named ArrayCollection.refresh which is responsible for refreshing my 
list. How do I refresh my array?Does anybody know equivalent method to refresh 
array in the list? Below is the code except in the processfilter I need to 
refresh array.
Thanks for your help
Anuj
/***CODE*/

mx:Script
![CDATA[

import mx.managers.PopUpManager;
import mx.effects.DefaultTileListEffect;
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
import mx.effects.easing.Elastic;

[Bindable]
public var ac:ArrayCollection = new 
ArrayCollection([One-Device,Two-Device,Three-Device,Four-Device,Five-Device,Six-Device]);
[Bindable]
  public var arr:Array=[One,Second,Third];
[Bindable]
public var filterText:String = '';

private function doChange():void
{
this.filterText = txtSearch.text;
//this.ac.refresh();
}

private function init():void
{
arr.filter(processFilter);
}
private function processFilter(item:Object,index:int, 
array:Array):Boolean
{
return 
String(item).toUpperCase().indexOf(filterText.toUpperCase()) = 0;

}
private function seeLabel(evt:Event):void
{
var alrt:Alert=Alert.show(evt.currentTarget.toString());
}

]]
/mx:Script
mx:List x=74 y=228 width=229 height=238 dataProvider={arr} 
id=DevicesList/mx:List
mx:TextInput x=74 y=198 id=txtSearch change=doChange()/

On Thu, Dec 4, 2008 at 11:05 AM, anuj sharma [EMAIL PROTECTED]mailto:[EMAIL 
PROTECTED] wrote:
Hi Josh
Thanks a lot, That works perfectly for my arrayCollection. Now I already have a 
project in which the data provider for my List is Array and I need the same 
filter functionality for the Array. can we do this filter for Array too or do i 
have to change the code of my project and instead of array I need to store 
complete data in ArrayCollection instead of Array and then made that filter 
working. It's just lot of work to change the existing workign code with my 
harsh deadline.
Please let me know which is the best way.
Again I highly appreciate your help
Anuj

On Wed, Dec 3, 2008 at 7:25 PM, Josh McDonald [EMAIL PROTECTED]mailto:[EMAIL 
PROTECTED] wrote:
private function processFilter(item:Object):Boolean
{
return String(item).toUpperCase().indexOf(filterText.toUpperCase()) 
= 0;
}

-Josh

--
Therefore, send not to know For whom the bell tolls. It tolls for thee.

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk





[flexcoders] Re: Unformatting currency values - best practice?

2008-12-04 Thread flexcoder2008
Thanks very much for those suggestions.  The RegExUtil class is almost
perfect, except that it will strip out decimal places since they are
non-numeric characters.  In the focus in/out events I am trying to
assign the numeric value of the TextInput's text property to the data
property minus the currency symbol and thousands separator.  The
tricky part is the decimal place.  The RegExUtil strip function will
remove the decimal place since it is a non-numeric character and so
the value saved to the .data property is wrong.  The other thing to
consider is that for some locales, a comma is used for a decimal
point.  So if we want to save this back to the database, the comma has
to be replaced with a period.

This shouldn't be too hard though - I'll just use string functions to
find the decimal
character, then split the number into 2 parts, strip the extra
characters with the RegExUtil
function and then concatenate them back with a . character to save to
the db.

Thanks again.





RE: [flexcoders] Fwd: Filtering the List Entries depending upon the text entered in text Input box

2008-12-04 Thread Tracy Spratt
Array is not bindable.  Do you not get a warning?

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of anuj sharma
Sent: Thursday, December 04, 2008 2:44 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Fwd: Filtering the List Entries depending upon
the text entered in text Input box

 

I would be able to successfully implement the same code with Array
instead of ArrayCollection but there is no method name array.refresh,
However there is method named ArrayCollection.refresh which is
responsible for refreshing my list. How do I refresh my array?Does
anybody know equivalent method to refresh array in the list? Below is
the code except in the processfilter I need to refresh array.
Thanks for your help
Anuj
/***CODE*/

mx:Script
![CDATA[

import mx.managers.PopUpManager;
import mx.effects.DefaultTileListEffect;  
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
import mx.effects.easing.Elastic;

[Bindable]
public var ac:ArrayCollection = new
ArrayCollection([One-Device,Two-Device,Three-Device,Four-Device,
Five-Device,Six-Device]);
[Bindable]
  public var arr:Array=[One,Second,Third];
[Bindable]
public var filterText:String = '';

private function doChange():void
{
this.filterText = txtSearch.text;  
//this.ac.refresh();
}

private function init():void
{
arr.filter(processFilter);
}
private function processFilter(item:Object,index:int,
array:Array):Boolean
{
return
String(item).toUpperCase().indexOf(filterText.toUpperCase()) = 0;
 
}
private function seeLabel(evt:Event):void
{
var alrt:Alert=Alert.show(evt.currentTarget.toString());
}

]]
/mx:Script
mx:List x=74 y=228 width=229 height=238
dataProvider={arr} id=DevicesList/mx:List
mx:TextInput x=74 y=198 id=txtSearch change=doChange()/


On Thu, Dec 4, 2008 at 11:05 AM, anuj sharma [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

Hi Josh
Thanks a lot, That works perfectly for my arrayCollection. Now I already
have a project in which the data provider for my List is Array and I
need the same filter functionality for the Array. can we do this filter
for Array too or do i have to change the code of my project and instead
of array I need to store complete data in ArrayCollection instead of
Array and then made that filter working. It's just lot of work to change
the existing workign code with my harsh deadline.
Please let me know which is the best way.
Again I highly appreciate your help
Anuj

 

On Wed, Dec 3, 2008 at 7:25 PM, Josh McDonald [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

private function processFilter(item:Object):Boolean
{

return
String(item).toUpperCase().indexOf(filterText.toUpperCase()) = 0;
}

-Josh

-- 
Therefore, send not to know For whom the bell tolls. It tolls for
thee.

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
:: http://flex.joshmcdonald.info/ http://flex.joshmcdonald.info/ 
:: http://twitter.com/sophistifunk http://twitter.com/sophistifunk 

 

 

 



[flexcoders] Re: Embedding fonts dynamically...

2008-12-04 Thread Amy
--- In flexcoders@yahoogroups.com, tchredeemed [EMAIL PROTECTED] wrote:

 Will this allow me to actually embed fonts dynamically? or to just use
 fonts that I have already embedded?


The whole idea that you could embed a font that isn't compiled into the 
file at compile time doesn't make any sense.  The font has to be 
compiled into a swf or swc file for it to be embedded at all.  You 
can't go back later after it's compiled and compile in more or fewer 
fonts.

HTH;

Amy



[flexcoders] Re: Unformatting currency values - best practice?

2008-12-04 Thread Tim Hoff
Just change the pattern:

public static var NON_NUMERIC_CHARACTERS_WITH_DECIMAL : String =
[^0-9|^.]+;

For the locales that require a comma, use replace().

-TH

--- In flexcoders@yahoogroups.com, flexcoder2008 [EMAIL PROTECTED]
wrote:

 Thanks very much for those suggestions.  The RegExUtil class is almost
 perfect, except that it will strip out decimal places since they are
 non-numeric characters.  In the focus in/out events I am trying to
 assign the numeric value of the TextInput's text property to the data
 property minus the currency symbol and thousands separator.  The
 tricky part is the decimal place.  The RegExUtil strip function will
 remove the decimal place since it is a non-numeric character and so
 the value saved to the .data property is wrong.  The other thing to
 consider is that for some locales, a comma is used for a decimal
 point.  So if we want to save this back to the database, the comma has
 to be replaced with a period.

 This shouldn't be too hard though - I'll just use string functions to
 find the decimal
 character, then split the number into 2 parts, strip the extra
 characters with the RegExUtil
 function and then concatenate them back with a . character to save
to
 the db.

 Thanks again.





Re: [flexcoders] Resetting an application's view for new user

2008-12-04 Thread Aaron Hardy
Yeah, I think that would be akin to the first option described in my initial
email.  The difficulty with that is making sure that all state variables
really do get reset.  If new view combinations are added to the system
later, the developer is required to ensure they are also included in the
reinitialization process.  Something that really ensures that everything is
at a clean slate and doesn't leave room for error on the developer's part
would be really nice.  Tracy's recommendation is great for that since it
basically re-loads the SWF completely, but I'm not sure there's an AIR-based
alternative.

Aaron

On Thu, Dec 4, 2008 at 12:48 PM, Wildbore, Brendon 
[EMAIL PROTECTED] wrote:

If you have an initialisation process which resets all state variables
 when the application starts you could just run that process again?


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Aaron Hardy
 *Sent:* Friday, 5 December 2008 8:22 a.m.
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Resetting an application's view for new user



 That's a good idea.  I wonder if there's a way to do something similar in
 AIR considering you can't make the AIR executable restart itself (from what
 I know...without a bridge like Merapi).  Maybe there's a way to essentially
 reload the contents of the AIR app without actually re-starting the
 executable?

 Thank you very much for your feedback!

 Aaron

 On Thu, Dec 4, 2008 at 11:15 AM, Tracy Spratt [EMAIL PROTECTED]
 wrote:

 Here is what I do:

   *public* *function* logOff():*vo id*

   {

 *var* ur:URLRequest = *new* URLRequest(_sAppUrl);

 navigateToURL(ur,*_self*);

   }*//logOff*



 _sAppUrl comes from the browser: location.href



 Tracy
  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Aaron Hardy
 *Sent:* Wednesday, December 03, 2008 10:32 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Resetting an application's view for new user



 Hey flexers,

 I have a hefty AIR application with many different view combinations,
 forms filled with data, etc. When a user logs out and a different user
 logs in, I need the application to be reset so that everything looks
 as though no other user was previously logged in. I've ran into two
 solutions:

 1) Reset all the forms, views, etc to their original state when the
 first user logs out. This can be tricky getting everything back to its
 initial state.
 2) Make the main view (what would be the main application file in option
 #1) a separate component. When the user logs out, let the whole
 component get garbage collected. When the new user logs in,
 reinstantiate the main view to ensure its all in its initial state once
 again. With this option, there's not as much worrying about whether
 you've successfully reset everything since it's a brand new instance.
 However, processing time and memory management may be a new issue to
 deal with.

 So, I'm curious, how do you folks go about this in your projects? Thanks!

 Aaron



  



[flexcoders] Data not appearing in AdvancedDataGrid

2008-12-04 Thread todd.bruner
Hello and thanks in advance for any help you can provide this flex
newbie.

I'm trying to create a simple AdvancedDataGrid that displays XML data
from a web service I wrote.  The XML file looks like:

dashboard
 rollup
period2008-12-03 01:00:00/period
period_sse1228266000/period_sse
country
ccodePH/ccode
detects1/detects
/country
country
 ccodeGB/ccode
 detects50/detects
/country
 /rollup
 rollup
  period2008-12-04 03:00:00/period
  period_sse1228359600/period_sse
  country
   ccodePH/ccode
   detects18/detects
  /country
 /rollup
/dashboard

My Flex 3  MXML app is:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute
 creationComplete=init()
 mx:Script
 ![CDATA[
 import mx.collections.ArrayCollection;
 import mx.rpc.events.ResultEvent;
 import mx.rpc.events.FaultEvent;
 import mx.controls.Alert;

 [Bindable] public var dataServiceURL:String =
http://dashboard-dev/cgi-bin/dataService.pl?type=countrystats;;
 [Bindable] public var chartValues:ArrayCollection;

 public function init():void
 {
 countries_rpc.send();
 }
 public function handle_xml(event:ResultEvent):void
 {
 var xmlData:XML = event.result as XML;
 var newData:Array = parseXmlToArray(xmlData);
 chartValues = new ArrayCollection(newData);
  }

 public function handle_fault(event:FaultEvent):void
 {
 Alert.show(event.fault.faultString, Error);
 }

 private function parseXmlToArray(xmlData:XML):Array
 {
 var newData:Array = new Array();

 for each (var rollup:XML in xmlData.rollup) {
 var carray:Array = new Array();
 for each (var country:XML in rollup.country) {
 carray.push({
 ccode: country.ccode,
 detects: country.detects
 });
 }
 carray.sortOn(ccode);
 newData.push({
 period: rollup.period,
 period_msse: rollup.period_sse*1000,
 children: carray
 });
 }
 newData.sortOn(period_msse);
 return newData;
 }
 ]]
 /mx:Script
 mx:HTTPService id=countries_rpc url={dataServiceURL}
   result=handle_xml(event); fault=handle_fault(event);
resultFormat=e4x /

 mx:AdvancedDataGrid id=countrystatgrid width=50% height=50%
 mx:dataProvider
 mx:HierarchicalData source={chartValues}  /
 /mx:dataProvider
 mx:columns
 mx:AdvancedDataGridColumn dataField=period /
 mx:AdvancedDataGridColumn dataField=ccode /
 mx:AdvancedDataGridColumn dataField=detects /
 /mx:columns
 /mx:AdvancedDataGrid
/mx:Application

When I run this the AdvancedDataGrid is displayed but no data is shown. 
In the debugger, I can see chartValues and the data from the webservice
appears to be correctly stuffed into it.

Can anyone point me in the right direction? Thanks!
Todd




Re: [flexcoders] Fwd: Filtering the List Entries depending upon the text entered in text Input box

2008-12-04 Thread anuj sharma
Not with the above code
Anuj

On Thu, Dec 4, 2008 at 12:21 PM, Tracy Spratt [EMAIL PROTECTED] wrote:

Array is not bindable.  Do you not get a warning?

 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *anuj sharma
 *Sent:* Thursday, December 04, 2008 2:44 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Fwd: Filtering the List Entries depending upon
 the text entered in text Input box



 I would be able to successfully implement the same code with Array instead
 of ArrayCollection but there is no method name array.refresh, However there
 is method named ArrayCollection.refresh which is responsible for refreshing
 my list. How do I refresh my array?Does anybody know equivalent method to
 refresh array in the list? Below is the code except in the processfilter I
 need to refresh array.
 Thanks for your help
 Anuj
 /***CODE*/

 mx:Script
 ![CDATA[

 import mx.managers.PopUpManager;
 import mx.effects.DefaultTileListEffect;
 import mx.rpc.events.ResultEvent;
 import mx.controls.Alert;
 import mx.collections.ArrayCollection;
 import mx.effects.easing.Elastic;

 [Bindable]
 public var ac:ArrayCollection = new
 ArrayCollection([One-Device,Two-Device,Three-Device,Four-Device,Five-Device,Six-Device]);
 [Bindable]
   public var arr:Array=[One,Second,Third];
 [Bindable]
 public var filterText:String = '';

 private function doChange():void
 {
 this.filterText = txtSearch.text;
 //this.ac.refresh();
 }

 private function init():void
 {
 arr.filter(processFilter);
 }
 private function processFilter(item:Object,index:int,
 array:Array):Boolean
 {
 return
 String(item).toUpperCase().indexOf(filterText.toUpperCase()) = 0;

 }
 private function seeLabel(evt:Event):void
 {
 var alrt:Alert=Alert.show(evt.currentTarget.toString());
 }

 ]]
 /mx:Script
 mx:List x=74 y=228 width=229 height=238 dataProvider={arr}
 id=DevicesList/mx:List
 mx:TextInput x=74 y=198 id=txtSearch change=doChange()/


 On Thu, Dec 4, 2008 at 11:05 AM, anuj sharma [EMAIL PROTECTED] wrote:

 Hi Josh
 Thanks a lot, That works perfectly for my arrayCollection. Now I already
 have a project in which the data provider for my List is Array and I need
 the same filter functionality for the Array. can we do this filter for Array
 too or do i have to change the code of my project and instead of array I
 need to store complete data in ArrayCollection instead of Array and then
 made that filter working. It's just lot of work to change the existing
 workign code with my harsh deadline.
 Please let me know which is the best way.
 Again I highly appreciate your help
 Anuj



 On Wed, Dec 3, 2008 at 7:25 PM, Josh McDonald [EMAIL PROTECTED] wrote:

 private function processFilter(item:Object):Boolean
 {

 return
 String(item).toUpperCase().indexOf(filterText.toUpperCase()) = 0;
 }

 -Josh

 --
 Therefore, send not to know For whom the bell tolls. It tolls for thee.

 Like the cut of my jib? Check out my Flex blog!

 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]
 :: http://flex.joshmcdonald.info/
 :: http://twitter.com/sophistifunk





  



[flexcoders] Re: Component Life Cycle

2008-12-04 Thread pratikshah83
Hi Aaron, 

Thanks for you reply. I was just wondering that I am currently doing 
the styling in initialize() method. So the charts is not rendered until that 
time, so why is the default flex axis is getting rendered. 
When the chart is rendered my styles should already be set.

So how the updateDisplayList() method is getting called. I need to get 
my styles set before the updateDisplayList() method is called. 

Do you have any idea if preinitialize() method help ??

Thanks
Pratik 


--- In flexcoders@yahoogroups.com, Aaron Hardy [EMAIL PROTECTED] 
wrote:

 I think I understand your question.  Try throwing this in your 
component
 (outside of any methods/properties) and tweaking for your needs:
 
 // Default styles
 //
 private static var classConstructed:Boolean = 
classConstruct();
 
 /**
  * @private
  * Creates default styles that can be overridden by the 
developer.
  */
 private static function classConstruct():Boolean {
 var styleDeclaration:CSSStyleDeclaration =
 StyleManager.getStyleDeclaration('Cursor');
 
 if (!styleDeclaration) {
 styleDeclaration = new CSSStyleDeclaration();
 }
 
 styleDeclaration.defaultFactory = function():void {
 this.color = 0xFF;
 }
 
 StyleManager.setStyleDeclaration('Cursor', 
styleDeclaration,
 false);
 
 return true;
 }
 
 
 Note that Cursor is the component's name.  This way of setting a 
default
 style personally seems rather unorthodox but it's the only way I've 
seen
 that works.  I hope a better/developer-friendly approach is offered 
in
 future versions of Flex.
 
 Aaron
 
 On Thu, Dec 4, 2008 at 12:27 PM, pratikshah83 
[EMAIL PROTECTED]wrote:
 
Hi Guys,
 
  I had a question regarding the component life cycle. I am 
extending
  flex charts and adding my custom style to it.
 
  But when I load the chart I see the default flex axis being shown 
and
  than it would disappear and my styled axis shows up. I am 
wondering
  where do I style my axis such that default flex components are not
  rendered.
 
  Currently I am doing my custom styling in initialize() method. 
Please
  let me know which component life cycle method show I be doing the
  styling.
 
  Your replies would be appreciated.
 
  Thanks
  Pratik
 
   
 






RE: [flexcoders] Resetting an application's view for new user

2008-12-04 Thread Wildbore, Brendon
Yep true, Sorry Aaron I missed the initial email.

Tracys recommendation is simple and perfect for flex web based apps, Air apps 
are another issue.

Could you perhaps hold all state variables in a bindable associative array or 
object, then just rebuild the object? Are you using any recognised framework 
for your app?


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Aaron 
Hardy
Sent: Friday, 5 December 2008 9:38 a.m.
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Resetting an application's view for new user


Yeah, I think that would be akin to the first option described in my initial 
email.  The difficulty with that is making sure that all state variables really 
do get reset.  If new view combinations are added to the system later, the 
developer is required to ensure they are also included in the reinitialization 
process.  Something that really ensures that everything is at a clean slate and 
doesn't leave room for error on the developer's part would be really nice.  
Tracy's recommendation is great for that since it basically re-loads the SWF 
completely, but I'm not sure there's an AIR-based alternative.

Aaron
On Thu, Dec 4, 2008 at 12:48 PM, Wildbore, Brendon [EMAIL 
PROTECTED]mailto:[EMAIL PROTECTED] wrote:

If you have an initialisation process which resets all state variables when the 
application starts you could just run that process again?





From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of Aaron Hardy
Sent: Friday, 5 December 2008 8:22 a.m.
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Resetting an application's view for new user



That's a good idea.  I wonder if there's a way to do something similar in AIR 
considering you can't make the AIR executable restart itself (from what I 
know...without a bridge like Merapi).  Maybe there's a way to essentially 
reload the contents of the AIR app without actually re-starting the executable?

Thank you very much for your feedback!

Aaron

On Thu, Dec 4, 2008 at 11:15 AM, Tracy Spratt [EMAIL PROTECTED]mailto:[EMAIL 
PROTECTED] wrote:

Here is what I do:

  public function logOff():vo id

  {

var ur:URLRequest = new URLRequest(_sAppUrl);

navigateToURL(ur,_self);

  }//logOff



_sAppUrl comes from the browser: location.href



Tracy



From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of Aaron Hardy
Sent: Wednesday, December 03, 2008 10:32 PM
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: [flexcoders] Resetting an application's view for new user



Hey flexers,

I have a hefty AIR application with many different view combinations,
forms filled with data, etc. When a user logs out and a different user
logs in, I need the application to be reset so that everything looks
as though no other user was previously logged in. I've ran into two
solutions:

1) Reset all the forms, views, etc to their original state when the
first user logs out. This can be tricky getting everything back to its
initial state.
2) Make the main view (what would be the main application file in option
#1) a separate component. When the user logs out, let the whole
component get garbage collected. When the new user logs in,
reinstantiate the main view to ensure its all in its initial state once
again. With this option, there's not as much worrying about whether
you've successfully reset everything since it's a brand new instance.
However, processing time and memory management may be a new issue to
deal with.

So, I'm curious, how do you folks go about this in your projects? Thanks!

Aaron






[flexcoders] Re: Embedding fonts dynamically...

2008-12-04 Thread tchredeemed
I am concerned about the filesize if we embed all files.

I think what Alex said might work, we could embed the font into a
module, and only load a module as we need the font.



[flexcoders] Re: Flex and Java Communication

2008-12-04 Thread valdhor
Hmmm

I'm wanting to learn Java and I already know Flex.

The book mentioned comes from the other direction (Already know Java
and want to learn Flex).

Are there any resources/tutorials etc for someone like me who wants to
learn Java for use with BlazeDS/LCDS. I already know C++ so the
language itself is pretty easy. I get bogged down on how to create the
server side application and connect it to Flex.

Can anybody point me in the right direction?



[flexcoders] Re: Data not appearing in AdvancedDataGrid

2008-12-04 Thread oneworld95
Two things: 
 - Try stuffing the raw XML into a TextArea to see what it looks like.
You could bind it directly to the ADG without first converting to
array/arraycollection; that's the beauty of the e4x format you're
using on the HTTPService call. Not sure why you're doing the
conversion to an array and then to an arraycollection. If you need to
modify the values when they're displayed, try using the labelFunction
on each column. 
 - When I run into issues in code, I try to make it as simple as
possible, make sure that works, then add the additional pieces back in
one by one until I can see what's causing it to act funny. 

I'm thinking something's not quite right with the data after you
manipulate it. Look at that piece.

-Alex

--- In flexcoders@yahoogroups.com, todd.bruner [EMAIL PROTECTED] wrote:

 Hello and thanks in advance for any help you can provide this flex
 newbie.
 
 I'm trying to create a simple AdvancedDataGrid that displays XML data
 from a web service I wrote.  The XML file looks like:
 
 dashboard
  rollup
 period2008-12-03 01:00:00/period
 period_sse1228266000/period_sse
 country
 ccodePH/ccode
 detects1/detects
 /country
 country
  ccodeGB/ccode
  detects50/detects
 /country
  /rollup
  rollup
   period2008-12-04 03:00:00/period
   period_sse1228359600/period_sse
   country
ccodePH/ccode
detects18/detects
   /country
  /rollup
 /dashboard
 
 My Flex 3  MXML app is:
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute
  creationComplete=init()
  mx:Script
  ![CDATA[
  import mx.collections.ArrayCollection;
  import mx.rpc.events.ResultEvent;
  import mx.rpc.events.FaultEvent;
  import mx.controls.Alert;
 
  [Bindable] public var dataServiceURL:String =
 http://dashboard-dev/cgi-bin/dataService.pl?type=countrystats;;
  [Bindable] public var chartValues:ArrayCollection;
 
  public function init():void
  {
  countries_rpc.send();
  }
  public function handle_xml(event:ResultEvent):void
  {
  var xmlData:XML = event.result as XML;
  var newData:Array = parseXmlToArray(xmlData);
  chartValues = new ArrayCollection(newData);
   }
 
  public function handle_fault(event:FaultEvent):void
  {
  Alert.show(event.fault.faultString, Error);
  }
 
  private function parseXmlToArray(xmlData:XML):Array
  {
  var newData:Array = new Array();
 
  for each (var rollup:XML in xmlData.rollup) {
  var carray:Array = new Array();
  for each (var country:XML in rollup.country) {
  carray.push({
  ccode: country.ccode,
  detects: country.detects
  });
  }
  carray.sortOn(ccode);
  newData.push({
  period: rollup.period,
  period_msse: rollup.period_sse*1000,
  children: carray
  });
  }
  newData.sortOn(period_msse);
  return newData;
  }
  ]]
  /mx:Script
  mx:HTTPService id=countries_rpc url={dataServiceURL}
result=handle_xml(event); fault=handle_fault(event);
 resultFormat=e4x /
 
  mx:AdvancedDataGrid id=countrystatgrid width=50% height=50%
  mx:dataProvider
  mx:HierarchicalData source={chartValues}  /
  /mx:dataProvider
  mx:columns
  mx:AdvancedDataGridColumn dataField=period /
  mx:AdvancedDataGridColumn dataField=ccode /
  mx:AdvancedDataGridColumn dataField=detects /
  /mx:columns
  /mx:AdvancedDataGrid
 /mx:Application
 
 When I run this the AdvancedDataGrid is displayed but no data is shown. 
 In the debugger, I can see chartValues and the data from the webservice
 appears to be correctly stuffed into it.
 
 Can anyone point me in the right direction? Thanks!
 Todd





[flexcoders] Tricky one...adding attachments to an email generated from the app

2008-12-04 Thread Adrian Williams

Hi guys,

   And yet another one that I haven't seen...

   Part of our app allows a user to send an email to one or more folks 
in their view.  We simply provide a state that has a simple email form 
they fill out and then we pass that information back through our web 
service (.NET) that actually has the procedure to send the email. 
  
   What I need to be able to do is allow the user to add attachments to 
the email they want to send out.  Is there any way to do this and is 
there a better method to the email solution?  We briefly toyed with the 
idea of just creating the hyperlink to use their own email client, but a 
user can literally send a bulk email to several thousand people and a 
hyperlink would die a slow, miserable death trying to handle that.


Thanks!
Adrian


[flexcoders] Re: RSL Error in Flex 2.0.1

2008-12-04 Thread Darrell Loverin
Try changing the load order so that framework.swf is loaded first.

--- In flexcoders@yahoogroups.com, t_varada [EMAIL PROTECTED] wrote:

 Hi All
 
 I am trying to convert my project to RSL based. I followed all the
 steps in the document but never got it worked.
 
 Basically we have two custom swc files that is common for all the
 features inside our application. I added the following lines to my
 flex-config.xml (our compilation are ANT based scripts)
 
 runtime-shared-libraries
 url../libraries/UIFramework.swf/url
   url../libraries/MenuLib.swf/url
   url../libraries/framework.swf/url
   url../libraries/flex.swf/url
   url../libraries/fds.swf/url
   url../libraries/rpc.swf/url
 /runtime-shared-libraries
 And copied all the *.swf to webapps/libraries.
 
 But when I start my app I get the following error 
 
 VerifyError: Error #1014: Class mx.controls::NumericStepper could 
not
 be found.
 
 Really appreciate your suggestion.





RE: [flexcoders] Tricky one...adding attachments to an email generated from the app

2008-12-04 Thread Ryan Graham

Perhaps you could gather the attachments in flex, add  a parameter to
your webservice for them, base64 encode them for transfer via that
parameter, then base64 decode them back to binary files on the server
when sending the email?  Note, base64 encoding binary data increases its
size roughly 30% for the transfer to the server. Not sure if bandwidth
is an issue in your scenario.

 

HTH,

Ryan

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Adrian Williams
Sent: Thursday, December 04, 2008 2:12 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Tricky one...adding attachments to an email
generated from the app

 

Hi guys,

And yet another one that I haven't seen...

Part of our app allows a user to send an email to one or more folks
in their view.  We simply provide a state that has a simple email form
they fill out and then we pass that information back through our web
service (.NET) that actually has the procedure to send the email.  

What I need to be able to do is allow the user to add attachments to
the email they want to send out.  Is there any way to do this and is
there a better method to the email solution?  We briefly toyed with the
idea of just creating the hyperlink to use their own email client, but a
user can literally send a bulk email to several thousand people and a
hyperlink would die a slow, miserable death trying to handle that.

Thanks!
Adrian

 



This message is private and confidential. If you have received it in error, 
please notify the sender and remove it from your system.

Re: [flexcoders] Resetting an application's view for new user

2008-12-04 Thread Aaron Hardy
Yeah, something like that would probably work. On the other hand, I gave the
code at the bottom of this page a try:

http://www.docsultant.com/site2/articles/flex_internals.html

and it seemed to work very well for restarting the AIR app.  I think I'm
going to take that approach.  If anyone knows of a better approach, I'd love
to hear about it.

Thanks again,

Aaron

On Thu, Dec 4, 2008 at 1:47 PM, Wildbore, Brendon [EMAIL PROTECTED]
 wrote:

Yep true, Sorry Aaron I missed the initial email.



 Tracys recommendation is simple and perfect for flex web based apps, Air
 apps are another issue.



 Could you perhaps hold all state variables in a bindable associative array
 or object, then just rebuild the object? Are you using any recognised
 framework for your app?


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Aaron Hardy
 *Sent:* Friday, 5 December 2008 9:38 a.m.

 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Resetting an application's view for new user



 Yeah, I think that would be akin to the first option described in my
 initial email.  The difficulty with that is making sure that all state
 variables really do get reset.  If new view combinations are added to the
 system later, the developer is required to ensure they are also included in
 the reinitialization process.  Something that really ensures that everything
 is at a clean slate and doesn't leave room for error on the developer's part
 would be really nice.  Tracy's recommendation is great for that since it
 basically re-loads the SWF completely, but I'm not sure there's an AIR-based
 alternative.

 Aaron

 On Thu, Dec 4, 2008 at 12:48 PM, Wildbore, Brendon 
 [EMAIL PROTECTED] wrote:

 If you have an initialisation process which resets all state variables when
 the application starts you could just run that process again?


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Aaron Hardy
 *Sent:* Friday, 5 December 2008 8:22 a.m.
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Resetting an application's view for new user



 That's a good idea.  I wonder if there's a way to do something similar in
 AIR considering you can't make the AIR executable restart itself (from what
 I know...without a bridge like Merapi).  Maybe there's a way to essentially
 reload the contents of the AIR app without actually re-starting the
 executable?

 Thank you very much for your feedback!

 Aaron

 On Thu, Dec 4, 2008 at 11:15 AM, Tracy Spratt [EMAIL PROTECTED]
 wrote:

 Here is what I do:

   *public* *function* logOff():*vo id*

   {

 *var* ur:URLRequest = *new* URLRequest(_sAppUrl);

 navigateToURL(ur,*_self*);

   }*//logOff*



 _sAppUrl comes from the browser: location.href



 Tracy
  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Aaron Hardy
 *Sent:* Wednesday, December 03, 2008 10:32 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Resetting an application's view for new user



 Hey flexers,

 I have a hefty AIR application with many different view combinations,
 forms filled with data, etc. When a user logs out and a different user
 logs in, I need the application to be reset so that everything looks
 as though no other user was previously logged in. I've ran into two
 solutions:

 1) Reset all the forms, views, etc to their original state when the
 first user logs out. This can be tricky getting everything back to its
 initial state.
 2) Make the main view (what would be the main application file in option
 #1) a separate component. When the user logs out, let the whole
 component get garbage collected. When the new user logs in,
 reinstantiate the main view to ensure its all in its initial state once
 again. With this option, there's not as much worrying about whether
 you've successfully reset everything since it's a brand new instance.
 However, processing time and memory management may be a new issue to
 deal with.

 So, I'm curious, how do you folks go about this in your projects? Thanks!

 Aaron





  



[flexcoders] Detect server timeout in Flex

2008-12-04 Thread oneworld95
Is there a way to detect server timeout in Flex? I'm using Java on the 
backend, with basic authentication. When a user hits the folder, it 
pops up the authentication box. If authenticated, the user can view the 
Flex app. Thanks.



[flexcoders] Re: Footer row with a DataGrid

2008-12-04 Thread Marielle Lange
--- In flexcoders@yahoogroups.com, Guy Morton [EMAIL PROTECTED] wrote:
 Does anyone here have a different solution that they would recommend  
 for some reason?
 
 Given that no-one has suggested an alternative, I think the answer 
to  
 that might be No.


It is possible of having a datagrid for the footer information under 
the one of the data table. 

It's simpler to handle but the behavior is not as smooth as in Alex's 
demo. The columns of the footer DG get aligned only after you have 
dropped the column bar into its new position. 


mx:Script
![CDATA[
private function onColumnStretch(event:DataGridEvent):void
{

DataGridColumn(summaryDG.columns[event.columnIndex]).width = 
DataGridColumn(dataDG.columns[event.columnIndex]).width;
}

// You may also need to run this on container resize
public function alignColumns():void
{
for(var i:uint = 0; i  dataDG.columns.length; i++)
{
DataGridColumn(summaryDG.columns[i]).width = 
ataGridColumn(dataDG.columns[i]).width;
}
}
]]
/mx:Script


mx:DataGrid
id=dataDG 
columnStretch=onColumnStretch(event)
width=100% height=100%
verticalScrollPolicy=on
columns={dgColumns}
dataProvider={dgProvider}
/

mx:DataGrid
id=summaryDG
showHeaders=false
width=100% height=25
columns={sumColumns}
dataProvider={sumProvider}
/  








Re: [flexcoders] Re: Flex and Java Communication

2008-12-04 Thread Ryan Gravener
http://code.google.com/p/wicket-flex-blazeds/

Ryan Gravener
http://ryangravener.com/flex | http://twitter.com/ryangravener


On Thu, Dec 4, 2008 at 4:00 PM, valdhor [EMAIL PROTECTED] wrote:

   Hmmm

 I'm wanting to learn Java and I already know Flex.

 The book mentioned comes from the other direction (Already know Java
 and want to learn Flex).

 Are there any resources/tutorials etc for someone like me who wants to
 learn Java for use with BlazeDS/LCDS. I already know C++ so the
 language itself is pretty easy. I get bogged down on how to create the
 server side application and connect it to Flex.

 Can anybody point me in the right direction?

  



[flexcoders] Re: Detect server timeout in Flex

2008-12-04 Thread oneworld95
Let me clarify: How do you detect session timeouts in Flex if you're
not using BlazeDS?

-Alex

--- In flexcoders@yahoogroups.com, oneworld95 [EMAIL PROTECTED] wrote:

 Is there a way to detect server timeout in Flex? I'm using Java on the 
 backend, with basic authentication. When a user hits the folder, it 
 pops up the authentication box. If authenticated, the user can view the 
 Flex app. Thanks.





[flexcoders] images in Tilelist

2008-12-04 Thread arulmurugan
Hi,

http://www.calsoftgroup.com/samspick/index.html

Using a Tilelist to show a books title, image, description, rating,
authorurl.

The image is not rendered it is different from what I am seeing in a
picture viewer.

(Image url
http://www.calsoftgroup.com/samspick/assets/pic2/IndiaFrommidnighttoMilleniumandBeyond_ShashiTharoor.jpg)

See image of the book India : From Midnight to Millennium and Beyond
under. (Choose History in drop down)

Dono whats the problem.
Pls help.

regards,
Arulmurugan 



[flexcoders] Re: Using RMTPS channel

2008-12-04 Thread ivhaggi
Hi again Seth, 

I follow your solution, I imported the certificate to my FireFox
browser to the section Your certificates. 

I also import my cacert.cert into FireFox in the Authorities section
and in this
path/System/Library/Frameworks/JavaVM.framework/Home/lib/security, in
the cacerts file i have the next entry:


Alias name: myprivateca
Creation date: Dec 4, 2008
Entry type: trustedCertEntry

Owner: [EMAIL PROTECTED], CN=10.100.72.165,
OU=asigna, O=asigna, L=mexico, ST=mexico, C=MX
Issuer: [EMAIL PROTECTED], CN=10.100.72.165,
OU=asigna, O=asigna, L=mexico, ST=mexico, C=MX
Serial number: 875fed8624c6414d
Valid from: Thu Dec 04 12:31:19 CST 2008 until: Fri Dec 04 12:31:19
CST 2009
Certificate fingerprints:
 MD5:  3D:AB:30:93:34:56:E7:DA:E6:41:D0:52:F9:38:54:E0
 SHA1: E1:83:9E:4C:8C:A2:BB:EA:D0:EE:E8:14:EE:C1:6F:C9:F5:4C:91:7E


***
***

After i tried again in debug mode and the Flex Builder console show me
 the next one:

'my-rtmps' channel got connect attempt status. (Object)#0
  code = NetConnection.Connect.Failed
  level = error
'my-rtmps' channel polling stopped.
'my-rtmps' channel connect failed.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer channel faulted with
Channel.Connect.Failed undefined url:'rtmps://10.100.72.165:2038'
'7540C905-0C6E-84BE-E092-040409E73F95' consumer starting resubscribe
timer.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe.
'my-rtmps' channel got connect attempt status. (Object)#0
  code = NetConnection.Connect.SSLHandshakeFailed
  level = status
'7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe.
'my-rtmps' channel got connect attempt status. (Object)#0
  code = NetConnection.Connect.Failed
  level = error
'my-rtmps' channel polling stopped.
'my-rtmps' channel connect failed.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer channel faulted with
Channel.Connect.Failed undefined url:'rtmps://10.100.72.165:2038'
'7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe.
'my-rtmps' channel got connect attempt status. (Object)#0
  code = NetConnection.Connect.SSLHandshakeFailed
  level = status
'7540C905-0C6E-84BE-E092-040409E73F95' consumer stopping resubscribe
timer.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer fault for
'7570FE6F-FBAC-B48A-F254-0404457B1783'.
'my-rtmps' channel got connect attempt status. (Object)#0
  code = NetConnection.Connect.Failed
  level = error
'my-rtmps' channel polling stopped.
'my-rtmps' channel connect failed.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer channel faulted with
Channel.Connect.Failed undefined url:'rtmps://10.100.72.165:2038'
'7540C905-0C6E-84BE-E092-040409E73F95' consumer fault for
'7570FE6F-FBAC-B48A-F254-0404457B1783'.


What im doing wrong or what could be the problem??

Thank so much for your help Seth

--- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote:

 The NetStatusEvent underlying the connect error you're seeing has
the code: NetConnection.Connect.CertificateUntrustedSigner
 
 This indicates that the connection is being closed because the
server certificate (self-signed in your case) that you're using for
your SecureRTMPEndpoint is not in your browser's trust store.
 This wouldn't be an issue if you were using a cert signed by a CA,
but can be more trouble when dealing with self-signed certs.
 You need to import the server certificate into your browser's trust
store - Googling around should get you the info you need.
 Also, the name in your server cert should match the domain name the
client is hitting, in this case, 10.100.72.165, so that might be
something else to double check.
 
 Other than that, your configuration looks fine based on a quick skim.
 
 Best,
 Seth
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of ivhaggi
 Sent: Wednesday, December 03, 2008 2:48 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Using RMTPS channel
 
 Thanks for your quickly response Seth Well this is the top of the
 iceberg =P the problem began when i switch to use the SecureRTMP
 channel, my scenario is:
 
 FireFox 3
 Weblogic 9.2
 LiveCycle Data Services 2.5.1
 
 I have follow the instructions of this link

http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=583threadid=1242192
 in order to create the keystore needed. Im using also the
 mx:TraceTarget/ in order to see, why the flex client is not
 connecting to the jms topic. My services-config.xml is the next one:
 
 channel-definition id=my-rtmps
 class=mx.messaging.channels.SecureRTMPChannel
 endpoint url=rtmps://10.100.72.165:2038
 class=flex.messaging.endpoints.SecureRTMPEndpoint/
 properties
 idle-timeout-minutes60/idle-timeout-minutes
 keystore-file/Users/ivanalvarez/.keystore/keystore-file
 

[flexcoders] ExtJS like features in AdvancedDataGrid

2008-12-04 Thread tntomek
Looking at any pointers in how to create column filters/show-hide much
like in ExtJS Grid. I've been reading Alex's itemRenderer blog only to
be a little overwhelmed at how complicated this might be to accomplish.

http://extjs.com/deploy/dev/examples/grid-filtering/grid-filter.html

Is there any 3rd party ADG grid component that enhances the out of the
box ADG functionality? Specifically adding some line of business
abstractions like column type (Text/Date/Number) and
filtering/grouping widgets that an end user can use.

Here is how I plan to accomplish some of the features:
- Column Type 
  -- add a sortCompareFunction based on column meta data
- Arrow icon
  -- add Arrow icon to column header that would have handle click event
- Context menu
  -- add menu control to support multi panel context menus. This will
require the ability to format menus with checkboxes (never done this)

Thoughts on this approach?



[flexcoders] Gumbo Keyboard Events

2008-12-04 Thread Dale Fraser
Im trying to do something, fairly simple, at least I thought it was.

 

I need to setup some type of generic Keyboard listener for my application.

 

Then within my application, various classes need to listen for keyboard
events and intercept them.

 

I can't get even a basic example to work, my only success has been achieved
by placing a button on the stage, clicking the button, then I get keyboard
events, but once the button is removed or even hidden, no more keyboard
events.

 

Anyone help me with a generic keyboard listener that I can attach to various
classes?

 

 

Regards

Dale Fraser

 



[flexcoders] Method variable scoping problem with Flex compiler

2008-12-04 Thread toofah_gm
I came across another scoping issue today that scared me.  I sure wish 
that the scoping in the ActionScript language worked the same way C++, 
C#, Java, and others work!

Here's the code:

for each (var o:Object in myArray)
{
  var myProblemObject:ProblemObject;
  if (some condition)
  {
myProblemObject = new ProblemObject();
... more code here ...
  }
  ... still more code here...

  if (myProblemObject)
  {
... do some stuff ...
  }
}

In this code myProblemObject is NULL when things start out...great!  
The problem comes after an instance of myProblemObject gets created.  
Every time through the loop after this myProblemObject is no longer 
NULL.  This is not consistent with any other language that I have 
worked with and is therefore not obvious to the developer working with 
the code.  

Why is myProblemObject not reset each time through the loop?  It is a 
variable declaration.

Gary



--- In flexcoders@yahoogroups.com, toofah_gm [EMAIL PROTECTED] wrote:

 It seems to me and my co-workers that the Flex compiler is broken 
when
 it comes to local variable scoping within methods.
 
 For example:
 
 for (var i:int=0; icount; i++)
 {
// do something
 }
 
 for (var i:int=0; icount; i++)
 {
// do something else
 }
 
 This gives a compiler warning stating that 'i' is already defined. 
 But in every other language that I have used, this is completely
 valid.  Yes 'i' was defined above, but 'i' should only be scoped
 within the 'for' loop and should be invalid outside of it.
 
 
 
 Another example:
 
 if (x)
 {
var myArray:Array = new Array();
// do more stuff
 }
 
 myArray.push(some data);
 
 This one compiles, when I believe that it shouldn't.  myArray should
 only be defined within the 'if' statement.  If you don't go into the
 'if' statement you have a problem here.
 
 
 Does anyone understand why the Flex compiler allows this?  Is this
 just a BUG with the compiler?
 
 Anyway, this is just driving me a little crazy. ;)
 
 Gary






Re: [flexcoders] Re: Detect server timeout in Flex

2008-12-04 Thread Ryan Gravener
make an http request to a page on your server?  depending if there is a
session respond true/false?

Ryan Gravener
http://ryangravener.com/flex | http://twitter.com/ryangravener


On Thu, Dec 4, 2008 at 5:07 PM, oneworld95 [EMAIL PROTECTED] wrote:

   Let me clarify: How do you detect session timeouts in Flex if you're
 not using BlazeDS?

 -Alex


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 oneworld95 [EMAIL PROTECTED] wrote:
 
  Is there a way to detect server timeout in Flex? I'm using Java on the
  backend, with basic authentication. When a user hits the folder, it
  pops up the authentication box. If authenticated, the user can view the
  Flex app. Thanks.
 

  



[flexcoders] Re: Unformatting currency values - best practice?

2008-12-04 Thread jim.abbott45
It sounds like you're taking the 'high road' approach to this (i.e.,
letting users enter arbitrary currency strings and then trying to
figure out the currency type after the fact and then checking the
thousands separators and decimal point characters to see if they match
that). That's a best practice usability-wise (at least if you agree
with Alan Cooper...), but it can also take a lot of code to implement
it robustly and it requires thorough testing.

If you're willing to trade off some usability, you could have user's
pick the currency type (i.e., USD, Euro, Yen), _separately_, say in a
drop-down list; and then have them enter the actual value (in a
separate text field). If you implement it that way, then your
(currency) string parsing problem becomes much simpler. If you put the
currency type selector _before_ the amount field (in the workflow/tab
order), then you can also do things like dynamically changing the
validator for the amount field, based on the selected currency. You
could even have a 'no currency type selected' default for the currency
type selector and disable the amount field until the user selected a
particular currency.

I don't know if I would consider the latter approaches as 'best
practices' (especially from a usability perspective), but they are
reasonable trade-offs. YMMV.

I'm not quite clear on what you're trying to do formatting wise,
however. Are you saying that you try to detect when a user has
finished entering a currency amount, and then add currency symbols,
thousands separator symbols, decimal point symbol, etc.?

Regards,
Jim

--- In flexcoders@yahoogroups.com, flexcoder2008 [EMAIL PROTECTED] wrote:

 What is the best practice or a good recommendation for formatting
 currency values and then removing the currency formatting for saving
 to the database?
 
 Here's what I have attempted to do so far.  It works - but only if the
 user enters plain old numbers - if they add any currency symbol or
 thousand separator, it fails.
 
 I have a form which has some textInput's that are formatted with
 currencyFormatters.  I initialize each textInput's .data property to
 0.  The textInput displays formatted currency amounts from xml data
 retrieved from the database.  On the focusIn event, the text property
 is assigned to the textInput's .data property, so the value stays the
 same but the formatting is gone. And when a change event fires, the
 unformatted text in the textInput gets updated to the data property as
 well.
 
 On the FocusOut event, the currency formatting is re-applied.
 
 When I save to the db, I use the textInput's .data property.  So for
 the most part this works, but fails if the user enters any currency
 symbols.
 
 Is there a good class or function someone could recommend to take a
 currency value in a textInput and strip out all the extra formatting
 characters?  I am also trying to implement localization, so the
 various currency symbols will be different depending on the locale.
 
 Thanks





RE: [flexcoders] Method variable scoping problem with Flex compiler

2008-12-04 Thread Seth Hodgson
Fact of life with ECMAScript (hence, with ActionScript as well).

Take a look at the language specification itself for details, but locals in 
your example are scoped to the function, not to code blocks within the function 
delimited by braces. Yes, this differs from C-based languages, and as someone 
who regularly works in both I've been bitten by this more than once as well.

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
toofah_gm
Sent: Thursday, December 04, 2008 2:32 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Method variable scoping problem with Flex compiler

I came across another scoping issue today that scared me. I sure wish
that the scoping in the ActionScript language worked the same way C++,
C#, Java, and others work!

Here's the code:

for each (var o:Object in myArray)
{
var myProblemObject:ProblemObject;
if (some condition)
{
myProblemObject = new ProblemObject();
... more code here ...
}
... still more code here...

if (myProblemObject)
{
... do some stuff ...
}
}

In this code myProblemObject is NULL when things start out...great!
The problem comes after an instance of myProblemObject gets created.
Every time through the loop after this myProblemObject is no longer
NULL. This is not consistent with any other language that I have
worked with and is therefore not obvious to the developer working with
the code.

Why is myProblemObject not reset each time through the loop? It is a
variable declaration.

Gary

--- In flexcoders@yahoogroups.com, toofah_gm [EMAIL PROTECTED] wrote:

 It seems to me and my co-workers that the Flex compiler is broken
when
 it comes to local variable scoping within methods.

 For example:

 for (var i:int=0; icount; i++)
 {
 // do something
 }

 for (var i:int=0; icount; i++)
 {
 // do something else
 }

 This gives a compiler warning stating that 'i' is already defined.
 But in every other language that I have used, this is completely
 valid. Yes 'i' was defined above, but 'i' should only be scoped
 within the 'for' loop and should be invalid outside of it.



 Another example:

 if (x)
 {
 var myArray:Array = new Array();
 // do more stuff
 }

 myArray.push(some data);

 This one compiles, when I believe that it shouldn't. myArray should
 only be defined within the 'if' statement. If you don't go into the
 'if' statement you have a problem here.


 Does anyone understand why the Flex compiler allows this? Is this
 just a BUG with the compiler?

 Anyway, this is just driving me a little crazy. ;)

 Gary



Re: [flexcoders] Fwd: Filtering the List Entries depending upon the text entered in text Input box

2008-12-04 Thread Josh McDonald
Never bind to array, and also when you call array.filter() it will make a
duplicate Array, things you change there won't get changed in your source
(depending on references etc). You don't need to totally change your code,
just create a new ArrayCollection using your existing array as the source.
Whenever you add or delete items using the ArrayCollection, it will update
the Array for you, and when you set a filter on ArrayCollection it only
updates when it needs to, it's pretty smart. Then you just bind to the
ArrayCollection instead of the Array for the dataProvider of your List or
DataGrid or whatever.

-Josh

On Fri, Dec 5, 2008 at 6:42 AM, anuj sharma [EMAIL PROTECTED] wrote:

  Not with the above code
 Anuj


 On Thu, Dec 4, 2008 at 12:21 PM, Tracy Spratt [EMAIL PROTECTED]wrote:

Array is not bindable.  Do you not get a warning?

 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *anuj sharma
 *Sent:* Thursday, December 04, 2008 2:44 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Fwd: Filtering the List Entries depending
 upon the text entered in text Input box



 I would be able to successfully implement the same code with Array instead
 of ArrayCollection but there is no method name array.refresh, However there
 is method named ArrayCollection.refresh which is responsible for refreshing
 my list. How do I refresh my array?Does anybody know equivalent method to
 refresh array in the list? Below is the code except in the processfilter I
 need to refresh array.
 Thanks for your help
 Anuj
 /***CODE*/

 mx:Script
 ![CDATA[

 import mx.managers.PopUpManager;
 import mx.effects.DefaultTileListEffect;
 import mx.rpc.events.ResultEvent;
 import mx.controls.Alert;
 import mx.collections.ArrayCollection;
 import mx.effects.easing.Elastic;

 [Bindable]
 public var ac:ArrayCollection = new
 ArrayCollection([One-Device,Two-Device,Three-Device,Four-Device,Five-Device,Six-Device]);
 [Bindable]
   public var arr:Array=[One,Second,Third];
 [Bindable]
 public var filterText:String = '';

 private function doChange():void
 {
 this.filterText = txtSearch.text;
 //this.ac.refresh();
 }

 private function init():void
 {
 arr.filter(processFilter);
 }
 private function processFilter(item:Object,index:int,
 array:Array):Boolean
 {
 return
 String(item).toUpperCase().indexOf(filterText.toUpperCase()) = 0;

 }
 private function seeLabel(evt:Event):void
 {
 var alrt:Alert=Alert.show(evt.currentTarget.toString());
 }

 ]]
 /mx:Script
 mx:List x=74 y=228 width=229 height=238 dataProvider={arr}
 id=DevicesList/mx:List
 mx:TextInput x=74 y=198 id=txtSearch change=doChange()/


 On Thu, Dec 4, 2008 at 11:05 AM, anuj sharma [EMAIL PROTECTED] wrote:

 Hi Josh
 Thanks a lot, That works perfectly for my arrayCollection. Now I already
 have a project in which the data provider for my List is Array and I need
 the same filter functionality for the Array. can we do this filter for Array
 too or do i have to change the code of my project and instead of array I
 need to store complete data in ArrayCollection instead of Array and then
 made that filter working. It's just lot of work to change the existing
 workign code with my harsh deadline.
 Please let me know which is the best way.
 Again I highly appreciate your help
 Anuj



 On Wed, Dec 3, 2008 at 7:25 PM, Josh McDonald [EMAIL PROTECTED] wrote:

 private function processFilter(item:Object):Boolean
 {

 return
 String(item).toUpperCase().indexOf(filterText.toUpperCase()) = 0;
 }

 -Josh

 --
 Therefore, send not to know For whom the bell tolls. It tolls for thee.

 Like the cut of my jib? Check out my Flex blog!

 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]
 :: http://flex.joshmcdonald.info/
 :: http://twitter.com/sophistifunk






 




-- 
Therefore, send not to know For whom the bell tolls. It tolls for thee.

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk


Re: [flexcoders] How do i implement e4x like filters in my custom class

2008-12-04 Thread Josh McDonald
Unfortunately you can't yet, which is definitely a shame. We'd all love to
do that, there's a feature request somewhere on the Adobe bugs site you can
vote for I believe.

-Josh

On Thu, Dec 4, 2008 at 4:47 PM, ADK [EMAIL PROTECTED] wrote:

 I have built a galaxy of data structures, in a hierarchical order. I
 can easily transverse and zero-on onto the object given a few params.


 Now what i want to do is write an E4X like statement like:

 var myObject:Object = car.objects().(name() == radiator  @id
 ==PART2234  @r==12);

 and it calls name() of my carpart object, and retrieve id, r. my
 carpart class is dynamic

 Here are a few points on my class.

 1. Objects() will return an Array of various car parts like radiator,
 carb, hoses, enginebox etc etc
 2. i wanna avoid filtering using filter function callbacks in
 arraycollection. just wanna enable use of e4x like expressions in
 my class
 3. all my classes returned by objects() are of type class partbase
 which does not have a base class (like XML, XMLList)


 I opened Global.as. and looked at XMLList nd XML class headers..
 pretty straight, has no base class nothing at all to raise eyebrows.


 Oh i get an run time error:

 TypeError: Error #1123: Filter operator not supported on type
 com.parts.EngineBlock
 an object of com.parts.EngineBlock was in the first of the Objects
 array...

 Thanks a ton,


 ady



 

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






-- 
Therefore, send not to know For whom the bell tolls. It tolls for thee.

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk


RE: [flexcoders] Re: Using RMTPS channel

2008-12-04 Thread Seth Hodgson
The NetConnection.Connect.SSLHandshakeFailed status indicates that the 
platform SSL library for the machine you're running the player on decided not 
to complete the handshake for some reason. Unfortunately, the platform library 
doesn't give the player much in the way of useful detail...

I think the most probable reason for the failure in your case is the use of an 
IP in the CN field of your cert. You should use an actual domain name instead. 
DynDNS can be a great way of creating a test domain name to use for this sort 
of testing.

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ivhaggi
Sent: Thursday, December 04, 2008 2:11 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Using RMTPS channel

Hi again Seth,

I follow your solution, I imported the certificate to my FireFox
browser to the section Your certificates.

I also import my cacert.cert into FireFox in the Authorities section
and in this
path/System/Library/Frameworks/JavaVM.framework/Home/lib/security, in
the cacerts file i have the next entry:

Alias name: myprivateca
Creation date: Dec 4, 2008
Entry type: trustedCertEntry

Owner: [EMAIL PROTECTED], CN=10.100.72.165,
OU=asigna, O=asigna, L=mexico, ST=mexico, C=MX
Issuer: [EMAIL PROTECTED], CN=10.100.72.165,
OU=asigna, O=asigna, L=mexico, ST=mexico, C=MX
Serial number: 875fed8624c6414d
Valid from: Thu Dec 04 12:31:19 CST 2008 until: Fri Dec 04 12:31:19
CST 2009
Certificate fingerprints:
MD5: 3D:AB:30:93:34:56:E7:DA:E6:41:D0:52:F9:38:54:E0
SHA1: E1:83:9E:4C:8C:A2:BB:EA:D0:EE:E8:14:EE:C1:6F:C9:F5:4C:91:7E

***
***

After i tried again in debug mode and the Flex Builder console show me
the next one:

'my-rtmps' channel got connect attempt status. (Object)#0
code = NetConnection.Connect.Failed
level = error
'my-rtmps' channel polling stopped.
'my-rtmps' channel connect failed.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer channel faulted with
Channel.Connect.Failed undefined url:'rtmps://10.100.72.165:2038'
'7540C905-0C6E-84BE-E092-040409E73F95' consumer starting resubscribe
timer.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe.
'my-rtmps' channel got connect attempt status. (Object)#0
code = NetConnection.Connect.SSLHandshakeFailed
level = status
'7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe.
'my-rtmps' channel got connect attempt status. (Object)#0
code = NetConnection.Connect.Failed
level = error
'my-rtmps' channel polling stopped.
'my-rtmps' channel connect failed.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer channel faulted with
Channel.Connect.Failed undefined url:'rtmps://10.100.72.165:2038'
'7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe.
'my-rtmps' channel got connect attempt status. (Object)#0
code = NetConnection.Connect.SSLHandshakeFailed
level = status
'7540C905-0C6E-84BE-E092-040409E73F95' consumer stopping resubscribe
timer.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer fault for
'7570FE6F-FBAC-B48A-F254-0404457B1783'.
'my-rtmps' channel got connect attempt status. (Object)#0
code = NetConnection.Connect.Failed
level = error
'my-rtmps' channel polling stopped.
'my-rtmps' channel connect failed.
'7540C905-0C6E-84BE-E092-040409E73F95' consumer channel faulted with
Channel.Connect.Failed undefined url:'rtmps://10.100.72.165:2038'
'7540C905-0C6E-84BE-E092-040409E73F95' consumer fault for
'7570FE6F-FBAC-B48A-F254-0404457B1783'.

What im doing wrong or what could be the problem??

Thank so much for your help Seth

--- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote:

 The NetStatusEvent underlying the connect error you're seeing has
the code: NetConnection.Connect.CertificateUntrustedSigner

 This indicates that the connection is being closed because the
server certificate (self-signed in your case) that you're using for
your SecureRTMPEndpoint is not in your browser's trust store.
 This wouldn't be an issue if you were using a cert signed by a CA,
but can be more trouble when dealing with self-signed certs.
 You need to import the server certificate into your browser's trust
store - Googling around should get you the info you need.
 Also, the name in your server cert should match the domain name the
client is hitting, in this case, 10.100.72.165, so that might be
something else to double check.

 Other than that, your configuration looks fine based on a quick skim.

 Best,
 Seth

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of ivhaggi
 Sent: Wednesday, December 03, 2008 2:48 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Using RMTPS channel

 Thanks for your quickly response Seth Well this is the top of the
 iceberg =P the problem began when i switch to use the SecureRTMP
 

Re: [flexcoders] Tricky one...adding attachments to an email generated from the app

2008-12-04 Thread Fotis Chatzinikos
Upload the files to the server, get some unique ids back, send the mail text
and the ids back to the server,
prepare and send the mail attaching the files the ids descrinbe and remember
to delete the files ;-)

On Thu, Dec 4, 2008 at 11:36 PM, Ryan Graham [EMAIL PROTECTED]wrote:

Perhaps you could gather the attachments in flex, add  a parameter to
 your webservice for them, base64 encode them for transfer via that
 parameter, then base64 decode them back to binary files on the server when
 sending the email?  Note, base64 encoding binary data increases its size
 roughly 30% for the transfer to the server. Not sure if bandwidth is an
 issue in your scenario.



 HTH,

 Ryan



 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Adrian Williams
 *Sent:* Thursday, December 04, 2008 2:12 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Tricky one...adding attachments to an email
 generated from the app



 Hi guys,

 And yet another one that I haven't seen...

 Part of our app allows a user to send an email to one or more folks in
 their view.  We simply provide a state that has a simple email form they
 fill out and then we pass that information back through our web service
 (.NET) that actually has the procedure to send the email.

 What I need to be able to do is allow the user to add attachments to
 the email they want to send out.  Is there any way to do this and is there a
 better method to the email solution?  We briefly toyed with the idea of just
 creating the hyperlink to use their own email client, but a user can
 literally send a bulk email to several thousand people and a hyperlink would
 die a slow, miserable death trying to handle that.

 Thanks!
 Adrian

  This message is private and confidential. If you have received it in
 error, please notify the sender and remove it from your system.
  




-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],


[flexcoders] How to display special characters like #176; in ComboBox list

2008-12-04 Thread Tracy Spratt
The special character numeric references work fine in Label and Text and
such, but are interpreted literally in a ComboBox's drop list.

Any sugestions?

Tracy


Re: [flexcoders] Fwd: Filtering the List Entries depending upon the text entered in text Input box

2008-12-04 Thread anuj sharma
Awesome , Cool I followed that and after little tweaks, it is working for
me.
Josh, David, Tracy and Alex , Thanks a lot for your help guys. I appreciate
that
Anuj

On Thu, Dec 4, 2008 at 3:07 PM, Josh McDonald [EMAIL PROTECTED] wrote:

   Never bind to array, and also when you call array.filter() it will make
 a duplicate Array, things you change there won't get changed in your source
 (depending on references etc). You don't need to totally change your code,
 just create a new ArrayCollection using your existing array as the source.
 Whenever you add or delete items using the ArrayCollection, it will update
 the Array for you, and when you set a filter on ArrayCollection it only
 updates when it needs to, it's pretty smart. Then you just bind to the
 ArrayCollection instead of the Array for the dataProvider of your List or
 DataGrid or whatever.

 -Josh


 On Fri, Dec 5, 2008 at 6:42 AM, anuj sharma [EMAIL PROTECTED] wrote:

  Not with the above code
 Anuj


 On Thu, Dec 4, 2008 at 12:21 PM, Tracy Spratt [EMAIL PROTECTED]wrote:

Array is not bindable.  Do you not get a warning?

 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *anuj sharma
 *Sent:* Thursday, December 04, 2008 2:44 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Fwd: Filtering the List Entries depending
 upon the text entered in text Input box



 I would be able to successfully implement the same code with Array
 instead of ArrayCollection but there is no method name array.refresh,
 However there is method named ArrayCollection.refresh which is responsible
 for refreshing my list. How do I refresh my array?Does anybody know
 equivalent method to refresh array in the list? Below is the code except in
 the processfilter I need to refresh array.
 Thanks for your help
 Anuj
 /***CODE*/

 mx:Script
 ![CDATA[

 import mx.managers.PopUpManager;
 import mx.effects.DefaultTileListEffect;
 import mx.rpc.events.ResultEvent;
 import mx.controls.Alert;
 import mx.collections.ArrayCollection;
 import mx.effects.easing.Elastic;

 [Bindable]
 public var ac:ArrayCollection = new
 ArrayCollection([One-Device,Two-Device,Three-Device,Four-Device,Five-Device,Six-Device]);
 [Bindable]
   public var arr:Array=[One,Second,Third];
 [Bindable]
 public var filterText:String = '';

 private function doChange():void
 {
 this.filterText = txtSearch.text;
 //this.ac.refresh();
 }

 private function init():void
 {
 arr.filter(processFilter);
 }
 private function processFilter(item:Object,index:int,
 array:Array):Boolean
 {
 return
 String(item).toUpperCase().indexOf(filterText.toUpperCase()) = 0;

 }
 private function seeLabel(evt:Event):void
 {
 var alrt:Alert=Alert.show(evt.currentTarget.toString());
 }

 ]]
 /mx:Script
 mx:List x=74 y=228 width=229 height=238 dataProvider={arr}
 id=DevicesList/mx:List
 mx:TextInput x=74 y=198 id=txtSearch change=doChange()/


 On Thu, Dec 4, 2008 at 11:05 AM, anuj sharma [EMAIL PROTECTED] wrote:

 Hi Josh
 Thanks a lot, That works perfectly for my arrayCollection. Now I already
 have a project in which the data provider for my List is Array and I need
 the same filter functionality for the Array. can we do this filter for Array
 too or do i have to change the code of my project and instead of array I
 need to store complete data in ArrayCollection instead of Array and then
 made that filter working. It's just lot of work to change the existing
 workign code with my harsh deadline.
 Please let me know which is the best way.
 Again I highly appreciate your help
 Anuj



 On Wed, Dec 3, 2008 at 7:25 PM, Josh McDonald [EMAIL PROTECTED] wrote:

 private function processFilter(item:Object):Boolean
 {

 return
 String(item).toUpperCase().indexOf(filterText.toUpperCase()) = 0;
 }

 -Josh

 --
 Therefore, send not to know For whom the bell tolls. It tolls for thee.

 Like the cut of my jib? Check out my Flex blog!

 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]
 :: http://flex.joshmcdonald.info/
 :: http://twitter.com/sophistifunk









 --
 Therefore, send not to know For whom the bell tolls. It tolls for thee.

 Like the cut of my jib? Check out my Flex blog!

 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]
 :: http://flex.joshmcdonald.info/
 :: http://twitter.com/sophistifunk
  



  1   2   >