[flexcoders] 2032 Stream Error - Deploying XML Application Configuration Data

2008-12-07 Thread pbrendanc
I have created some application configuration files (e.g. app menu)
that I need to load during startup. In development I have defined  the
following service that loads this data from a local file. 

mx:HTTPService id=appmenuService url=data/appmenu.xml
resultFormat=e4x /

I' m trying to deploy this app to a google site and am getting 2032
errors. This is the error:

[RPC Fault faultString=HTTP request error
faultCode=Server.Error.Request faultDetail=Error: [IOErrorEvent
type=ioError bubbles=false cancelable=false eventPhase=2 text=Error
#2032: Stream Error. URL:
http://8882909683684169354-a-1802744773732722657-s-sites.googlegroups.com/site/myflexdemos/Home/applinks/appmenu.xml;].
URL: appmenu.xml]

I was hoping to be able to load this data from the XML files that I
have uploaded. (All the files are in the same domain so I don't think
crossdomain.xml is required here - I did add a cross domain file, but
still get the error.)

I'm not sure if this is a Path/Directory error or if I need to create
a new application service on the server to retrieve that data. (This
would seem to defeat the purpose of having XML configuration files in
the first place).

The more general question here is how to retrieve data from XML data
that resides on the host?

Any suggestions?
TIA,
Patrick




[flexcoders] Re: 2032 Stream Error - Deploying XML Application Configuration Data

2008-12-07 Thread pbrendanc
Tracy,
Thx for the info - please post the snippets/examples - these may help
other in the future.

TIA
Patrick

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

 I have had so many problems using relative paths that I do not use
them
 any more.



 Instead, I pass fully qualified root url(s) into my apps via
 flashvars.  I no longer have any pathing issues.  This also allows for
 multiple launch confgurations in development and for configuring
 multiple implementations in production.



 Let me know if you want some code snippets.



 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
 Behalf Of pbrendanc
 Sent: Sunday, December 07, 2008 2:29 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] 2032 Stream Error - Deploying XML Application
 Configuration Data



 I have created some application configuration files (e.g. app menu)
 that I need to load during startup. In development I have defined the
 following service that loads this data from a local file.

 mx:HTTPService id=appmenuService url=data/appmenu.xml
 resultFormat=e4x /

 I' m trying to deploy this app to a google site and am getting 2032
 errors. This is the error:

 [RPC Fault faultString=HTTP request error
 faultCode=Server.Error.Request faultDetail=Error: [IOErrorEvent
 type=ioError bubbles=false cancelable=false eventPhase=2 text=Error
 #2032: Stream Error. URL:

http://8882909683684169354-a-1802744773732722657-s-sites.googlegroups.co
 m/site/myflexdemos/Home/applinks/appmenu.xml

http://8882909683684169354-a-1802744773732722657-s-sites.googlegroups.c
 om/site/myflexdemos/Home/applinks/appmenu.xml ].
 URL: appmenu.xml]

 I was hoping to be able to load this data from the XML files that I
 have uploaded. (All the files are in the same domain so I don't think
 crossdomain.xml is required here - I did add a cross domain file, but
 still get the error.)

 I'm not sure if this is a Path/Directory error or if I need to create
 a new application service on the server to retrieve that data. (This
 would seem to defeat the purpose of having XML configuration files in
 the first place).

 The more general question here is how to retrieve data from XML data
 that resides on the host?

 Any suggestions?
 TIA,
 Patrick





[flexcoders] Blogging Options/Services that support Flex apps? Wordpress/Other?

2008-12-05 Thread pbrendanc
I'm interested in creating a Flex related blog that will also contain
sample Flex code/apps. I'd prefer to manage this all in one place -
without using a separate web host for the app data files.

I don't need a database - just content management + swf storage. I'm
looking at Wordpress but I'm not sure if they host the swf files. 

What are others using to do this - any suggestions - fwiw I do not
currently have any hosting services so I'm pretty open.

TIA
Patrick



[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] Shared Data Options/Strategies

2008-11-13 Thread pbrendanc
I am retrieving data from a service and saving this in a VO. This is
done within a component (actually within a PopUp Search window) - I am
saving the currently selected employee data record. 

However I want to make the VO data accessible across the entire app
and to all components in the app (iow - this is application wide
data).  (BTW - This is static data that will not change - basically it
is header info that appears on multiple forms etc.). 

(I know I can bind form elements to the VO for display purposes - just
not sure how/where to create the VO).
 
Some specific qns:

If I define the VO at the application level, how do I pass this to a
component (PopUp) so it can be populated and later made available to
other app components? 

How do I reference the VO from other components?

TIA,
Patrick



[flexcoders] DataGrid ItemRenderer - Reuse with Parameters vs Cloning

2008-11-12 Thread pbrendanc
I have a datagrid containing rows with multiple date columns. I need
to change the cell background color based on the date value (e.g. 90
days old is red etc.) 

However the rules vary based on the column - for now I've created 
similar custom item renderers with different business rules based on
the date value. (e.g. For Col 1 - use red if  90 days; for Col 2 use
red if  15 days etc). This results in unnecessary duplication of code.

Is there a way to pass a parameter to a Custom Item Renderer so I can
reuse it with multiple columns.

(BTW - I don't have access to the Advanced Data Grid so that is not an
option).

TIA,
Patrick



[flexcoders] How to share VO with multiple components/views - Nested Binding?

2008-11-11 Thread pbrendanc
I have some data (e.g. currently selected employee summary data) that
appears (Read Only) on several views/components. 

I am retrieving the selected data and saving in a VO object, but I'd
like to share this VO data with several forms/views - I thought I
could do this via binding, but some of the views are nested within
other components so I'm not sure how to set this kind of
(indirect/nested) binding syntax or if this is possible.

There must be a better way - anyone suggest an alternative appproach
or provide an example of sharing a VO with multiple forms/views?

TIA,
Patrick  



[flexcoders] E4X equivalent to SQL where 'like %' expression ?

2008-11-06 Thread pbrendanc
I'd like to extract the list of emps from the following XML where name
starts with 'Jo' (returns Jones, Johnson). In SQL I can use the
expression 'where name like 'Jo%'.

Anyone have examples of how this be done via an E4X expression 
(I could not find any examples of this in the docs).

TIA,
Patrick

mx:XMLList id=emplist
emp
id1/id
nameSmith/name
mrn1000/mrn
dob1/1/1964/dob
/emp
emp
id2/id
nameJones/name
mrn1001/mrn
dob11/11/1951/dob
/emp
emp
id3/id
nameJohnson/name
mrn1003/mrn
dob3/3/1953/dob
/emp
/mx:XMLList



[flexcoders] Seeking master/detail data grid example for CRUD app

2008-10-28 Thread pbrendanc
I have a data grid that shows a list of summary records. When I
(double)click on a row I want to display an editable detail form that
shows the selected record in detail and then hide the summary list. 
Can anyone point me to any existing sample code  for  this kind of
navigation. I'm interested in seeing how the selected record id is
passed from the summary datagrid to the detail view and how  the
appropriate wiring/events are handled.
TIA,Patrick


[flexcoders] Re: How do we implement pop-up input in Flex?

2008-08-01 Thread pbrendanc
Hi,
I just created a demo Flex app that uses a popup - see
myflexapps.appspot.com - check out my demo and if you are stuck I can
pull out the appropriate code for you that shows how this works.

Patrick



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

 Dear all,

 I want to have a popup input in my flex apps where the values in the
 popup window will be set to the parent window that calls this popup
 window. How do we set the variable chosen to the parent window in
 Flex? Could anyone give me a hint on these please.

 Many thanks

 --
 Setting a new landmark.

 Blog: http://joshuajava.wordpress.com/





[flexcoders] Flex PopUp - Background Transparency Question

2008-08-01 Thread pbrendanc
My app uses a popup window - however the background window shows
through a bit more that I like - how can I fade the background so that
it's still visible bit rather dim while the popup is displayed? 
(You can see the app at myflexapps.appspot.com).

I know there are some alpha settings - is that the best way to
accomplish this?

TIA,
Patrick 





[flexcoders] Any future plans to support ODBC Connections for AIR applications?

2008-07-31 Thread pbrendanc
I know this has come up before but there is a significant need to
access data in desktop  databases (Read Only would be OK). (e.g. I am
working with the Google App Engine and there is no easy way to
populate their datastore). 

A GUI upload app written in AIR could be great for this. I've thought
about doing a small GUI in Python since the libraries are available -
however I'd prefer to use AIR for GUI development.

While support for this may not be available out of the box I wondered
if some 3rd party libraries might be available for this - e.g. Python
has extensive libraries than can be used to access Excel, Access etc.

Any chance that similar Flex/AIR/Actionscript libs might be developed?
Anyone else out there thought about doing this?

TIA,
Patrick



[flexcoders] Re: Any future plans to support ODBC Connections for AIR applications?

2008-07-31 Thread pbrendanc
I understand the tcp approach but that's just a really
roundabout/indirect approach vs a direct db connection of some sort
(maybe native drivers if ODBC is not your thing - again look at the
Python libraries) .

I'd be curious to hear the official Adobe position on this and whether
this is a feature they may offer in the future. Since AIR allows access
to the file system (XML or csv text files only AFAIK) I can see folks
asking for other access to other file types (e.g. MS Excel).  I can also
understand that Adobe may see this somewhat problematic from a
marketing/product positioning/support standpoint.

FWIW I don't think this issue will go away if AIR gets real traction in
the market place. There are just so many desktop database apps out there
that are begging to be web enabled.

Just my $0.02c-
Patrick



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

 That being said, I know you can do ODBC over tcp, so if you've got
some sort
 of server available that can route from odbc over tcp to a local file
DSN,
 you could probably write a socket ODBC client for AIR, and then charge
 people in your position a fortune to use it. People stuck in
Windows-world
 seem to be used to that sort of thing. Sounds like pain though :D

 -Josh

 On Thu, Jul 31, 2008 at 5:45 PM, Josh McDonald [EMAIL PROTECTED] wrote:

  It's pretty evil. I'd just ship a 30-lines-of-c# utility to pull the
data
  out and put it in something standard that your air app can
understand.
 
  -Josh
 
 
 


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

 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]





[flexcoders] How to control positioning of Dynamic Control in a panel?

2008-07-28 Thread pbrendanc
I have a panel that will contain a dynamically created custom grid
component(the size is determined at run time). The grid is added to
the panel via the panel.AddChild() method and is placed at the bottom
of the form by default. I need to place a control bar (and other
controls) below the grid.

Currently the AddChild() puts the grid at the bottom of the form,
after, rather than before the control bar. I need it to go before the
control bar (in the middle of a VBox actually).

Is there a way to set up a placeholder or template to force the grid
placement correctly? Is this possible? Any refs on how to do this?

TIA,
Patrick



[flexcoders] Re: HTTP Service Send Requests with Parameter Object - 405 Errors?

2008-07-17 Thread pbrendanc
Since I'm not binding the data to any visible fields i want to handle
this in as - so I'd like to understand what does/doesn't work using as -
I like to use code behind as much as possible.

BTW - I did resolve my 405 error as an IIS issue - however I'm not
seeing the data defined in my parameter object in the http request (on
the server side). (I'll post a separate message on this)

Patrick

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

 This is trivial with a normal mx:Object.  Are you committed to sending
a
 custom object?



 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
 Behalf Of pbrendanc
 Sent: Wednesday, July 16, 2008 5:44 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] HTTP Service Send Requests with Parameter Object
-
 405 Errors?



 The Flex docs specify that the send object can contain either
Name/Value
 pairs of an XML object but I keep getting errors.
 Is it possible to pass a (non null) parameter object in the HTTP
service
 send request - I keep getting HTTP405 (Method not allowed) errors. (If
 I include these args as part of the query string everything works as
 expected).

 (BTW - I'm using IIS - so is it possible that I need to change some
IIS
 settings?)

 // Define test object

 public class dummyobj
 {
 public var f1:String;
 public var f2:String;
 }

 public function useHttpService(parameters:Object):void {

 var httpSvc = new HTTPService();
 httpSvc.url= http://localhost:8080 http://localhost:8080 ;
 httpSvc.method = POST;
 httpSvc.contentType = application/x-www-form-urlencoded;
 httpSvc.addEventListener(result, httpResult);
 httpSvc.addEventListener(fault, httpFault);

 // Load request parameters into an object
 // to send with the request
 var testVO:dummyobj = new dummyobj();
 testVO.f1 = aaa;
 testVO.f2 = bbb;
 httpSvc.send(testVO); // gets 405
 error

 TIA,
 Patrick





[flexcoders] Re: Google CodeJam

2008-07-17 Thread pbrendanc
Interested in more info on this - do you have a link?


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

 Any other coders in Google CodeJam using Flex? :D  I passed the
 qualifying round last night.  I only ran one test (all I need to do to
 move on) - after which I realized we can run all 3 available.  Ooops!
 But back to the question - anyone else out there participating in the
 event using Flex? :D





[flexcoders] Re: HTTPService receiving an array as parameter

2008-07-17 Thread pbrendanc
Guilherme,
I'm also testing this and have passed a parameter object as part of my
HTTP request as follows:

 httpSvc.send(testVO);

However I'm not seeing the parameter values in the HTTP request when I
debug on the server side.  However they do show up when I look at the
request using the Web development helper tool (very useful tool/plugin
to monitor request/responses - here's a link):

 http://projects.nikhilk.net/WebDevHelper/

I'm not even sure if this is supposed to work (the docs here might be
wrong/misleading as they show that a parameter arg for send method -
however the Flex examples I've seen never populate the parameter object
).  Like you I also want to pass an array via HTTP (my data is not bound
to a form field so I don't want to use mxml).

I may be missing something really obvious here - can't think what . 
Perhaps it depends on the server side implementation of the httpRequest
Object but i thought that was pretty standard.

If anyone can jump in here with sample working code that would really
help.

Patrick

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

 Hi guys,


 I'm interested if it's possible to send an array as a parameter when
 doing an HTTP request.
 Curretly, we can directly do it:

 foo[]=1foo[]=2foo[]=3

 Most server side languages understand this as

 foo = Array(
   [0] = 1,
   [1] = 2,
   [2] = 3
 )

 I tried the same in Flex:

 var params:Object = new Object();

 params.foo = new Array();
 params.foo.push(1);
 params.foo.push(2);
 params.foo.push(3);

 service.send(params);

 But it doesn't work... I'm curious how can this be achieved in Flex


 Thanks in advance,


 Regards,

 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil





[flexcoders] Resetting/Clearing Project Server Properties

2008-07-17 Thread pbrendanc
Is there a way to clear the project server properties once they have
been created - I was unable to do this so my work around was to create a
new project and copy my components to it , then setting the project
server property to 'none'.

This seems a bit redundant and I wondered if there is an easier way.

Patrick




[flexcoders] Re: HTTPService receiving an array as parameter

2008-07-17 Thread pbrendanc
FYI - I'm seeing the same thing as you with my tests - it looks like
only the first array element is available on the server side
(There may be a Flex/HTTP limitation here - not sure ).

 var  ipArray:Array = [];
 var rowdata:String = '';
 rowdata ='1234';
  for (var j:int=0 ; j3;j++) {  // populate
array -  adding  3  array elements
 ipArray.push(rowdata);
 }
 // Prepare to send
 testVO.ipArray= ipArray;
 httpSvc.send(testVO);//Am only only
seeing the first array element server side
 }

 public class testVO
 {
 public var ipArray:Array;
 }


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

 There's one thing you missed here

 I have this:

 var params:Object = new Object();
 params.viewId = _viewId;

 itemService.send(params);


 And it works ok...


 But If I try this:

 var params:Object = new Object();

 params.viewId = _viewId;

 params.foo = new Array();
 params.foo.push(1);
 params.foo.push(2);
 params.foo.push(3);

 service.send(params);


 It doesn't work.
 Currently I do like this:

 var params:Object = new Object();

 params.viewId = _viewId;

 params.foo_0 = 1;
 params.foo_1 = 2;
 params.foo_2 = 3;

 service.send(params);


 To be able to get it working... so... my question is if it's possible
 to send an array through service.


 []s,


 On Thu, Jul 17, 2008 at 3:36 PM, pbrendanc [EMAIL PROTECTED] wrote:
  Guilherme,
  I'm also testing this and have passed a parameter object as part of
my
  HTTP request as follows:
 
  httpSvc.send(testVO);
 
  However I'm not seeing the parameter values in the HTTP request when
I
  debug on the server side. However they do show up when I look at the
  request using the Web development helper tool (very useful
tool/plugin
  to monitor request/responses - here's a link):
 
  http://projects.nikhilk.net/WebDevHelper/
 
  I'm not even sure if this is supposed to work (the docs here might
be
  wrong/misleading as they show that a parameter arg for send method -
  however the Flex examples I've seen never populate the parameter
object
  ). Like you I also want to pass an array via HTTP (my data is not
bound
  to a form field so I don't want to use mxml).
 
  I may be missing something really obvious here - can't think what .
  Perhaps it depends on the server side implementation of the
httpRequest
  Object but i thought that was pretty standard.
 
  If anyone can jump in here with sample working code that would
really
  help.
 
  Patrick
 
  --- In flexcoders@yahoogroups.com, Guilherme Blanco
 
  guilhermeblanco@ wrote:
 
  Hi guys,
 
 
  I'm interested if it's possible to send an array as a parameter
when
  doing an HTTP request.
  Curretly, we can directly do it:
 
  foo[]=1foo[]=2foo[]=3
 
  Most server side languages understand this as
 
  foo = Array(
  [0] = 1,
  [1] = 2,
  [2] = 3
  )
 
  I tried the same in Flex:
 
  var params:Object = new Object();
 
  params.foo = new Array();
  params.foo.push(1);
  params.foo.push(2);
  params.foo.push(3);
 
  service.send(params);
 
  But it doesn't work... I'm curious how can this be achieved in Flex
 
 
  Thanks in advance,
 
 
  Regards,
 
  --
  Guilherme Blanco - Web Developer
  CBC - Certified Bindows Consultant
  Cell Phone: +55 (16) 9166-6902
  MSN: guilhermeblanco@
  URL: http://blog.bisna.com
  Rio de Janeiro - RJ/Brazil
 
 
 



 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil





[flexcoders] HTTP Service Send Requests with Parameter Object - 405 Errors?

2008-07-16 Thread pbrendanc
The Flex docs specify that the send object can contain either Name/Value
pairs of an XML object but I keep getting errors.
Is it possible to pass a (non null) parameter object in the HTTP service
send request - I keep getting HTTP405 (Method not allowed) errors.  (If
I include these args  as part of the  query string everything  works as
expected).

(BTW - I'm using IIS - so is it possible that I need to change some IIS
settings?)

// Define test object

 public class dummyobj
 {
 public var f1:String;
 public var f2:String;
 }

public function useHttpService(parameters:Object):void {

var   httpSvc = new HTTPService();
 httpSvc.url= http://localhost:8080;;
 httpSvc.method = POST;
 httpSvc.contentType = application/x-www-form-urlencoded;
 httpSvc.addEventListener(result, httpResult);
 httpSvc.addEventListener(fault, httpFault);

 // Load request parameters into an object
 // to send with the request
 var testVO:dummyobj = new dummyobj();
 testVO.f1 = aaa;
 testVO.f2 = bbb;
 httpSvc.send(testVO);// gets 405
error

TIA,
Patrick






[flexcoders] Re: Problem Adding Custom Event Listeners in a component?

2008-07-07 Thread pbrendanc
Thx - I think I get it now - the  default dispatcher works only for 
parents /child relationships of graphics objects only. If objects are
external (e.g. siblings, non visual  etc.) a custom dispatcher than
maintains a list of related components via some registration mechanism
is required. I assume the best place to perform such registration  would
be in the  constructor of my custom class. (I assume this is how
Cairngorm and other frameworks are managing inter  object/component
communication).

Thx for setting me straight here. FWIW this is part of a game board demo
I'm putting together and it could be the basis for a useful
demo/tutorial on to share with others - any suggestions on where to post
this type of example (I don't currently maintain a web site or blog).?

Thx again
Patrick

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

 In general, you have to be listening to the object that is
dispatching.
 If you use bubble or capture, you can listen to parents if they are
 display objects.



 3 siblings would need to know about each other and listen to each
other.
 Having them register with a central object that dispatches on their
 behalf or they dispatch from might be better.  That's how
 RadioButton/RadioButtonGroup work.



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
 Behalf Of pbrendanc
 Sent: Sunday, July 06, 2008 4:29 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Problem Adding Custom Event Listeners in a
 component?



 I think I need some additional clarification here as I'm not sure why
 this is not OK- (I expect the button to respond to the custom event
 regardless of who dispatched this event).

 Imagine 3 buttons in a grid: B1, B2,B3. Clicking on any button and
 updates the appearance (e.g. label color) of the other 2 buttons (i.e.
 everyone else but the clicked button). Do this w/out any hard coding
 the names in click events etc. - each button gets a list of dependent
 btn ID's - if you are on the list update yourself, otherwise ignore.

 What I need to do here is to have the containing (parent??) form
 intercept (override?) the button click event, perform some
preprocessing
 (e.g. build a list) and forward this list by dispatching a custom
event
 . (In the example below you can see that clicking a button affects
 other buttons.

 Where I'm stuck is on how best to setup the listeners ,and intercept
 the parent button click event. Per my previous message the custom
 handler on the button is never triggered.

 (Maybe I'm missing the wood for the tree's here - however it's a good
 exercise that will solidify my understanding of the Flex event model)

 TIA,
 Patrick

 --- [EMAIL PROTECTED]
mailto:Inflexcoders%40yahoogroups.com
 , Alex Harui aharui@ wrote:
 
  Hard to say from the code snippets, but it looks like your button is
  listening for addItemEvent on itself, but it is the app that is
  dispatching
 
 
 
  
 
  From: flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 [mailto:flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 ]
 On
  Behalf Of pbrendanc
  Sent: Sunday, July 06, 2008 2:28 AM
  To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
  Subject: [flexcoders] Problem Adding Custom Event Listeners in a
  component?
 
 
 
  I have a custom button on which I want to listen to some custom
  events. For some reason in the following code my custom events are
  never heard/triggered.
 
  1)In the button's constructor I added the listeners as follows:
 
  // Custom Class Code
  public class testButton extends Button
  {
  //constructor
  public function testButton {
  addEventListener (MouseEvent.MOUSE_OVER, handleMouseOver);
  // custom event
  addEventListener(addItemEvent, handleAddItemEvent);
  }
  public function handleMouseOver (event:MouseEvent):void {
  // display as a tooltip
  this.toolTip = Say Cheese;
 
  public function handleAddItemEvent():void {
  // display as a tooltip
  Alert.show (testButton Event: Add Item Event);
 
  2) Parent Form Code (app.mxml)
 
  mx:Metadata
  [Event(name=addItemEvent, type = flash.events.Event)]
  /mx:Metadata
 
  // Code in test button to dispatch custom event
  //
  private function triggerEventHandler():void {
  //Alert.show (Broadcast Event);
  dispatchEvent(new Event(addItemEvent,true));
  }
 
  This looks like it should work, but only the MouseOver event is ever
  fired - am I missing something obvious?
 
  TIA
  Patrick
 





[flexcoders] Problem Adding Custom Event Listeners in a component?

2008-07-06 Thread pbrendanc
I have a custom button on which I want to listen to some custom
events.  For some reason in the following code my custom events are
never heard/triggered.

1)In the button's constructor I added the listeners as follows:

// Custom Class Code
public class testButton extends Button
{
//constructor   
 public function testButton {
addEventListener (MouseEvent.MOUSE_OVER, handleMouseOver);  

// custom event
addEventListener(addItemEvent, handleAddItemEvent);   
}
public function handleMouseOver (event:MouseEvent):void {   
// display as a tooltip
this.toolTip = Say Cheese;

public function handleAddItemEvent():void { 
// display as a tooltip
Alert.show (testButton Event: Add Item Event);


2) Parent Form Code (app.mxml)

mx:Metadata
[Event(name=addItemEvent, type = flash.events.Event)]
/mx:Metadata

// Code in test button to dispatch custom event
// 
private function triggerEventHandler():void {
 //Alert.show (Broadcast Event);
dispatchEvent(new Event(addItemEvent,true));
}

This looks like it should work, but only the MouseOver event is ever
fired - am I missing something obvious?

TIA
Patrick







[flexcoders] Re: Problem Adding Custom Event Listeners in a component?

2008-07-06 Thread pbrendanc
I think I need some additional clarification here as I'm not sure why
this is not OK- (I expect the button to respond to the custom event
regardless of who dispatched this event).

Imagine  3 buttons in a grid: B1, B2,B3. Clicking  on any button and
updates the appearance (e.g. label color) of the other 2 buttons (i.e.
everyone else but the clicked button).  Do this  w/out any hard  coding 
the names in click events etc. - each button gets a list of dependent
btn ID's - if you are on the list update yourself, otherwise ignore.

What I need to do here is to  have the containing (parent??) form
intercept (override?) the button click event, perform some preprocessing
(e.g. build a list) and forward this list by dispatching  a custom event
.  (In the  example below you can see that clicking a button affects
other buttons.

Where I'm stuck is on how best to setup the listeners ,and  intercept
the parent button click event. Per my previous message the custom
handler on the button is never triggered.

(Maybe I'm missing the wood for the tree's here - however it's a good
exercise that will solidify my understanding of the Flex event model)

TIA,
Patrick


--- [EMAIL PROTECTED], Alex Harui [EMAIL PROTECTED] wrote:

 Hard to say from the code snippets, but it looks like your button is
 listening for addItemEvent on itself, but it is the app that is
 dispatching



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
 Behalf Of pbrendanc
 Sent: Sunday, July 06, 2008 2:28 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Problem Adding Custom Event Listeners in a
 component?



 I have a custom button on which I want to listen to some custom
 events. For some reason in the following code my custom events are
 never heard/triggered.

 1)In the button's constructor I added the listeners as follows:

 // Custom Class Code
 public class testButton extends Button
 {
 //constructor
 public function testButton {
 addEventListener (MouseEvent.MOUSE_OVER, handleMouseOver);
 // custom event
 addEventListener(addItemEvent, handleAddItemEvent);
 }
 public function handleMouseOver (event:MouseEvent):void {
 // display as a tooltip
 this.toolTip = Say Cheese;

 public function handleAddItemEvent():void {
 // display as a tooltip
 Alert.show (testButton Event: Add Item Event);

 2) Parent Form Code (app.mxml)

 mx:Metadata
 [Event(name=addItemEvent, type = flash.events.Event)]
 /mx:Metadata

 // Code in test button to dispatch custom event
 //
 private function triggerEventHandler():void {
 //Alert.show (Broadcast Event);
 dispatchEvent(new Event(addItemEvent,true));
 }

 This looks like it should work, but only the MouseOver event is ever
 fired - am I missing something obvious?

 TIA
 Patrick





[flexcoders] Passing Initialization Parameter to a Popup Form ?

2008-07-03 Thread pbrendanc
Is there a way to pass/initialize a parameter when it is initially 
created - based on the value passed I plan to render the popup
differently as part of my create complete processing in the popup.

I don't want to set/pass the variables after I've created the popup
since that is too late.

Any ideas,

TIA,
Patrick




[flexcoders] BSOD Crashes (in Windows) while debugging in Flex - Is this a known problem?

2008-07-03 Thread pbrendanc
I'm Running XP (SP3) and have had several BSOD crashes while starting
a debug session(Driver IRQL_Not_Less_OR_EQual error). On restart I get
a windows message that system has recovered from serious error. 

(I may have had a run time Null Object Ref error in my code - not sure
if that would be a factor)

FWIW - my system is otherwise very stable.

Anyone else experienced this?

Patrick



[flexcoders] Re: Enumerating throug container/control arrays in Flex/Actionscript?

2008-07-02 Thread pbrendanc
Hopefully I won't need to - however  old habits die hard -maybe a
FAQ/guide for some of us older client/server developers would be useful
- Flex is a different way of thinking/different mindset.

I think you just turned on a light bulb for me - using loosely coupled
events can accomplish the same thing w/out needing to locate specific
controls etc. (Imagine a scenario in a data entry app were a checkbox
click requires the enabling/disabling of a group of related controls -
registering and handling events is the Flex way - different than what
I'm used to).

BTW -  Managing a separate list in the manner you described seems
redundant (unless there is performance penalty) - I'd expect the Flex
framework to make that data readily available.  Recursion is a bit
counter intuitive.

Again, I'm new to Flex and with a better understanding of the framework
I may well see problems/solutions etc in a different light.

Thx for your response - so much to learn!

Patrick.

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

 I'd attach an event listener to systemManager which listens for
bubbling
 flash.events.Event.ADDED and flash.events.Event.REMOVED events and
keeps a
 list. You will of course have to attach said event listener on
 Application.preinitialize or something like that.

 I'm interested into why you'd want to do this though?

 -Josh

 On Wed, Jul 2, 2008 at 1:37 PM, pbrendanc [EMAIL PROTECTED] wrote:

  In windows apps there is a control array collection that can be used
  to find controls and return a handle to the appropriate object.
 
  What is the recommended Flex approach to finding controls and are
  there any  performance tradeoffs here - recursion is slow and
  potentially error prone (stack overflows anyone?)??
 
  (I'm seeing the use of recursive GetChildByName calls in some
examples
  and wonder if there is a more direct way to find a control given the
  name/ID - regardless of the nesting level). Am I correct in thinking
  that GetChildByName only searches the current node for an item,
rather
  than subordinate, nested items?
 
  TIA,
  Patrick
 
 
 

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

 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]





[flexcoders] Pass a Run Time Composite Component to customize a Pop Up Form?

2008-07-02 Thread pbrendanc
I't trying to create a composite control (in AS) at run time and pass
this to a popup (as an object) - the popup is responsible for the
display and the contents vary based on a user input (e.g. 2*2 grid;
3*3 grid etc). 

My initial thought was to create a composite component and then pass
this for display via the Popup Manager as part of the popup. However
I'm not sure this will work as it appears that the composite control
methods (createChildren etc) apply to the current form and do not
support the creation of a package that can be rendered in a separate
form/window. 

Maybe I need to have the popup form create the composite control
directly instead? 

Any suggestions/comments?

TIA,
Patrick








[flexcoders] Enumerating throug container/control arrays in Flex/Actionscript?

2008-07-01 Thread pbrendanc
In windows apps there is a control array collection that can be used
to find controls and return a handle to the appropriate object. 

What is the recommended Flex approach to finding controls and are
there any  performance tradeoffs here - recursion is slow and
potentially error prone (stack overflows anyone?)??

(I'm seeing the use of recursive GetChildByName calls in some examples
and wonder if there is a more direct way to find a control given the
name/ID - regardless of the nesting level). Am I correct in thinking
that GetChildByName only searches the current node for an item, rather
than subordinate, nested items?

TIA,
Patrick





[flexcoders] Re: Create border for inner subgrids within a grid - How?

2008-06-28 Thread pbrendanc
Alex,
Thanks - I think that approach will require me to build multiple
subgrids and treat each of these subgrid as a separate griditem - thus
creating additional nesting, rather than 1 large grid. I was hoping for 
to avoid that - is there any other way to accomplish this (I suspect
not).

Thx again,
Patrick


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

 myGridItem.setStyle(borderStyle, solid)



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
 Behalf Of pbrendanc
 Sent: Friday, June 27, 2008 2:50 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Create border for inner subgrids within a grid -
 How?



 Another noob question - I've created a dynamic (n*n) grid and need to
 provide some visual delineation of the inner grids - e.g. a 4*4 grid
 contains 4 inner 2*2 subgrids.

 How can I create a border around each of these subgrids? (This will
 also need to be done dynamically).

 TIA,
 Patrick

 FWIW - The grid is built with the following function

 private function buildGrid (nrows:uint,ncols:uint):void {

 for (var i:Number = 0; inrows; i++) {
 var myGridRow:GridRow = new GridRow();
 // for each col add child controls
 for (var j:Number = 0; jncols; j++) {
 var myGridItem:GridItem = new GridItem();
 myGridItem.addChild (myBtn);
 //Add cell to row
 myGridRow.addChild (myGridItem);
 } // end col loop

 // Add row to grid
 myGrid.addChild(myGridRow);
 }
 // Add grid to parent container (canvas/form/panel
 etc??)
 mypanel.addChild(myGrid);
 }





[flexcoders] Custom (mxml) UI Components in Flex?

2008-06-28 Thread pbrendanc
Hi
Just getting into flex in my spare time and trying to learn as quickly
as possible - so excuse me if some of my postings/questions seem
somewhat redundant - however these groups are a valuable resource for
future Flex noobies so hopefully others will benefit from the QA. 
(Later on I may compile a list of (HowDoI qns )that I've had to deal
with in learning Flex and post ??where??).

I know I can create custom classes defined in .as files and reuse these.
Is is possible to create a custom component (say a composite if
several multiple UI components (e.g. a logon form definition) in an
.mxml file ant then reuse these?  

The examples in the docs all use .as files so I'm wondering if it's
possible to do the same thing with mxml files.

TIA,
Patrick




[flexcoders] Re: How to Position a Popup relative to the control that invoked the popup?

2008-06-27 Thread pbrendanc
Thx a bunch - this looks like what I need - however for some reason
I'm seeing -ve numbers for my x + y coordinates and my popup is
partway off my form/window - any further suggestions.

Since my grid is dynamically created are there any other
issues/gotcha's I need to consider here?

TIA

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

 I think what you what is this:
 
 1)from the click event get the ref to the button:
 
 var btn:Button = event.target as Button;
 
 2) then get its coordinates:
 
 var point:Point = new Point(0, 0);
 point = btn.globalToLocal( point );
 
 3) now use it to position your pop up
 
 mypop.x = point.x;
 mypop.y = point.y + 10;
 
 Dimitrios Gianninas
 Optimal Payments Inc.
 
 
 
 -Original Message-
 From: flexcoders@yahoogroups.com on behalf of pbrendanc
 Sent: Thu 26/06/2008 7:55 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] How to Position a Popup relative to the
control that invoked the popup?
  
 I have a grid with an array of buttons that when clicked, will display
 a popup window that collects user info. 
 What I'd like to do is position the popup relative (immediately below)
 the button that the user clicked within the grid - not necessarily
 centered on the current window. 
 
 How can I get access the position/coordinates of the calling button -
 is this data somehow available via the createComplete event of the
 popup. I imagine this data is buried somewhere in the
 event/eventtarget object, but I'm not quite sure how to access it. 
 
 (Please don't tell me that I need to assign a listener to every button
 in the grid from within the Popup window as I'm creating the grid
 dynamically and it varies in size).
 
 Can anyone help with this,
 
 TIA,
 Patrick
 
 
 
 
 
 
 
 -- 
 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: How to Position a Popup relative to the control that invoked the popup?

2008-06-27 Thread pbrendanc
No that is not part of the question  - 
I have all the components working and the popup opens and closes
correctly - what I'm trying to do is (re)position the popup relative
to the location of the grid button that caused it to open - this
should be simple but I can't find an example how to do this. 

Any ideas - TIA

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

 How far have you actually gotten?
 
  
 
 Do you have your buttons invoking the pop-up yet?  Or is that part of
 your question?
 
  
 
 Tracy
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of pbrendanc
 Sent: Thursday, June 26, 2008 9:00 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: How to Position a Popup relative to the
 control that invoked the popup?
 
  
 
 Sorry, while I don't mean to be obtuse - however I need some
 clarification on how/where to get a reference to that event object -
 that's really what I having a problem with.
 
 In my scenario please note:
 
 1) The controls are dynamic, so how to addEventListener to run time
 controls is unclear to me. (DO I even need to do this?)
 
 2)The popup form is created by the popUp manager and the form handles
 createComplete event - however I don't see a ref here to an event
 object - what am I missing? 
 
 An explicit code sample would be helpful.
 
 TIA
 
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 , Josh McDonald dznuts@ wrote:
 
  You should be able to get the button which triggered the click event
 from
  event.target
  
  -Josh
  
  On Fri, Jun 27, 2008 at 9:55 AM, pbrendanc pbrendanc@ wrote:
  
   I have a grid with an array of buttons that when clicked, will
 display
   a popup window that collects user info.
   What I'd like to do is position the popup relative (immediately
 below)
   the button that the user clicked within the grid - not necessarily
   centered on the current window.
  
   How can I get access the position/coordinates of the calling button
 -
   is this data somehow available via the createComplete event of the
   popup. I imagine this data is buried somewhere in the
   event/eventtarget object, but I'm not quite sure how to access it.
  
   (Please don't tell me that I need to assign a listener to every
 button
   in the grid from within the Popup window as I'm creating the grid
   dynamically and it varies in size).
  
   Can anyone help with this,
  
   TIA,
   Patrick
  
  
  
  
  
  
  
   
  
   --
   Flexcoders Mailing List
   FAQ:
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
   Search Archives:
   http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo ! Groups
   Links
  
  
  
  
  
  
  -- 
  Therefore, send not to know For whom the bell tolls. It tolls for
 thee.
  
  :: Josh 'G-Funk' McDonald
  :: 0437 221 380 :: josh@
 





[flexcoders] Create border for inner subgrids within a grid - How?

2008-06-27 Thread pbrendanc
Another noob question - I've created a dynamic (n*n) grid and need to
provide some visual delineation of the inner grids - e.g. a 4*4 grid
contains 4 inner 2*2 subgrids.

How can I create a border around each of these subgrids?  (This  will
also need to be done dynamically).

TIA,
Patrick

FWIW - The grid is built with the following function

private function buildGrid (nrows:uint,ncols:uint):void {

 for (var i:Number = 0; inrows; i++) {
 var myGridRow:GridRow =  new GridRow();
 // for each col add child controls
 for (var j:Number = 0; jncols; j++) {
 var myGridItem:GridItem =  new GridItem();
 myGridItem.addChild (myBtn);
 //Add cell to row
 myGridRow.addChild (myGridItem);
 }// end col loop

 // Add row to grid
 myGrid.addChild(myGridRow);
 }
 // Add grid to parent container (canvas/form/panel
etc??)
 mypanel.addChild(myGrid);
}





[flexcoders] How to Position a Popup relative to the control that invoked the popup?

2008-06-26 Thread pbrendanc
I have a grid with an array of buttons that when clicked, will display
a popup window that collects user info. 
What I'd like to do is position the popup relative (immediately below)
the button that the user clicked within the grid - not necessarily
centered on the current window. 

How can I get access the position/coordinates of the calling button -
is this data somehow available via the createComplete event of the
popup. I imagine this data is buried somewhere in the
event/eventtarget object, but I'm not quite sure how to access it. 

(Please don't tell me that I need to assign a listener to every button
in the grid from within the Popup window as I'm creating the grid
dynamically and it varies in size).

Can anyone help with this,

TIA,
Patrick








[flexcoders] Re: How to Position a Popup relative to the control that invoked the popup?

2008-06-26 Thread pbrendanc
Sorry, while I don't mean to be obtuse - however I need some
clarification on how/where to get a reference to that event object -
that's really what I having a problem with.

In my scenario please note:

1) The controls are dynamic, so how to addEventListener to run time
controls is unclear to me. (DO I even need to do this?)

2)The popup form is created by the popUp manager and the form handles
createComplete event - however I don't see a ref here to an event
object - what am I missing? 

An explicit code sample would be helpful.

TIA
 

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

 You should be able to get the button which triggered the click event
from
 event.target
 
 -Josh
 
 On Fri, Jun 27, 2008 at 9:55 AM, pbrendanc [EMAIL PROTECTED] wrote:
 
  I have a grid with an array of buttons that when clicked, will display
  a popup window that collects user info.
  What I'd like to do is position the popup relative (immediately below)
  the button that the user clicked within the grid - not necessarily
  centered on the current window.
 
  How can I get access the position/coordinates of the calling button -
  is this data somehow available via the createComplete event of the
  popup. I imagine this data is buried somewhere in the
  event/eventtarget object, but I'm not quite sure how to access it.
 
  (Please don't tell me that I need to assign a listener to every button
  in the grid from within the Popup window as I'm creating the grid
  dynamically and it varies in size).
 
  Can anyone help with this,
 
  TIA,
  Patrick
 
 
 
 
 
 
 
  
 
  --
  Flexcoders Mailing List
  FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  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.
 
 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]





[flexcoders] How to create a n * n grid dynamically (not datagrid)

2008-06-17 Thread pbrendanc
Hi,
I'm new to this group and just started learning Flex 3. I want to try
creating/adding a grid with a variable (user specified) # of cells. SO
the grid size is defined at run time. 

Scenario is : User selects grid size (2x2; 3x3 etc) from combo box and
corresponding grid is displayed - also want to add a button to each cell.

Would appreciate any pointers on how to do this in Flex 3?

TIA,
Patrick



[flexcoders] Re: How to create a n * n grid dynamically (not datagrid)

2008-06-17 Thread pbrendanc
--- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote:

 Look into Grid, GridRow, etc. These can be created at run-time. But
 depending on what you're actually trying to do, you may be better suited
 with the Tile component.
 
 -Josh
 

Can you be a bit more specific - I understand grid row etc - However I
need the calling syntax/example code to create and position the
controls dynamically - any offers?

TIA