Re: [flexcoders] callLater, FPS, and lengthy background operations

2008-05-25 Thread Josh McDonald
Thanks Alex, that is useful :)

On Sun, May 25, 2008 at 1:59 PM, Alex Harui [EMAIL PROTECTED] wrote:

There's a post on my blog you may find useful:
 http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Josh McDonald
 *Sent:* Saturday, May 24, 2008 3:36 AM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] callLater, FPS, and lengthy background operations



 Hi Guys,

 If I have a long list of things to process as a background task, I figure a
 good way to do it is a piece at a time with callLater(). However I'd like to
 be able to detect if I'm taking too long per block and running into the next
 frame. Also, I'd like to do more per cycle if my app finds itself running on
 a ninja machine :)

 Anyone have any tips for this sort of thing? Should I just be using the
 timer and striving for 1/4 of a frame measured in ms? What framerate are
 Flex SWFs set to run at normally?

 Cheers,
 -J

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

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




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

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


Re: [flexcoders] custom event not added

2008-05-25 Thread dnk

ah. Little slow on this end.

I will see if I can get it to work

d



On 24-May-08, at 6:59 PM, Josh McDonald wrote:

As in, I've got no idea what's going on :) Application.application  
should always point to the running instance of your mx:Application



On Sun, May 25, 2008 at 2:19 AM, dnk [EMAIL PROTECTED] wrote:
fire? As in scrap and rewrite?


dnk


On 23-May-08, at 10:25 PM, Josh McDonald wrote:

If you're getting a runtime error accessing Application.application  
you'll need fire to clean this up, methinks.



-J

On Sat, May 24, 2008 at 3:02 PM, dnk [EMAIL PROTECTED]  
wrote:

That added an error:

Access of undefined property Application


researching that now...

d



On 23-May-08, at 9:35 PM, Josh McDonald wrote:

 The only thing i can think of after looking at that is that your
 controller (whatever that is) is not part of the display tree? Try
 replacing dispatchEvent() with
 Application.application.dispatchEvent() and see if it works then.


 -J

 On Sat, May 24, 2008 at 2:28 PM, dnk [EMAIL PROTECTED]  
wrote:

 It is dispatched like this (in  function in my controller):

 dispatchEvent(new GetNewsEvent(GetNewsEvent.GET_NEWS_EVENT, null,
 false, false));

 the null is used for an object (if I need to pass data with my  
event).

 In this particular case I did not.

 My actual event class looks like:

 package Flexb.events
 {
import flash.events.Event;

public class GetNewsEvent extends Event
{
protected var _data:Object;

public static const
 GET_NEWS_EVENT:String=GetNewsEventType;

public function GetNewsEvent( type:String,
 data:Object = null,
 bubbles:Boolean=true, cancelable:Boolean=false ):void
{
_data = data;
super(GET_NEWS_EVENT,true,false);
}

public function get data():Object
{
return _data;
}

}
 }


 dnk



 On 23-May-08, at 6:16 PM, Josh McDonald wrote:

  What's the event dispatch code look like?
 
 
  On Sat, May 24, 2008 at 11:01 AM, dnk [EMAIL PROTECTED]
  wrote:
  ok, well that explains that part, however either my event is not
  added, or my event handler is never called. My trace statements
  never show up
 
 
  So I guess I  still am wondering if anyone has any ideas
 
  dnk
 
 
 
  On 23-May-08, at 4:56 AM, Paul Andrews wrote:
 
  addEventListener() does not return a value..
 
  - Original Message -
  From: dnk [EMAIL PROTECTED]
  To: flexcoders@yahoogroups.com
  Sent: Friday, May 23, 2008 12:47 PM
  Subject: [flexcoders] custom event not added
 
   Hi there,
  
   I have a controller that is adding my custom event  
listeners, but

  for
   some reason my event handler was not being fired.
  
   My original code was (snippet):
  
  
   (in controler)
  
   //constructor
   public function FlexbController()
   {
   //turn the key, start it up
   addEventListener( FlexEvent.CREATION_COMPLETE, onInit );
   }
  
   private function onInit( event:Event ):void
   {
   //setup event listeners
   /*systemManager is where event listener hangs out defines the
   relationship between event and handler*/
  
   systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,
   handler_GetNewsEvent );
   systemManager.addEventListener( AddNewsEvent.ADD_NEWS_EVENT,
   handler_AddNewsEvent );
  
  
  systemManager
  .addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
   handler_NewsLoadedEvent );
   getNewsData();
  
   }
  
   And I had trace statements in all of my handlers... this is  
how i

   noticed things were not working as they should.
  
   SO I added a simple check like (in my FlexbController
 constructor):
  
   if  
(systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,

   handler_GetNewsEvent ))
   {
   trace(true);
   } else {
   trace(false);
   }
  
  
   And I obviously am getting false.
  
   Ideas?
  
   dnk
  
  
  
   
  
   --
   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 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 Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: 

Re: [flexcoders] custom event not added

2008-05-25 Thread dnk
ok, this is how my app is setup


:: app.mxml ::

has a:

xmlns:controller=Flexb.controller.*

controller:FlexbController/


That is how my controller is instantiated.

:: FlexbController.as ::

public class FlexbController extends UIComponent

in my constructor I have:

addEventListener( FlexEvent.CREATION_COMPLETE, onInit );

then in my onInit function I have:

systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,  
handler_GetNewsEvent );

along with a call to another function:

getNewsData();

(this one is called without issue).

In that function I dispatch the custom event in question:

dispatchEvent(new GetNewsEvent(GetNewsEvent.GET_NEWS_EVENT, null,  
false, false));

So when dispatch it should go to a handler function called  
handler_GetNewsEvent.

And it is that event handler that never seems to be processed. I had a  
trace statement that never seems to show. And in that function there  
are some remoting calls that I never see happening in service capture.

And that is where my app seems to fail.

dnk




On 24-May-08, at 9:09 PM, Alex Harui wrote:


 Who’s dispatching and how?



 When does the control get instantiated?  Could it be after  
 creationComplete?



 If the controller is not a UIComponent, it will not get a  
 creationComplete.



 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]  
 On Behalf Of dnk
 Sent: Friday, May 23, 2008 4:48 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] custom event not added



 Hi there,

 I have a controller that is adding my custom event listeners, but for
 some reason my event handler was not being fired.

 My original code was (snippet):

 (in controler)

 //constructor
 public function FlexbController()
 {
 //turn the key, start it up
 addEventListener( FlexEvent.CREATION_COMPLETE, onInit );
 }

 private function onInit( event:Event ):void
 {
 //setup event listeners
 /*systemManager is where event listener hangs out defines the
 relationship between event and handler*/

 systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,
 handler_GetNewsEvent );
 systemManager.addEventListener( AddNewsEvent.ADD_NEWS_EVENT,
 handler_AddNewsEvent );

 systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
 handler_NewsLoadedEvent );
 getNewsData();

 }

 And I had trace statements in all of my handlers... this is how i
 noticed things were not working as they should.

 SO I added a simple check like (in my FlexbController constructor):

 if (systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,
 handler_GetNewsEvent ))
 {
 trace(true);
 } else {
 trace(false);
 }

 And I obviously am getting false.

 Ideas?

 dnk



 




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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



Re: [flexcoders] Re: Importing SWC Files in FLEX

2008-05-25 Thread John McCormack
Hi Anuj,

//An internal build error has occurred. Right-click for more information.

I had difficulty in understanding exactly what was needed to use Flash assets 
and had similar errors. It doesn't help when the documentation varies so much 
on what to do. Unfortunately the Adobe PDF's have no publishing date written 
inside and so you often get information from out-of-date ones.

I am able to use Flash Assets but my projects are all ActionScript projects 
rather than Flex projects. As a result I do not have to turn the asset into a 
Flex component by making it an extension of the UIMovieClip class. For example, 
on the stage I have a red dot with a radial gradient. I make it into a symbol 
and it goes in the library. It has to be either a button or MovieClip. Say I 
call it RedDot. I can delete the one on the stage. When I publish I make sure 
the SWC box is ticked in the publish settings. In Flex Builder 3 I right click 
the project, go to build options and add the swc. If I then type var rd:, 
suddenly RedDot is on the list of types I select it and hit return. So I finish 
up with var rd:RedDot = new RedDot and I can addChild(rd) and that's it.

With Flex projects the only difference is that Flex needs to give the mxml 
compiler access to RedDot. It does this by agreeing an interface to it - this 
is just a set of agreed functions/methods that both sides agree on. This is the 
UIMovieClip - UserInterfaceToMovieClip (probably). So in Flash my RedDot has to 
extend UIMovieClip. If you have already done this, right-click the symbol in 
the library and check the properties to see this. If not, select the symbol and 
go to the Commands menu in Flash and choose Convert symbol to Flex component. 
This has three consequences, which you can just do manually yourself:

1. The fps is set to 24.
2. The Base Class is set to mx.flash.UIMovieClip.
3. The FlexComponentBase is added to the library.

Note: I have just checked and found that the library symbol must have export 
for actionscript ticked before you Convert it, otherwise it doesn't do it. Now 
you can either right-click the symbol and export the swc, or publish and 
produce the swc. I have a swf with five symbols in it and when published my swc 
has five symbols in which I can use in Flex. I suggest you draw the simplest 
graphic, turn it into a MovieClip symbol for the library. Make sure export for 
actionscript is set in the library symbol. Select it and Convert to a Flex 
Component. Check the properties for the UIMovieClip class. Publish with SWC 
ticked. Import it, and it should be available. You don't need to write a class 
to go with it since Flash produces its own cutdown class for it when ti doesn't 
find one.

I got the above error when I followed various guidelines and tried to do 
something more complicated.

Fingers crossed for you!

John

[flexcoders] Re: Flash USB-API :)

2008-05-25 Thread Cato Paus
Hi I know abouth the MerApi http://www.merapiproject.net/index.php, 
but My use-case is: I'm developing a TV-FlexApplication for a 
cutsomer that wants to use a tv remote controller to change the 
channels that I'm stremaing form satelitte or cabel. The point of 
using Flex/flash is that I have all under my controll (The app) and 
the customer will allvays have the last build of the app. 

To day flash player have connection to several USB devises, USB 
Camare and microphone!! Why not extend this a litle more :)


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

 There is an obvious solution:
 
 Flex/AIR - Web Services (or similar) - USB
 
 ... but _direct_ communication with USB? I'm stumped as to why you 
would
 even need something like this. What is your use case? 
 
 Rick Winscot
 
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of Cato Paus
 Sent: Friday, May 23, 2008 9:35 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Flash USB-API :)
 
 Hehe Totaly Agree with you on Joe Random, but I put my trust on 
Adobe 
 to find a solution :) 
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com ,
 Tom Chiverton tom.chiverton@ 
 wrote:
 
  On Thursday 22 May 2008, Cato Paus wrote:
   I realy hope we can have USB communication in AIR and Flash 
 Player :)
  
  USB communication from a web site ? I think not... unless you 
want 
 Joe Random 
  reading all your data.
  For AIR this makes more sense.
  
  -- 
  Tom Chiverton
  
  
  
  This email is sent for and on behalf of Halliwells LLP.
  
  Halliwells LLP is a limited liability partnership registered in 
 England and Wales under registered number OC307980 whose registered 
 office address is at Halliwells LLP, 3 Hardman Square, 
 Spinningfields, Manchester, M3 3EB. A list of members is available 
 for inspection at the registered office. Any reference to a partner 
 in relation to Halliwells LLP means a member of Halliwells LLP. 
 Regulated by The Solicitors Regulation Authority.
  
  CONFIDENTIALITY
  
  This email is intended only for the use of the addressee named 
 above and may be confidential or legally privileged. If you are not 
 the addressee you must not read it and must not use any information 
 contained in nor copy it nor inform any person other than 
Halliwells 
 LLP or the addressee of its existence or contents. If you have 
 received this email in error please delete it and notify Halliwells 
 LLP IT Department on 0870 365 2500.
  
  For more information about Halliwells LLP visit 
www.halliwells.com.
 





[flexcoders] Re: Flash USB-API :)

2008-05-25 Thread Cato Paus
Update on the case :)
https://bugs.adobe.com/jira/browse/FP-247


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

 WE need to vote again :) https://bugs.adobe.com/jira/browse/FP-247 
 
 I realy hope we can have USB communication in AIR and Flash Player :) 
 
 I can imagine many different type of applications which can 
communicate 
 with different devices connected over USB, atleast my phone (over 
 bluetooth or cable)... 
 
 It would be great if AIR and Flash player can have USB API for those 
 things, so that we (developers) are not forced to write socket-
servers 
 and take care of installation etc..





[flexcoders] Re: prevent ADG datagrid column from being dragged [bump]

2008-05-25 Thread superabe superabe

 Is there anyway to prevent a column in an AdvancedDataGrid from being
 draggable.
 I see a draggable property on the regular Datagrid, but not on the ADG ?

 TIA

 - superabe



[flexcoders] Re: Why is this renderer so slow?

2008-05-25 Thread dbronk
Thanks, I'll take a look at that.  I dispatched the event because I
needed to determine if the checkbox needed to be hidden (different
post).  But, adding the dispatch really did nothing for the
performance.  It was just as slow before I added the dispatchEvent.

Thanks again for your suggestion.
Dale


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

 Updating the dataprovider is costly. Make sure it only happens when
 required (that is isn't happening during scrolling), and maybe avoid
 dispatching an event to do it.  I'm not sure who's listening and what
 they will do in response.  If you change the dataprovider, the DataGrid
 will do a lot of work.
 
  
 
 XML is much slower than objects, so it may pay to convert to object.
 
  
 
 Button already has logic for handling a selectedField in a dataprovider
 item.  Since CheckBox inherits from button, you might just be able to
 use selectedField, or modify and piggy-back on its timing.
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of dbronk
 Sent: Saturday, May 24, 2008 10:00 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Why is this renderer so slow?
 
  
 
 I have created a checkbox renderer. My datagrid has 5 out of 8
 columns that use it. The datagrid has only about 80 rows it it. When
 using this renderer the performance of the datagrid is horrible. 
 Scrolling is extremely slow, click a checkbox is extremely slow. If I
 swap out and use a normal mx:CheckBox for the renderer the performance
 is just fine, but of course that doesn't work as it will not retain
 the state of the checkbox when scrolling. Here is my code for the
 renderer. I notice that many of these are re-executed whenever
 anything happens to the datagrid. That includes just mousing over.
 
 Thanks.
 
 Dale
 
 package renderer
 {
 import flash.events.MouseEvent;
 
 import mx.controls.CheckBox;
 
 import spectrumk12.minerva.util.BaseEvent;
 import spectrumk12.minerva.util.Utils;
 
 [Event(name=selectionSet, type=util.BaseEvent)]
 public class RendererCheckBoxXML extends CheckBox
 {
 private var _xmlItem : XML; //holds the current item xml node
 private var count:int=0;
 private var debug:String=;
 
 /** The attribute in the xml to use to store the selected state of
 this checkbox. */
 [Inspectable(default=rendererSelected)]
 public var selectedAttribute : String = rendererSelected;
 
 /** The default selection state (true/false) to give if the
 selectedAttribute is not there or null */
 [Inspectable(default=false, enumeration=true,false)]
 public var defaultSelectedState : Boolean = false;
 
 public function RendererCheckBoxXML()
 {
 super();
 trace(RendererCheckBoxXML:Constructor);
 this.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
 }
 
 // Sets the state of the checkbox based on the selectedAttribute
 attribute.
 override public function set data(oItem:Object) : void
 {
 _xmlItem = XML(oItem);
 trace(RendererCheckBoxXML:set data:  + [EMAIL PROTECTED]);
 var bSelected : Boolean = false;
 var attrSelected : String = [EMAIL PROTECTED];
 this.selected = ( Utils.nullOrBlank(attrSelected) ?
 defaultSelectedState : (attrSelected == true) ); 
 }
 
 override public function get data() : Object
 {
 trace(RendererCheckBoxXML:get data:  + (_xmlItem != null ?
 [EMAIL PROTECTED] : null));
 return _xmlItem;
 }
 
 /**
 * This overridden function is where the logic is for updating the xml.
 */
 override public function set selected(selectedFlag:Boolean) : void
 {
 trace(RendererCheckBoxXML:set selected:  + [EMAIL PROTECTED]);
 super.selected = selectedFlag;
 
 // Only update the xml if it needs to be updated. Each time the xml
 // is updated it will fire any bindings to it so we want to keep these
 // to a minimum.
 if ( [EMAIL PROTECTED] != selectedFlag )
 {
 // The selected flag is different than the selectedAttribute
 attribute.
 // Now we make one last check to see if the selectedFlag is false and
 // there is no attribute selectedAttribute. If this is the case, then
 // we do NOT update because having no attribute selectedAttribute will
 // default to a false. Again, we do this so that we update the xml as
 // infrequently as possible.
 if ( selectedFlag || [EMAIL PROTECTED]()  0 )
 {
 [EMAIL PROTECTED] = String(this.selected); //set the
 checkbox state into the dataProvider
 }
 }
 dispatchEvent(new BaseEvent(selectionSet, selectedFlag));
 }
 
 // Called by click of the checkbox
 private function onClick(mouseEvent:MouseEvent) : void
 {
 trace(RendererCheckBoxXML:onClick:  + [EMAIL PROTECTED]);
 // Simply need to trigger the set selected function as that is
 where the logic for updating the xml is.
 this.selected = this.selected; 
 }
 
 }
 }





Re: [flexcoders] AS3 regexp doesnt implement lookbehind?

2008-05-25 Thread Janis Radins
Thanks for a resource.
Theres lookbehind in list of operators but I just cant get it working. I
just tried to test some other simple lookbehind expressions and they doesnt
work too.


sestdiena, 2008, 24 maijs 19:55 EECOLOR [EMAIL PROTECTED] rakstīja:

   It should have a look behind. I think you can find all your answers
 here: http://gskinner.com/RegExr/

 There is also an Air version available. At the right side you can find the
 capabilities.


 Greetz Erik


 On 5/24/08, Janis Radins [EMAIL PROTECTED] wrote:

  Hey people!

 I'm playing here with some RegExp stuff. Should have learned it long time
 ago tho I started just recently.
 So, i was playing with syntax highlighter in AS3 and stumbled upon
 difficulties on how to match doc tag inside block comment.

 After several hours I came up with genius expression -
 /(?=\/\*(?:[^*]|\*[^*\/])*)(@\w*)/mg
 It works perfectly in text editor I'm using to test expressions but it
 halts in AS3.
 Each of the groups select what they are supposed to perfectly, but they do
 not work togeather.

 I did some googling and couldnt find definitive answer what might be the
 problem.
 So, could it be that AS3 RegExp engine doesn't implement lookbehind?

 Can anyone confirm that or maybe someone knows how comet that bastid
 doesn't work in AS3?

 thanks in advance
 Jānis


  



[flexcoders] Re: Multiple ItemRenderers for a single DataGridColumn

2008-05-25 Thread dbronk
Oh my, what a difference!  I didn't know about this function. 
Extended DataGrid, override createColumnItemRenderer, now my code is
much cleaner and it actually completely took care of my performance
issue on this grid.

I still need to run it through the profiler to make sure that I'm not
doing anything stupid inside of it since it fires so often.

Does their happen to be a function or event for when a renderer is no
longer being displayed?  I'd like to create a pool and reuse the
renderers as right now I'm creating new in this function.  That's the
reason I want to run it through the profiler.

Thanks a bunch!
Dale

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

 In Flex3, we added a  createColumnItemRenderer method that in theory
 will let you return different renderers per-row.  Might be worth a try.
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of dbronk
 Sent: Saturday, May 24, 2008 6:45 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Multiple ItemRenderers for a single DataGridColumn
 
  
 
 I have a DataGrid and one of the columns I need to be able to do the
 following based on the user security setting and the data in the
 column. So each row in the DataGrid for a single user may have
 different behavior and ItemRenderers.
 
 1. Do not show any data and mark the cell not editable. Still show
 the column, just blank out the cell and do not allow editing.
 
 2. Allow the user to see the data, but not edit it. I would like
 this to simply show as a Text field.
 
 3. Display the data, and allow the user to edit the data via a
 TextInput control.
 
 4. Display the data, and allow the user to edit the data via showing
 a CheckBox control.
 
 I know how to do each individually, but I do not know how to do this
 all at the same time in a single DataGridColumn.
 
 Can I do this?
 
 Thanks,
 Dale





[flexcoders] Re: Multiple ItemRenderers for a single DataGridColumn

2008-05-25 Thread dbronk
To my great displeasure I don't see the createColumnItemRenderer
function in the AdvancedDataGrid.  What do you suggest for the
AdvancedDataGrid as I have the same issue here.

Thanks,
Dale

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

 In Flex3, we added a  createColumnItemRenderer method that in theory
 will let you return different renderers per-row.  Might be worth a try.
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of dbronk
 Sent: Saturday, May 24, 2008 6:45 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Multiple ItemRenderers for a single DataGridColumn
 
  
 
 I have a DataGrid and one of the columns I need to be able to do the
 following based on the user security setting and the data in the
 column. So each row in the DataGrid for a single user may have
 different behavior and ItemRenderers.
 
 1. Do not show any data and mark the cell not editable. Still show
 the column, just blank out the cell and do not allow editing.
 
 2. Allow the user to see the data, but not edit it. I would like
 this to simply show as a Text field.
 
 3. Display the data, and allow the user to edit the data via a
 TextInput control.
 
 4. Display the data, and allow the user to edit the data via showing
 a CheckBox control.
 
 I know how to do each individually, but I do not know how to do this
 all at the same time in a single DataGridColumn.
 
 Can I do this?
 
 Thanks,
 Dale





[flexcoders] Space around flex application in browser

2008-05-25 Thread Manu Dhanda

Hii..

In my application, I always got to have space around my container in my
browser.
While setting dock=true, I can avoid it for ApplicationControlBar, am
still not able to find a way to get rid of it for my panels.

Anyone who can point me in the right direction.

Thanks.
-- 
View this message in context: 
http://www.nabble.com/Space-around-flex-application-in-browser-tp17459853p17459853.html
Sent from the FlexCoders mailing list archive at Nabble.com.



[flexcoders] Re: Space around flex application in browser

2008-05-25 Thread luchi_bustos
Apply the following style:

Application {
 padding-left:0;
 padding-right:0;
 padding-top:0;
 paddgin-bottom:0;
}



Re: [flexcoders] AS3 regexp doesnt implement lookbehind?

2008-05-25 Thread EECOLOR
Let's say you have the following text:

This is a test

And this regular expression:

/(?=this).*/gi

The match would be this:

 is a test

Works fine as far as I can tell.


Greetz Erik



On 5/25/08, Janis Radins [EMAIL PROTECTED] wrote:

 Thanks for a resource.
 Theres lookbehind in list of operators but I just cant get it working. I
 just tried to test some other simple lookbehind expressions and they doesnt
 work too.


 sestdiena, 2008, 24 maijs 19:55 EECOLOR [EMAIL PROTECTED] rakstīja:

 It should have a look behind. I think you can find all your answers here:
 http://gskinner.com/RegExr/

 There is also an Air version available. At the right side you can find the
 capabilities.


 Greetz Erik


 On 5/24/08, Janis Radins [EMAIL PROTECTED] wrote:

 Hey people!

 I'm playing here with some RegExp stuff. Should have learned it long time
 ago tho I started just recently.
 So, i was playing with syntax highlighter in AS3 and stumbled upon
 difficulties on how to match doc tag inside block comment.

 After several hours I came up with genius expression -
 /(?=\/\*(?:[^*]|\*[^*\/])*)(@\w*)/mg
 It works perfectly in text editor I'm using to test expressions but it
 halts in AS3.
 Each of the groups select what they are supposed to perfectly, but they
 do not work togeather.

 I did some googling and couldnt find definitive answer what might be the
 problem.
 So, could it be that AS3 RegExp engine doesn't implement lookbehind?

 Can anyone confirm that or maybe someone knows how comet that bastid
 doesn't work in AS3?

 thanks in advance
 Jānis



 



Re: [flexcoders] custom event not added

2008-05-25 Thread dnk

Josh,

FYI, I got around the error, I had to use:

mx.core.Application.application.dispatchEvent(new  
GetNewsEvent(GetNewsEvent.GET_NEWS_EVENT, null, false, false));


But event when targeting in this way as you suggested, it still did  
not help dispatch the event..



dnk



On 23-May-08, at 10:25 PM, Josh McDonald wrote:

If you're getting a runtime error accessing Application.application  
you'll need fire to clean this up, methinks.



-J

On Sat, May 24, 2008 at 3:02 PM, dnk [EMAIL PROTECTED] wrote:
That added an error:

Access of undefined property Application


researching that now...

d



On 23-May-08, at 9:35 PM, Josh McDonald wrote:

 The only thing i can think of after looking at that is that your
 controller (whatever that is) is not part of the display tree? Try
 replacing dispatchEvent() with
 Application.application.dispatchEvent() and see if it works then.


 -J

 On Sat, May 24, 2008 at 2:28 PM, dnk [EMAIL PROTECTED]  
wrote:

 It is dispatched like this (in  function in my controller):

 dispatchEvent(new GetNewsEvent(GetNewsEvent.GET_NEWS_EVENT, null,
 false, false));

 the null is used for an object (if I need to pass data with my  
event).

 In this particular case I did not.

 My actual event class looks like:

 package Flexb.events
 {
import flash.events.Event;

public class GetNewsEvent extends Event
{
protected var _data:Object;

public static const
 GET_NEWS_EVENT:String=GetNewsEventType;

public function GetNewsEvent( type:String,
 data:Object = null,
 bubbles:Boolean=true, cancelable:Boolean=false ):void
{
_data = data;
super(GET_NEWS_EVENT,true,false);
}

public function get data():Object
{
return _data;
}

}
 }


 dnk



 On 23-May-08, at 6:16 PM, Josh McDonald wrote:

  What's the event dispatch code look like?
 
 
  On Sat, May 24, 2008 at 11:01 AM, dnk [EMAIL PROTECTED]
  wrote:
  ok, well that explains that part, however either my event is not
  added, or my event handler is never called. My trace statements
  never show up
 
 
  So I guess I  still am wondering if anyone has any ideas
 
  dnk
 
 
 
  On 23-May-08, at 4:56 AM, Paul Andrews wrote:
 
  addEventListener() does not return a value..
 
  - Original Message -
  From: dnk [EMAIL PROTECTED]
  To: flexcoders@yahoogroups.com
  Sent: Friday, May 23, 2008 12:47 PM
  Subject: [flexcoders] custom event not added
 
   Hi there,
  
   I have a controller that is adding my custom event listeners,  
but

  for
   some reason my event handler was not being fired.
  
   My original code was (snippet):
  
  
   (in controler)
  
   //constructor
   public function FlexbController()
   {
   //turn the key, start it up
   addEventListener( FlexEvent.CREATION_COMPLETE, onInit );
   }
  
   private function onInit( event:Event ):void
   {
   //setup event listeners
   /*systemManager is where event listener hangs out defines the
   relationship between event and handler*/
  
   systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,
   handler_GetNewsEvent );
   systemManager.addEventListener( AddNewsEvent.ADD_NEWS_EVENT,
   handler_AddNewsEvent );
  
  
  systemManager
  .addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
   handler_NewsLoadedEvent );
   getNewsData();
  
   }
  
   And I had trace statements in all of my handlers... this is  
how i

   noticed things were not working as they should.
  
   SO I added a simple check like (in my FlexbController
 constructor):
  
   if  
(systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,

   handler_GetNewsEvent ))
   {
   trace(true);
   } else {
   trace(false);
   }
  
  
   And I obviously am getting false.
  
   Ideas?
  
   dnk
  
  
  
   
  
   --
   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 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 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 

Re: [flexcoders] custom event not added - almost solved.

2008-05-25 Thread dnk
Ok, I might be onto something here I added trace statements in all  
handlers and contructors, etc

And the order my traces come back are:

Controller
getNewsData
onInit

  The order my traces SHOULD come back are:

Controller
onInit
getNewsData

Since my event listeners are setup in my onInit, and if they are being  
added after my initial dispatchEvent is sent... well obviously they  
will not be called.


So as a test I changed my onInt from:

private function onInit( event:Event ):void
{
//setup event listeners
/*systemManager is where event listener hangs out 
defines the  
relationship between event and handler*/

systemManager.addEventListener( 
GetNewsEvent.GET_NEWS_EVENT,  
handler_GetNewsEvent );
systemManager.addEventListener( 
AddNewsEvent.ADD_NEWS_EVENT,  
handler_AddNewsEvent );
 
systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,  
handler_NewsLoadedEvent );
 getNewsData();

trace(onInit);

}

To:

private function onInit( event:Event ):void
{
//setup event listeners
/*systemManager is where event listener hangs out 
defines the  
relationship between event and handler*/

systemManager.addEventListener( 
GetNewsEvent.GET_NEWS_EVENT,  
handler_GetNewsEvent );
systemManager.addEventListener( 
AddNewsEvent.ADD_NEWS_EVENT,  
handler_AddNewsEvent );
 
systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,  
handler_NewsLoadedEvent );
//getNewsData();
//dispatchEvent(new 
GetNewsEvent(GetNewsEvent.GET_NEWS_EVENT));

// Set a timer since the below function does not seem 
to get fired.
var myTimer:Timer = new Timer(1, 1);
myTimer.addEventListener(timer, getNewsData);
myTimer.start();

trace(onInit);

}


So I essentially setup a timer object to fire once like a second  
later, and it works.

So now this does in fact work as expected, but the method does not  
seem proper to me.

How would others get around this? Just do it the way I did? Or is  
there a more proper and elegant solution for this?

DNK




On 24-May-08, at 9:09 PM, Alex Harui wrote:


 Who’s dispatching and how?



 When does the control get instantiated?  Could it be after  
 creationComplete?



 If the controller is not a UIComponent, it will not get a  
 creationComplete.



 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]  
 On Behalf Of dnk
 Sent: Friday, May 23, 2008 4:48 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] custom event not added



 Hi there,

 I have a controller that is adding my custom event listeners, but for
 some reason my event handler was not being fired.

 My original code was (snippet):

 (in controler)

 //constructor
 public function FlexbController()
 {
 //turn the key, start it up
 addEventListener( FlexEvent.CREATION_COMPLETE, onInit );
 }

 private function onInit( event:Event ):void
 {
 //setup event listeners
 /*systemManager is where event listener hangs out defines the
 relationship between event and handler*/

 systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,
 handler_GetNewsEvent );
 systemManager.addEventListener( AddNewsEvent.ADD_NEWS_EVENT,
 handler_AddNewsEvent );

 systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
 handler_NewsLoadedEvent );
 getNewsData();

 }

 And I had trace statements in all of my handlers... this is how i
 noticed things were not working as they should.

 SO I added a simple check like (in my FlexbController constructor):

 if (systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,
 handler_GetNewsEvent ))
 {
 trace(true);
 } else {
 trace(false);
 }

 And I obviously am getting false.

 Ideas?

 dnk



 




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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:

[flexcoders] Re: Footer for AdvancedDataGrid

2008-05-25 Thread chigwell23
Got Alex's DataFooterGrid converted to AdvancedDataGrid and working
with  grouped data.


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

 Appreciate suggestions for this ... are there any updates to the
 earlier solutions e.g. Alex's DataFooterGrid etc? Which are excellent
 but do not seem to work with grids which need grouped data from flat
 sources ... I don't think the DataFooterGrid inherits enough to do
 this - lot of properties not available. Thanks in advance,
 
 Mic.





[flexcoders] Re: Button down event

2008-05-25 Thread Amy
--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote:

 Flex is pretty good, but not perfect.  We design for 80% cases and 
do
 not always handle the 20% case.  We have code size and developer
 resource restrictions.
 
  
 
 The 80% case is that some button should be activated on ENTER pretty
 much no matter what control has focus.  It would seem to me to be a 
poor
 UI where ENTER could have more than one meaning.  Once there is a
 defaultButton, focusing any other Button enables ENTER handling on 
that
 button.  That's the way it seems to work on Windows as well.  The
 current button that will be activated on ENTER is given special
 highlighting so it will hopefully be apparent to the user what ENTER
 will do.
 
  
 
 I would recommend you choose one button that is the default for 
ENTER.

Let's presume for the sake of argument that I have written something 
similar to a TabButtonBar, where I want to allow the user to tab 
through the buttons and press Enter to activate the highlighted 
button.  What events would I want to listen for?

If you're trying for accessibility, you need to be able to support 
keyboard-only navigation, as is hinted at in the Flex accessibility 
documentation.  However, when you read the details of the 
accessibility documents, they talk about screen readers and ignore 
keyboard-only navigation.

When you (not necessarily you personally, but the engineering team as 
a whole) were programming Flex so that buttons would be automatically 
highlighted when you tabbed to it, what were you intending that the 
significance of that visual cue was supposed to be?

Thanks;

Amy



Re: [flexcoders] AS3 regexp doesnt implement lookbehind?

2008-05-25 Thread Janis Radins
Your sample works. Thanks a lot for proving that look behind works.
Tho I still have no idea how come my expression doesn't. I am using editpad
pro for testing of my expressions and my expression works grate in there.
Strange that AS3 threats it otherwise, must be some regexp implementation
specific issue.

svētdiena, 2008, 25 maijs 20:58 EECOLOR [EMAIL PROTECTED] rakstīja:

   Let's say you have the following text:

 This is a test

 And this regular expression:

 /(?=this).*/gi

 The match would be this:

  is a test

 Works fine as far as I can tell.


 Greetz Erik




 On 5/25/08, Janis Radins [EMAIL PROTECTED] wrote:

  Thanks for a resource.
 Theres lookbehind in list of operators but I just cant get it working. I
 just tried to test some other simple lookbehind expressions and they doesnt
 work too.


 sestdiena, 2008, 24 maijs 19:55 EECOLOR [EMAIL PROTECTED] rakstīja:

 It should have a look behind. I think you can find all your answers here:
 http://gskinner.com/RegExr/

 There is also an Air version available. At the right side you can find
 the capabilities.


 Greetz Erik


 On 5/24/08, Janis Radins [EMAIL PROTECTED] wrote:

 Hey people!

 I'm playing here with some RegExp stuff. Should have learned it long
 time ago tho I started just recently.
 So, i was playing with syntax highlighter in AS3 and stumbled upon
 difficulties on how to match doc tag inside block comment.

 After several hours I came up with genius expression -
 /(?=\/\*(?:[^*]|\*[^*\/])*)(@\w*)/mg
 It works perfectly in text editor I'm using to test expressions but it
 halts in AS3.
 Each of the groups select what they are supposed to perfectly, but they
 do not work togeather.

 I did some googling and couldnt find definitive answer what might be the
 problem.
 So, could it be that AS3 RegExp engine doesn't implement lookbehind?

 Can anyone confirm that or maybe someone knows how comet that bastid
 doesn't work in AS3?

 thanks in advance
 Jānis




  



[flexcoders] Detecting the Access of a Non-Existant Property

2008-05-25 Thread Paul Whitelock
I thought I read somewhere that there is a way to intercept an
attempted access of a non-existent object property.

For example, suppose an attempt is made to access the property bar
of an object foo which is an instance of the class FooBar (i.e. x
= foo.bar). Further suppose that the property bar does not exist for
foo. Is there a way to define a method in FooBar that will catch the
attempt to access the non-existent property bar and return a value
as if bar actually did exist?

Even something similar to the way the prototype property works would
be helpful (if it is scoped to the instance rather than to the class).
Thanks.



RE: [flexcoders] Re: Button down event

2008-05-25 Thread Alex Harui
Keyboard-only navigation is provided for by Flex.  No other work is
required to get it to work, so there isn't much doc on it.  The doc
covers what you need to get screen readers to work as that is not
built-in.

 

It is my understanding that we conform to accessibility guidelines, but
that doesn't mean there aren't bugs.  Most navigators switch tabs via
arrow keys.  Tabbing switches to the next focusable object, and Enter
can activate a defaultButton.  Using tab to switch between tabs is not
an 80% case and, IMHO, would be unexpected by most keyboard navigation
users.  Buttons get highlighted as you tab to them to indicate that
ENTER will activate them (assuming you've set a defaultButton
somewhere).  That's standard UI in Windows and Internet Explorer and
probably other browsers and operating systems as well.

 

If you think you've found problems with our accessibility support,
including keyboard navigation issues, please file bugs and our
accessibility experts will help the engineering team make the
appropriate changes.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Amy
Sent: Sunday, May 25, 2008 12:49 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Button down event

 

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

 Flex is pretty good, but not perfect. We design for 80% cases and 
do
 not always handle the 20% case. We have code size and developer
 resource restrictions.
 
 
 
 The 80% case is that some button should be activated on ENTER pretty
 much no matter what control has focus. It would seem to me to be a 
poor
 UI where ENTER could have more than one meaning. Once there is a
 defaultButton, focusing any other Button enables ENTER handling on 
that
 button. That's the way it seems to work on Windows as well. The
 current button that will be activated on ENTER is given special
 highlighting so it will hopefully be apparent to the user what ENTER
 will do.
 
 
 
 I would recommend you choose one button that is the default for 
ENTER.

Let's presume for the sake of argument that I have written something 
similar to a TabButtonBar, where I want to allow the user to tab 
through the buttons and press Enter to activate the highlighted 
button. What events would I want to listen for?

If you're trying for accessibility, you need to be able to support 
keyboard-only navigation, as is hinted at in the Flex accessibility 
documentation. However, when you read the details of the 
accessibility documents, they talk about screen readers and ignore 
keyboard-only navigation.

When you (not necessarily you personally, but the engineering team as 
a whole) were programming Flex so that buttons would be automatically 
highlighted when you tabbed to it, what were you intending that the 
significance of that visual cue was supposed to be?

Thanks;

Amy

 



RE: [flexcoders] custom event not added - almost solved.

2008-05-25 Thread Alex Harui
Timers are normally not necessary.  You need to have a clear
understanding of the application lifecycle and its events.  I don't know
when your onInit is getting called, but if it is after a request for
data has been sent, that's too late, you need to do it before the
request.

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of dnk
Sent: Sunday, May 25, 2008 11:40 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] custom event not added - almost solved.

Ok, I might be onto something here I added trace statements in all  
handlers and contructors, etc

And the order my traces come back are:

Controller
getNewsData
onInit

  The order my traces SHOULD come back are:

Controller
onInit
getNewsData

Since my event listeners are setup in my onInit, and if they are being  
added after my initial dispatchEvent is sent... well obviously they  
will not be called.


So as a test I changed my onInt from:

private function onInit( event:Event ):void
{
//setup event listeners
/*systemManager is where event listener hangs
out defines the  
relationship between event and handler*/

systemManager.addEventListener(
GetNewsEvent.GET_NEWS_EVENT,  
handler_GetNewsEvent );
systemManager.addEventListener(
AddNewsEvent.ADD_NEWS_EVENT,  
handler_AddNewsEvent );
 
systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,  
handler_NewsLoadedEvent );
 getNewsData();

trace(onInit);

}

To:

private function onInit( event:Event ):void
{
//setup event listeners
/*systemManager is where event listener hangs
out defines the  
relationship between event and handler*/

systemManager.addEventListener(
GetNewsEvent.GET_NEWS_EVENT,  
handler_GetNewsEvent );
systemManager.addEventListener(
AddNewsEvent.ADD_NEWS_EVENT,  
handler_AddNewsEvent );
 
systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,  
handler_NewsLoadedEvent );
//getNewsData();
//dispatchEvent(new
GetNewsEvent(GetNewsEvent.GET_NEWS_EVENT));

// Set a timer since the below function does not
seem to get fired.
var myTimer:Timer = new Timer(1, 1);
myTimer.addEventListener(timer, getNewsData);
myTimer.start();

trace(onInit);

}


So I essentially setup a timer object to fire once like a second  
later, and it works.

So now this does in fact work as expected, but the method does not  
seem proper to me.

How would others get around this? Just do it the way I did? Or is  
there a more proper and elegant solution for this?

DNK




On 24-May-08, at 9:09 PM, Alex Harui wrote:


 Who's dispatching and how?



 When does the control get instantiated?  Could it be after  
 creationComplete?



 If the controller is not a UIComponent, it will not get a  
 creationComplete.



 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]  
 On Behalf Of dnk
 Sent: Friday, May 23, 2008 4:48 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] custom event not added



 Hi there,

 I have a controller that is adding my custom event listeners, but for
 some reason my event handler was not being fired.

 My original code was (snippet):

 (in controler)

 //constructor
 public function FlexbController()
 {
 //turn the key, start it up
 addEventListener( FlexEvent.CREATION_COMPLETE, onInit );
 }

 private function onInit( event:Event ):void
 {
 //setup event listeners
 /*systemManager is where event listener hangs out defines the
 relationship between event and handler*/

 systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,
 handler_GetNewsEvent );
 systemManager.addEventListener( AddNewsEvent.ADD_NEWS_EVENT,
 handler_AddNewsEvent );

 systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
 handler_NewsLoadedEvent );
 getNewsData();

 }

 And I had trace statements in all of my handlers... this is how i
 noticed things were not working as they should.

 SO I added a simple check like (in my FlexbController constructor):

 if (systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,
 handler_GetNewsEvent ))
 {
 trace(true);
 } else {
 trace(false);
 }

 And I obviously am getting false.

 Ideas?

 dnk



 




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups

RE: [flexcoders] Re: Multiple ItemRenderers for a single DataGridColumn

2008-05-25 Thread Alex Harui
ADG is developed by an entirely different team.  They have an
undocumented method called columnItemRenderer that has the same function
signature and looks like it does the same thing.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of dbronk
Sent: Sunday, May 25, 2008 8:13 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Multiple ItemRenderers for a single
DataGridColumn

 

To my great displeasure I don't see the createColumnItemRenderer
function in the AdvancedDataGrid. What do you suggest for the
AdvancedDataGrid as I have the same issue here.

Thanks,
Dale

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

 In Flex3, we added a createColumnItemRenderer method that in theory
 will let you return different renderers per-row. Might be worth a try.
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of dbronk
 Sent: Saturday, May 24, 2008 6:45 AM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] Multiple ItemRenderers for a single
DataGridColumn
 
 
 
 I have a DataGrid and one of the columns I need to be able to do the
 following based on the user security setting and the data in the
 column. So each row in the DataGrid for a single user may have
 different behavior and ItemRenderers.
 
 1. Do not show any data and mark the cell not editable. Still show
 the column, just blank out the cell and do not allow editing.
 
 2. Allow the user to see the data, but not edit it. I would like
 this to simply show as a Text field.
 
 3. Display the data, and allow the user to edit the data via a
 TextInput control.
 
 4. Display the data, and allow the user to edit the data via showing
 a CheckBox control.
 
 I know how to do each individually, but I do not know how to do this
 all at the same time in a single DataGridColumn.
 
 Can I do this?
 
 Thanks,
 Dale


 



RE: [flexcoders] Re: prevent ADG datagrid column from being dragged [bump]

2008-05-25 Thread Alex Harui
ADG is developed by a completely different team.  It appears that there
is no documented way to do this.  You might be able to
stopImmediatePropagation on MOUSE_DOWN.  There is an undocumented
protected method called isDraggingAllowed that takes a column and
returns a Boolean.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of superabe superabe
Sent: Sunday, May 25, 2008 5:14 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: prevent ADG datagrid column from being dragged
[bump]

 

Is there anyway to prevent a column in an AdvancedDataGrid from
being draggable. 
I see a draggable property on the regular Datagrid, but not on
the ADG ?

TIA

- superabe

 



RE: [flexcoders] Detecting the Access of a Non-Existant Property

2008-05-25 Thread Alex Harui
Not per-property for sealed classes.  If you inherit from
flash.utils.Proxy, you can handle all property accesses

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Paul Whitelock
Sent: Sunday, May 25, 2008 1:42 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Detecting the Access of a Non-Existant Property

 

I thought I read somewhere that there is a way to intercept an
attempted access of a non-existent object property.

For example, suppose an attempt is made to access the property bar
of an object foo which is an instance of the class FooBar (i.e. x
= foo.bar). Further suppose that the property bar does not exist for
foo. Is there a way to define a method in FooBar that will catch the
attempt to access the non-existent property bar and return a value
as if bar actually did exist?

Even something similar to the way the prototype property works would
be helpful (if it is scoped to the instance rather than to the class).
Thanks.

 



[flexcoders] sort tree column of AdvancedDataGrid

2008-05-25 Thread chigwell23
In looking at all the examples of AdvancedDataGrids where the first
column is the tree-folder created by hierarchical or grouped data, the
sort header is non-functional. Example : Taking the Adobe
Region:SouthWest example and adding Region:NorthEast, folders will not
resort. Should they sort? Is there a flag for this or does custom code
need to be written? TIA,

Mic. 



[flexcoders] Re: Detecting the Access of a Non-Existant Property

2008-05-25 Thread Paul Whitelock
Thanks! That's it! 

Paul

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

 Not per-property for sealed classes.  If you inherit from
 flash.utils.Proxy, you can handle all property accesses
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Paul Whitelock
 Sent: Sunday, May 25, 2008 1:42 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Detecting the Access of a Non-Existant Property
 
  
 
 I thought I read somewhere that there is a way to intercept an
 attempted access of a non-existent object property.
 
 For example, suppose an attempt is made to access the property bar
 of an object foo which is an instance of the class FooBar (i.e. x
 = foo.bar). Further suppose that the property bar does not exist for
 foo. Is there a way to define a method in FooBar that will catch the
 attempt to access the non-existent property bar and return a value
 as if bar actually did exist?
 
 Even something similar to the way the prototype property works would
 be helpful (if it is scoped to the instance rather than to the class).
 Thanks.





RE: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS or LCDS

2008-05-25 Thread Tim Stewart
I have logged the request - # BLZ-185. Plus I have voted for BLZ-184, as
I can see how this could affect us in other situations. Perhaps if
enough people vote on both, a consolidated effort can be made to review
asynchronicity across BlazeDS?
 
Regards Tim



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Seth Hodgson
Sent: Saturday, 24 May 2008 2:59 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Async Concurrent Requests with AMF for
BlazeDS or LCDS



Hi Tim,

Yeah, it's the same issue. With proxied calls though, it's a bit more
complicated to solve. In the remoting case, your remote object method is
generally just doing some local computation on the server and maybe
hitting a database. It's simple to wrap this up in a Runnable and
execute it asynchronously. In the case of the proxy service, we use the
Apache HttpClient library to make proxied calls on your behalf, and this
would be _much_ harder for you to wrap up in a Runnable to execute
concurrently.

I'd like to see us support async mode for the proxy service as well as
for the remoting service, and the proxy service itself should be updated
to use NIO to support making proxied calls that don't tie up a server
thread for the duration of the proxy request. Right now, in BlazeDS,
because Servlet IO is blocking, when you make a proxy service call that
hits our server the servlet request handler thread has to wait for the
proxy request to return before it can return. So you tie up the thread
for the duration of the call which could take awhile. 

Would you mind logging an enhancement request for async proxy service
support in our bugbase?

Thanks,
Seth

From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On Behalf Of Tim Stewart
Sent: Thursday, May 22, 2008 9:56 PM
To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
Subject: RE: [flexcoders] Re: Async Concurrent Requests with AMF for
BlazeDS or LCDS

Hi Seth, could you say whether this is similar to the limitation in
LiveCycle / Blaze proxy service, which causes multiple web service calls
to be queued and executed in sequence rather than simultaneously - and
whether there could be a similar approach to working around this?
 
I have an application that calls several web services at startup, and
the sequential vs. simultaneous thing really slows it down.
 
Regards Tim


From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On Behalf Of MyoT
Sent: Friday, 23 May 2008 11:17 AM
To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
Subject: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS
or LCDS
Hi Seth,

This is awesome information. I didn't know player batch them up and
send in one post. I learned something today. I digged through Blaze
source code and found out that BatchProcessFilter is responsible for
processing those messages . I am wondering is there any way, I can
write our own batch process filter and plug that in instead of default
one. What I am thinking is to process those messages in parallel on
server then response to the client in one response. Basically, it
would cut down the time server has to wait to finish processing all
those messages sequentially.

Any thoughts or insight info would be appreciated.

Thanks,
Jay

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

 There is a single thread that advances through SWF frames and runs
your
 ActionScript code and event handlers, but network calls are performed
by
 separate background threads concurrently.
 
 In order to have calls processed concurrently on the server, they need
 to arrive as separate requests. In the case of AMF, if you make a
series
 of calls quickly chances are good/excellent that the Player will batch
 them up and send them to the server in the body of a single HTTP POST.
 When this happens, the server must unpack them and process them
serially
 and then pack the results for all these calls back up in the body of a
 single HTTP response. Because we're dealing with a single request and
 response, there's no way to send back results for individual calls
 separately. When these results get back to the browser and are passed
 back into the Player, they are dispatched to your ActionScript
handling
 code as asynchronous events. There's not a good way to force calls to
be
 sent as separate requests, and even if you could, browsers impose
limits
 on the number of concurrent connections they'll open to a server, so
 this really isn't the right way to solve your scenario. Also, in the
 case of RTMP all traffic between the client and server happens over a
 single connection and is ordered serially.
 
 
 
 If you want to process 

[flexcoders] Re: sort tree column of AdvancedDataGrid

2008-05-25 Thread chigwell23
Bizarre - just found an example from the Cookbook (adg9:the Planets
example) where the first tree folder column does sort - code is no
different - only variation is that the array is defined from
mx:Object  - not sure why that might make the difference?

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

 In looking at all the examples of AdvancedDataGrids where the first
 column is the tree-folder created by hierarchical or grouped data, the
 sort header is non-functional. Example : Taking the Adobe
 Region:SouthWest example and adding Region:NorthEast, folders will not
 resort. Should they sort? Is there a flag for this or does custom code
 need to be written? TIA,
 
 Mic.





Re: [flexcoders] Re: prevent ADG datagrid column from being dragged [bump]

2008-05-25 Thread superabe superabe
Thanks Alex. I'll give that a try.

- superabe

On Sun, May 25, 2008 at 5:26 PM, Alex Harui [EMAIL PROTECTED] wrote:

ADG is developed by a completely different team.  It appears that there
 is no documented way to do this.  You might be able to
 stopImmediatePropagation on MOUSE_DOWN.  There is an undocumented protected
 method called isDraggingAllowed that takes a column and returns a Boolean.


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *superabe superabe
 *Sent:* Sunday, May 25, 2008 5:14 AM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Re: prevent ADG datagrid column from being dragged
 [bump]



 Is there anyway to prevent a column in an AdvancedDataGrid from being
 draggable.
 I see a draggable property on the regular Datagrid, but not on the ADG ?

 TIA

 - superabe

   



[flexcoders] Use my ou namespace with manifest without swc?

2008-05-25 Thread danielvlopes
Hello,

I have a question about usage of manifest.xml and flex-config.xml. I
want create my own namespace for all my folders and componnents but i
don't want create a swc for those comps. I just want use the namespace
referenced to my own manifest. I found some ways to do this creating
the app-config.xml and in namespaces tag on this xml reference the uri
and manifest but there is another way to do that?

Thanks



[flexcoders] pass xml data by web service from Flex?

2008-05-25 Thread markflex2007
Hi,

Do you think if it is possible to pass xml data to backend with web 
serice?

Thanks

Mark



[flexcoders] Flex Profiler: Charts and Graphs not equal?

2008-05-25 Thread liu_bai_un
I'm having some issues with an app that potentially may be hitting the
memory allocation maximum. I'm trying to figure out if the issue is
that I'm hitting the maximum container size, the maximum Flash Player
cache, or the maximum Browser cache (Firefox is default at 50MB). Does
someone have any insight regarding the frequency of these issues?

Though the app's assets total to about 2-3 MB of pictures, the Flex
Profiler has the peak memory at 63MB from the Memory Usage chart. What
I am extremely confused about is that the (current) Memory in the Live
Objects table totals to about 11,000 (I'm not sure what units (KB?)),
which does not match the Current Memory reading on the Memory Usage
chart at all. Thanks.



[flexcoders] (unknown)

2008-05-25 Thread she lady




  

[flexcoders] Changing the color of a link in LinkBar.

2008-05-25 Thread sabe2000
Hi,
When inserting a LinkBar, by default when you click on a link, it
turns the background of that item blue. I want it yellow. Which
property should I change to get the appropriate results?
Thanks
She 



[flexcoders] Re: Amazon S3 + Flex Uploader // help!

2008-05-25 Thread comhlamhmedia
Assuming you mean Christian's library for ss3, I've looked at removing
AIR dependencies and found a couple of issues:
 
The main thing is that the library uses a File object which will need
to be changed to a FileReference. It uses File because is provides
uploading via S3's RESTful API, and which flash player doesn't support
PUT. S3 does provide an alternate method using POST. So the AS3
library would need to be altered to use POST with FileReference instead.

And of course to keep the private key secure, you'll probably need a
backend to generate yours authentications. 

Both of which are are thinks I'd like to get to at some stage, but
couldn't say when.

Hope this helps,
Ian


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

 greetings..oh wise list.
 my 1st post.
 
 im trying to find a way ( a class/library ) to 
 BATCH upload from FLEX using fileReference() to Amazon S3.
 
 is there some code/samples one is kind enough to share that will
 automatically via Keys - generate and attach 64-based policies,
 signatures, etc.
 
 and would this be easier to do in PHP? 
 if so, why? and how?
 
 any advice, direction, and code sharing would be immense.
 
 
 thanks!
 
 artur





[flexcoders] text input length

2008-05-25 Thread nihilism machine
is there any way to expand the size of the text input field? width  
does not seem to work ...

-e


[flexcoders] line height

2008-05-25 Thread nihilism machine
How can i set line height  and margin for a mx:Text htmlText - or  
even without the html text. I cant find docs on this anywhere.

thanks in advance.

-e


Re: [flexcoders] custom event not added - almost solved.

2008-05-25 Thread dnk
Yeah that is what I thought.

my onInit is called in my constructor  with:

addEventListener( FlexEvent.CREATION_COMPLETE, onInit );


The requests for data are usually called after other adding of the  
events, but within the same function  (onInit).

I think I will just ad my addEventListener calls direct in my  
constructor and see what happens there.

dnk


On 25-May-08, at 2:08 PM, Alex Harui wrote:

 Timers are normally not necessary. You need to have a clear
 understanding of the application lifecycle and its events. I don't  
 know
 when your onInit is getting called, but if it is after a request for
 data has been sent, that's too late, you need to do it before the
 request.

 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]  
 On
 Behalf Of dnk
 Sent: Sunday, May 25, 2008 11:40 AM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] custom event not added - almost solved.

 Ok, I might be onto something here I added trace statements in all
 handlers and contructors, etc

 And the order my traces come back are:

 Controller
 getNewsData
 onInit

 The order my traces SHOULD come back are:

 Controller
 onInit
 getNewsData

 Since my event listeners are setup in my onInit, and if they are being
 added after my initial dispatchEvent is sent... well obviously they
 will not be called.

 So as a test I changed my onInt from:

 private function onInit( event:Event ):void
 {
 //setup event listeners
 /*systemManager is where event listener hangs
 out defines the
 relationship between event and handler*/

 systemManager.addEventListener(
 GetNewsEvent.GET_NEWS_EVENT,
 handler_GetNewsEvent );
 systemManager.addEventListener(
 AddNewsEvent.ADD_NEWS_EVENT,
 handler_AddNewsEvent );

 systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
 handler_NewsLoadedEvent );
 getNewsData();

 trace(onInit);

 }

 To:

 private function onInit( event:Event ):void
 {
 //setup event listeners
 /*systemManager is where event listener hangs
 out defines the
 relationship between event and handler*/

 systemManager.addEventListener(
 GetNewsEvent.GET_NEWS_EVENT,
 handler_GetNewsEvent );
 systemManager.addEventListener(
 AddNewsEvent.ADD_NEWS_EVENT,
 handler_AddNewsEvent );

 systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
 handler_NewsLoadedEvent );
 //getNewsData();
 //dispatchEvent(new
 GetNewsEvent(GetNewsEvent.GET_NEWS_EVENT));

 // Set a timer since the below function does not
 seem to get fired.
 var myTimer:Timer = new Timer(1, 1);
 myTimer.addEventListener(timer, getNewsData);
 myTimer.start();

 trace(onInit);

 }

 So I essentially setup a timer object to fire once like a second
 later, and it works.

 So now this does in fact work as expected, but the method does not
 seem proper to me.

 How would others get around this? Just do it the way I did? Or is
 there a more proper and elegant solution for this?

 DNK

 On 24-May-08, at 9:09 PM, Alex Harui wrote:

 
  Who's dispatching and how?
 
 
 
  When does the control get instantiated? Could it be after
  creationComplete?
 
 
 
  If the controller is not a UIComponent, it will not get a
  creationComplete.
 
 
 
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
  On Behalf Of dnk
  Sent: Friday, May 23, 2008 4:48 AM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] custom event not added
 
 
 
  Hi there,
 
  I have a controller that is adding my custom event listeners, but  
 for
  some reason my event handler was not being fired.
 
  My original code was (snippet):
 
  (in controler)
 
  //constructor
  public function FlexbController()
  {
  //turn the key, start it up
  addEventListener( FlexEvent.CREATION_COMPLETE, onInit );
  }
 
  private function onInit( event:Event ):void
  {
  //setup event listeners
  /*systemManager is where event listener hangs out defines the
  relationship between event and handler*/
 
  systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,
  handler_GetNewsEvent );
  systemManager.addEventListener( AddNewsEvent.ADD_NEWS_EVENT,
  handler_AddNewsEvent );
 
   
 systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
  handler_NewsLoadedEvent );
  getNewsData();
 
  }
 
  And I had trace statements in all of my handlers... this is how i
  noticed things were not working as they should.
 
  SO I added a simple check like (in my FlexbController constructor):
 
  if (systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,
  handler_GetNewsEvent ))
  {
  trace(true);
  } else {
  trace(false);
  }
 
  And I obviously am getting false.
 
  Ideas?
 
  dnk
 
 
 
 

 

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


 




--
Flexcoders Mailing List
FAQ: 

RE: [flexcoders] how could I get certified by flex

2008-05-25 Thread Rick Winscot
So the link is for Flex '3' Training from the source. if you are comfortable
with the materials in both reference books and have a grasp on data services
- then contact your local Prometric testing facility to schedule an
examination. Here is a link to the exam prep guide:

 

http://partners.adobe.com/public/en/ace/Exam_Guide_Flex2.pdf 

 

Rick Winscot

 

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Gustavo Duenas
Sent: Saturday, May 24, 2008 9:06 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] how could I get certified by flex

 

Hi, 

 I have adobe flex 2 training from the the source, once I got it finished
where should I go have the test

to be certified?

Regards,

 

 

Gustavo Duenas

 

 

On May 24, 2008, at 5:55 PM, Rick Winscot wrote:





The 'Training from the Source' series is a good place to start...

http://www.amazon.com/Adobe-Flex-3-Training-Source/dp/0321529189 

Rick Winscot

From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ]
On
Behalf Of Gustavo Duenas
Sent: Saturday, May 24, 2008 5:41 PM
To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
Subject: [flexcoders] how could I get certified by flex

Hi coders , I was wondering, where could I find a flex book to study 
for a flex certification and also
where could I get that test .

Regards,

Gustavo Duenas

winmail.dat

 

 



Re: [flexcoders] custom event not added - almost solved.

2008-05-25 Thread Josh McDonald
In this code:

private function onInit( event:Event ):void
{
systemManager.addEventListener( GetNewsEvent.GET_NEWS_EVENT,
handler_GetNewsEvent );

systemManager.addEventListener( AddNewsEvent.ADD_NEWS_EVENT,
handler_AddNewsEvent );

systemManager.addEventListener(
NewsDataLoadedEvent.NEWS_LOADED_EVENT,
handler_NewsLoadedEvent );

getNewsData();

trace(onInit);

}

You're calling getNewsData before you do the trace from your init() method,
so you're getting the order you want but it looks otherwise. Whenever I've
using this sort of trace statement to debug a process execution, I make it
the first line of the method, and I suggest it's a good habit to have :)

When you call addEventListener, it has an immediate effect. But when you
call dispatchEvent, it sits in a queue until all other processing for this
frame is completed. Alex can tell you whether it's run in the last part of
this frame, or the first part of the next, but it's neither here nor there.
If you're adding a handler, and then calling the code that dispatches that
event, you should still be receiving the event in your handler, leaving me
to believe that something else is the cause of your woes.

How big is your project? If it's a reasonable size (and doesn't contain any
business secrets or anything), zip it up and upload it somewhere, and I'll
download the whole thing and have a look- I'm sure I'll be able to figure
out what you're doing wrong.

-J

On Mon, May 26, 2008 at 1:35 PM, dnk [EMAIL PROTECTED] wrote:

 Yeah that is what I thought.

 my onInit is called in my constructor  with:

 addEventListener( FlexEvent.CREATION_COMPLETE, onInit );


 The requests for data are usually called after other adding of the
 events, but within the same function  (onInit).

 I think I will just ad my addEventListener calls direct in my
 constructor and see what happens there.

 dnk


 On 25-May-08, at 2:08 PM, Alex Harui wrote:

  Timers are normally not necessary. You need to have a clear
  understanding of the application lifecycle and its events. I don't
  know
  when your onInit is getting called, but if it is after a request for
  data has been sent, that's too late, you need to do it before the
  request.
 
  -Original Message-
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
  On
  Behalf Of dnk
  Sent: Sunday, May 25, 2008 11:40 AM
  To: flexcoders@yahoogroups.com
  Subject: Re: [flexcoders] custom event not added - almost solved.
 
  Ok, I might be onto something here I added trace statements in all
  handlers and contructors, etc
 
  And the order my traces come back are:
 
  Controller
  getNewsData
  onInit
 
  The order my traces SHOULD come back are:
 
  Controller
  onInit
  getNewsData
 
  Since my event listeners are setup in my onInit, and if they are being
  added after my initial dispatchEvent is sent... well obviously they
  will not be called.
 
  So as a test I changed my onInt from:
 
  private function onInit( event:Event ):void
  {
  //setup event listeners
  /*systemManager is where event listener hangs
  out defines the
  relationship between event and handler*/
 
  systemManager.addEventListener(
  GetNewsEvent.GET_NEWS_EVENT,
  handler_GetNewsEvent );
  systemManager.addEventListener(
  AddNewsEvent.ADD_NEWS_EVENT,
  handler_AddNewsEvent );
 
  systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
  handler_NewsLoadedEvent );
  getNewsData();
 
  trace(onInit);
 
  }
 
  To:
 
  private function onInit( event:Event ):void
  {
  //setup event listeners
  /*systemManager is where event listener hangs
  out defines the
  relationship between event and handler*/
 
  systemManager.addEventListener(
  GetNewsEvent.GET_NEWS_EVENT,
  handler_GetNewsEvent );
  systemManager.addEventListener(
  AddNewsEvent.ADD_NEWS_EVENT,
  handler_AddNewsEvent );
 
  systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
  handler_NewsLoadedEvent );
  //getNewsData();
  //dispatchEvent(new
  GetNewsEvent(GetNewsEvent.GET_NEWS_EVENT));
 
  // Set a timer since the below function does not
  seem to get fired.
  var myTimer:Timer = new Timer(1, 1);
  myTimer.addEventListener(timer, getNewsData);
  myTimer.start();
 
  trace(onInit);
 
  }
 
  So I essentially setup a timer object to fire once like a second
  later, and it works.
 
  So now this does in fact work as expected, but the method does not
  seem proper to me.
 
  How would others get around this? Just do it the way I did? Or is
  there a more proper and elegant solution for this?
 
  DNK
 
  On 24-May-08, at 9:09 PM, Alex Harui wrote:
 
  
   Who's dispatching and how?
  
  
  
   When does the control get instantiated? Could it be after
   creationComplete?
  
  
  
   If the controller is not a UIComponent, it will not get a
   creationComplete.
  
  
  
   From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
   On Behalf Of dnk
   

Re: [flexcoders] custom event not added - almost solved.

2008-05-25 Thread Josh McDonald
Ok mate, here's the problem:

public function FlexbController()
{
//turn the key, start it up
addEventListener( FlexEvent.CREATION_COMPLETE, onInit );
trace(Controller);
}

What you need, is this:

public function FlexbController()
{
//turn the key, start it up
Application.application.addEventListener(
FlexEvent.CREATION_COMPLETE, onInit );
trace(Controller);
}

The reason for this, is the way CREATION_COMPLETE is dispatched - which is
from the bottom of your display tree upward. It has to be this way, because
it's dispatched only after all the children of a component have already had
CREATION_COMPLETE dispatched. So first it is dispatched on all instantiated
UIComponents that don't have any children. Then (probably on the next frame,
but ask Alex) it's dispatched on their container components, and so on and
so forth until finally (as far as we care) it's dispatched on your root
Application. It might be then dispatched on a few containers up to the
systemManager, but again Alex would know better than me.

Now what happens in your case, CREATION_COMPLETE is dispatched on your
FlexbController, and then you're dispatching the GET_NEWS_EVENT immediately.
But, the current instance of FlexbController is not yet part of the
displayTree, because it hasn't been completely added to the Application's
children yet. So the event has nowhere to bubble to - and never reaches the
Application, or the SystemManager.

But, if you defer onInit() until CREATION_COMPLETE is dispatched on the
Application itself, you know that the display tree is complete (in its
initial layout at least), and you can safely dispatch the event and have it
bubble all the way to the top of the tree at SystemManager.

-J

On Mon, May 26, 2008 at 1:35 PM, dnk [EMAIL PROTECTED] wrote:

 Yeah that is what I thought.

 my onInit is called in my constructor  with:

 addEventListener( FlexEvent.CREATION_COMPLETE, onInit );


 The requests for data are usually called after other adding of the
 events, but within the same function  (onInit).

 I think I will just ad my addEventListener calls direct in my
 constructor and see what happens there.

 dnk


 On 25-May-08, at 2:08 PM, Alex Harui wrote:

  Timers are normally not necessary. You need to have a clear
  understanding of the application lifecycle and its events. I don't
  know
  when your onInit is getting called, but if it is after a request for
  data has been sent, that's too late, you need to do it before the
  request.
 
  -Original Message-
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
  On
  Behalf Of dnk
  Sent: Sunday, May 25, 2008 11:40 AM
  To: flexcoders@yahoogroups.com
  Subject: Re: [flexcoders] custom event not added - almost solved.
 
  Ok, I might be onto something here I added trace statements in all
  handlers and contructors, etc
 
  And the order my traces come back are:
 
  Controller
  getNewsData
  onInit
 
  The order my traces SHOULD come back are:
 
  Controller
  onInit
  getNewsData
 
  Since my event listeners are setup in my onInit, and if they are being
  added after my initial dispatchEvent is sent... well obviously they
  will not be called.
 
  So as a test I changed my onInt from:
 
  private function onInit( event:Event ):void
  {
  //setup event listeners
  /*systemManager is where event listener hangs
  out defines the
  relationship between event and handler*/
 
  systemManager.addEventListener(
  GetNewsEvent.GET_NEWS_EVENT,
  handler_GetNewsEvent );
  systemManager.addEventListener(
  AddNewsEvent.ADD_NEWS_EVENT,
  handler_AddNewsEvent );
 
  systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
  handler_NewsLoadedEvent );
  getNewsData();
 
  trace(onInit);
 
  }
 
  To:
 
  private function onInit( event:Event ):void
  {
  //setup event listeners
  /*systemManager is where event listener hangs
  out defines the
  relationship between event and handler*/
 
  systemManager.addEventListener(
  GetNewsEvent.GET_NEWS_EVENT,
  handler_GetNewsEvent );
  systemManager.addEventListener(
  AddNewsEvent.ADD_NEWS_EVENT,
  handler_AddNewsEvent );
 
  systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
  handler_NewsLoadedEvent );
  //getNewsData();
  //dispatchEvent(new
  GetNewsEvent(GetNewsEvent.GET_NEWS_EVENT));
 
  // Set a timer since the below function does not
  seem to get fired.
  var myTimer:Timer = new Timer(1, 1);
  myTimer.addEventListener(timer, getNewsData);
  myTimer.start();
 
  trace(onInit);
 
  }
 
  So I essentially setup a timer object to fire once like a second
  later, and it works.
 
  So now this does in fact work as expected, but the method does not
  seem proper to me.
 
  How would others get around this? Just do it the way I did? Or is
  there a more proper and elegant solution for this?
 
  DNK
 
  On 24-May-08, at 9:09 PM, Alex Harui wrote:
 
  
   Who's 

Re: [flexcoders] custom event not added - almost solved.

2008-05-25 Thread Josh McDonald
And don't forget to add:

import mx.core.Application;

Up the top :)

On Mon, May 26, 2008 at 2:11 PM, Josh McDonald [EMAIL PROTECTED] wrote:

 Ok mate, here's the problem:

 public function FlexbController()
 {
 //turn the key, start it up
 addEventListener( FlexEvent.CREATION_COMPLETE, onInit );
 trace(Controller);
 }

 What you need, is this:

 public function FlexbController()
 {
 //turn the key, start it up
 Application.application.addEventListener(
 FlexEvent.CREATION_COMPLETE, onInit );
 trace(Controller);
 }

 The reason for this, is the way CREATION_COMPLETE is dispatched - which is
 from the bottom of your display tree upward. It has to be this way, because
 it's dispatched only after all the children of a component have already had
 CREATION_COMPLETE dispatched. So first it is dispatched on all instantiated
 UIComponents that don't have any children. Then (probably on the next frame,
 but ask Alex) it's dispatched on their container components, and so on and
 so forth until finally (as far as we care) it's dispatched on your root
 Application. It might be then dispatched on a few containers up to the
 systemManager, but again Alex would know better than me.

 Now what happens in your case, CREATION_COMPLETE is dispatched on your
 FlexbController, and then you're dispatching the GET_NEWS_EVENT immediately.
 But, the current instance of FlexbController is not yet part of the
 displayTree, because it hasn't been completely added to the Application's
 children yet. So the event has nowhere to bubble to - and never reaches the
 Application, or the SystemManager.

 But, if you defer onInit() until CREATION_COMPLETE is dispatched on the
 Application itself, you know that the display tree is complete (in its
 initial layout at least), and you can safely dispatch the event and have it
 bubble all the way to the top of the tree at SystemManager.

 -J

 On Mon, May 26, 2008 at 1:35 PM, dnk [EMAIL PROTECTED] wrote:

 Yeah that is what I thought.

 my onInit is called in my constructor  with:

 addEventListener( FlexEvent.CREATION_COMPLETE, onInit );


 The requests for data are usually called after other adding of the
 events, but within the same function  (onInit).

 I think I will just ad my addEventListener calls direct in my
 constructor and see what happens there.

 dnk


 On 25-May-08, at 2:08 PM, Alex Harui wrote:

  Timers are normally not necessary. You need to have a clear
  understanding of the application lifecycle and its events. I don't
  know
  when your onInit is getting called, but if it is after a request for
  data has been sent, that's too late, you need to do it before the
  request.
 
  -Original Message-
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
  On
  Behalf Of dnk
  Sent: Sunday, May 25, 2008 11:40 AM
  To: flexcoders@yahoogroups.com
  Subject: Re: [flexcoders] custom event not added - almost solved.
 
  Ok, I might be onto something here I added trace statements in all
  handlers and contructors, etc
 
  And the order my traces come back are:
 
  Controller
  getNewsData
  onInit
 
  The order my traces SHOULD come back are:
 
  Controller
  onInit
  getNewsData
 
  Since my event listeners are setup in my onInit, and if they are being
  added after my initial dispatchEvent is sent... well obviously they
  will not be called.
 
  So as a test I changed my onInt from:
 
  private function onInit( event:Event ):void
  {
  //setup event listeners
  /*systemManager is where event listener hangs
  out defines the
  relationship between event and handler*/
 
  systemManager.addEventListener(
  GetNewsEvent.GET_NEWS_EVENT,
  handler_GetNewsEvent );
  systemManager.addEventListener(
  AddNewsEvent.ADD_NEWS_EVENT,
  handler_AddNewsEvent );
 
  systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
  handler_NewsLoadedEvent );
  getNewsData();
 
  trace(onInit);
 
  }
 
  To:
 
  private function onInit( event:Event ):void
  {
  //setup event listeners
  /*systemManager is where event listener hangs
  out defines the
  relationship between event and handler*/
 
  systemManager.addEventListener(
  GetNewsEvent.GET_NEWS_EVENT,
  handler_GetNewsEvent );
  systemManager.addEventListener(
  AddNewsEvent.ADD_NEWS_EVENT,
  handler_AddNewsEvent );
 
  systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
  handler_NewsLoadedEvent );
  //getNewsData();
  //dispatchEvent(new
  GetNewsEvent(GetNewsEvent.GET_NEWS_EVENT));
 
  // Set a timer since the below function does not
  seem to get fired.
  var myTimer:Timer = new Timer(1, 1);
  myTimer.addEventListener(timer, getNewsData);
  myTimer.start();
 
  trace(onInit);
 
  }
 
  So I essentially setup a timer object to fire once like a second
  later, and it works.
 
  So now this does in fact work as expected, but the method does not
  seem proper to me.
 
  How would 

Re: [flexcoders] custom event not added - almost solved.

2008-05-25 Thread dnk

Dude, you rule!

Thanks s much!

Dnk


On 25-May-08, at 9:12 PM, Josh McDonald wrote:


And don't forget to add:

import mx.core.Application;

Up the top :)


On Mon, May 26, 2008 at 2:11 PM, Josh McDonald [EMAIL PROTECTED]  
wrote:

Ok mate, here's the problem:


public function FlexbController()
{
//turn the key, start it up
addEventListener( FlexEvent.CREATION_COMPLETE, onInit );
trace(Controller);
}

What you need, is this:


public function FlexbController()
{
//turn the key, start it up
 
Application 
.application.addEventListener( FlexEvent.CREATION_COMPLETE, onInit );

trace(Controller);
}

The reason for this, is the way CREATION_COMPLETE is dispatched -  
which is from the bottom of your display tree upward. It has to be  
this way, because it's dispatched only after all the children of a  
component have already had CREATION_COMPLETE dispatched. So first it  
is dispatched on all instantiated UIComponents that don't have any  
children. Then (probably on the next frame, but ask Alex) it's  
dispatched on their container components, and so on and so forth  
until finally (as far as we care) it's dispatched on your root  
Application. It might be then dispatched on a few containers up to  
the systemManager, but again Alex would know better than me.


Now what happens in your case, CREATION_COMPLETE is dispatched on  
your FlexbController, and then you're dispatching the GET_NEWS_EVENT  
immediately. But, the current instance of FlexbController is not yet  
part of the displayTree, because it hasn't been completely added to  
the Application's children yet. So the event has nowhere to bubble  
to - and never reaches the Application, or the SystemManager.


But, if you defer onInit() until CREATION_COMPLETE is dispatched on  
the Application itself, you know that the display tree is complete  
(in its initial layout at least), and you can safely dispatch the  
event and have it bubble all the way to the top of the tree at  
SystemManager.


-J

On Mon, May 26, 2008 at 1:35 PM, dnk [EMAIL PROTECTED] wrote:
Yeah that is what I thought.

my onInit is called in my constructor  with:

addEventListener( FlexEvent.CREATION_COMPLETE, onInit );


The requests for data are usually called after other adding of the
events, but within the same function  (onInit).

I think I will just ad my addEventListener calls direct in my
constructor and see what happens there.

dnk


On 25-May-08, at 2:08 PM, Alex Harui wrote:

 Timers are normally not necessary. You need to have a clear
 understanding of the application lifecycle and its events. I don't
 know
 when your onInit is getting called, but if it is after a request for
 data has been sent, that's too late, you need to do it before the
 request.

 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
 On
 Behalf Of dnk
 Sent: Sunday, May 25, 2008 11:40 AM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] custom event not added - almost solved.

 Ok, I might be onto something here I added trace statements in  
all

 handlers and contructors, etc

 And the order my traces come back are:

 Controller
 getNewsData
 onInit

 The order my traces SHOULD come back are:

 Controller
 onInit
 getNewsData

 Since my event listeners are setup in my onInit, and if they are  
being

 added after my initial dispatchEvent is sent... well obviously they
 will not be called.

 So as a test I changed my onInt from:

 private function onInit( event:Event ):void
 {
 //setup event listeners
 /*systemManager is where event listener hangs
 out defines the
 relationship between event and handler*/

 systemManager.addEventListener(
 GetNewsEvent.GET_NEWS_EVENT,
 handler_GetNewsEvent );
 systemManager.addEventListener(
 AddNewsEvent.ADD_NEWS_EVENT,
 handler_AddNewsEvent );

  
systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,

 handler_NewsLoadedEvent );
 getNewsData();

 trace(onInit);

 }

 To:

 private function onInit( event:Event ):void
 {
 //setup event listeners
 /*systemManager is where event listener hangs
 out defines the
 relationship between event and handler*/

 systemManager.addEventListener(
 GetNewsEvent.GET_NEWS_EVENT,
 handler_GetNewsEvent );
 systemManager.addEventListener(
 AddNewsEvent.ADD_NEWS_EVENT,
 handler_AddNewsEvent );

  
systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,

 handler_NewsLoadedEvent );
 //getNewsData();
 //dispatchEvent(new
 GetNewsEvent(GetNewsEvent.GET_NEWS_EVENT));

 // Set a timer since the below function does not
 seem to get fired.
 var myTimer:Timer = new Timer(1, 1);
 myTimer.addEventListener(timer, getNewsData);
 myTimer.start();

 trace(onInit);

 }

 So I essentially setup a timer object to fire once like a second
 later, and it works.

 So now this does in fact work as expected, but the method does not
 seem proper to me.

 

Re: [flexcoders] custom event not added - almost solved.

2008-05-25 Thread Josh McDonald
No probs mate, it was pissing me off not know what the problem was, too :)

-J

On Mon, May 26, 2008 at 2:22 PM, dnk [EMAIL PROTECTED] wrote:

   Dude, you rule!

 Thanks s much!

 Dnk


 On 25-May-08, at 9:12 PM, Josh McDonald wrote:

 And don't forget to add:

 import mx.core.Application;

 Up the top :)

 On Mon, May 26, 2008 at 2:11 PM, Josh McDonald [EMAIL PROTECTED] wrote:

 Ok mate, here's the problem:

 public function FlexbController()
 {
 //turn the key, start it up
 addEventListener( FlexEvent.CREATION_COMPLETE, onInit );
 trace(Controller);
 }

 What you need, is this:

 public function FlexbController()
 {
 //turn the key, start it up
 Application.application.addEventListener(
 FlexEvent.CREATION_COMPLETE, onInit );
 trace(Controller);
 }

 The reason for this, is the way CREATION_COMPLETE is dispatched - which is
 from the bottom of your display tree upward. It has to be this way, because
 it's dispatched only after all the children of a component have already had
 CREATION_COMPLETE dispatched. So first it is dispatched on all instantiated
 UIComponents that don't have any children. Then (probably on the next frame,
 but ask Alex) it's dispatched on their container components, and so on and
 so forth until finally (as far as we care) it's dispatched on your root
 Application. It might be then dispatched on a few containers up to the
 systemManager, but again Alex would know better than me.

 Now what happens in your case, CREATION_COMPLETE is dispatched on your
 FlexbController, and then you're dispatching the GET_NEWS_EVENT immediately.
 But, the current instance of FlexbController is not yet part of the
 displayTree, because it hasn't been completely added to the Application's
 children yet. So the event has nowhere to bubble to - and never reaches the
 Application, or the SystemManager.

 But, if you defer onInit() until CREATION_COMPLETE is dispatched on the
 Application itself, you know that the display tree is complete (in its
 initial layout at least), and you can safely dispatch the event and have it
 bubble all the way to the top of the tree at SystemManager.

 -J

 On Mon, May 26, 2008 at 1:35 PM, dnk [EMAIL PROTECTED] wrote:

 Yeah that is what I thought.

 my onInit is called in my constructor  with:

 addEventListener( FlexEvent.CREATION_COMPLETE, onInit );


 The requests for data are usually called after other adding of the
 events, but within the same function  (onInit).

 I think I will just ad my addEventListener calls direct in my
 constructor and see what happens there.

 dnk


 On 25-May-08, at 2:08 PM, Alex Harui wrote:

  Timers are normally not necessary. You need to have a clear
  understanding of the application lifecycle and its events. I don't
  know
  when your onInit is getting called, but if it is after a request for
  data has been sent, that's too late, you need to do it before the
  request.
 
  -Original Message-
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
  On
  Behalf Of dnk
  Sent: Sunday, May 25, 2008 11:40 AM
  To: flexcoders@yahoogroups.com
  Subject: Re: [flexcoders] custom event not added - almost solved.
 
  Ok, I might be onto something here I added trace statements in all
  handlers and contructors, etc
 
  And the order my traces come back are:
 
  Controller
  getNewsData
  onInit
 
  The order my traces SHOULD come back are:
 
  Controller
  onInit
  getNewsData
 
  Since my event listeners are setup in my onInit, and if they are being
  added after my initial dispatchEvent is sent... well obviously they
  will not be called.
 
  So as a test I changed my onInt from:
 
  private function onInit( event:Event ):void
  {
  //setup event listeners
  /*systemManager is where event listener hangs
  out defines the
  relationship between event and handler*/
 
  systemManager.addEventListener(
  GetNewsEvent.GET_NEWS_EVENT,
  handler_GetNewsEvent );
  systemManager.addEventListener(
  AddNewsEvent.ADD_NEWS_EVENT,
  handler_AddNewsEvent );
 
  systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
  handler_NewsLoadedEvent );
  getNewsData();
 
  trace(onInit);
 
  }
 
  To:
 
  private function onInit( event:Event ):void
  {
  //setup event listeners
  /*systemManager is where event listener hangs
  out defines the
  relationship between event and handler*/
 
  systemManager.addEventListener(
  GetNewsEvent.GET_NEWS_EVENT,
  handler_GetNewsEvent );
  systemManager.addEventListener(
  AddNewsEvent.ADD_NEWS_EVENT,
  handler_AddNewsEvent );
 
  systemManager.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,
  handler_NewsLoadedEvent );
  //getNewsData();
  //dispatchEvent(new
  GetNewsEvent(GetNewsEvent.GET_NEWS_EVENT));
 
  // Set a timer since the below function does not
  seem to get fired.
  var myTimer:Timer = new Timer(1, 1);
  myTimer.addEventListener(timer, 

Re: [flexcoders] custom event not added - almost solved.

2008-05-25 Thread dnk

Yeah this one was a bit of a mind [EMAIL PROTECTED]@!#. Much appreciated.

DNK


On 25-May-08, at 9:26 PM, Josh McDonald wrote:

No probs mate, it was pissing me off not know what the problem was,  
too :)


-J


On Mon, May 26, 2008 at 2:22 PM, dnk [EMAIL PROTECTED] wrote:
Dude, you rule!


Thanks s much!

Dnk


On 25-May-08, at 9:12 PM, Josh McDonald wrote:


And don't forget to add:

import mx.core.Application;

Up the top :)


On Mon, May 26, 2008 at 2:11 PM, Josh McDonald [EMAIL PROTECTED]  
wrote:

Ok mate, here's the problem:


public function FlexbController()
{
//turn the key, start it up
addEventListener( FlexEvent.CREATION_COMPLETE, onInit );
trace(Controller);
}

What you need, is this:


public function FlexbController()
{
//turn the key, start it up
 
Application 
.application.addEventListener( FlexEvent.CREATION_COMPLETE, onInit );

trace(Controller);
}

The reason for this, is the way CREATION_COMPLETE is dispatched -  
which is from the bottom of your display tree upward. It has to be  
this way, because it's dispatched only after all the children of a  
component have already had CREATION_COMPLETE dispatched. So first  
it is dispatched on all instantiated UIComponents that don't have  
any children. Then (probably on the next frame, but ask Alex) it's  
dispatched on their container components, and so on and so forth  
until finally (as far as we care) it's dispatched on your root  
Application. It might be then dispatched on a few containers up to  
the systemManager, but again Alex would know better than me.


Now what happens in your case, CREATION_COMPLETE is dispatched on  
your FlexbController, and then you're dispatching the  
GET_NEWS_EVENT immediately. But, the current instance of  
FlexbController is not yet part of the displayTree, because it  
hasn't been completely added to the Application's children yet. So  
the event has nowhere to bubble to - and never reaches the  
Application, or the SystemManager.


But, if you defer onInit() until CREATION_COMPLETE is dispatched on  
the Application itself, you know that the display tree is complete  
(in its initial layout at least), and you can safely dispatch the  
event and have it bubble all the way to the top of the tree at  
SystemManager.


-J

On Mon, May 26, 2008 at 1:35 PM, dnk [EMAIL PROTECTED]  
wrote:

Yeah that is what I thought.

my onInit is called in my constructor  with:

addEventListener( FlexEvent.CREATION_COMPLETE, onInit );


The requests for data are usually called after other adding of the
events, but within the same function  (onInit).

I think I will just ad my addEventListener calls direct in my
constructor and see what happens there.

dnk


On 25-May-08, at 2:08 PM, Alex Harui wrote:

 Timers are normally not necessary. You need to have a clear
 understanding of the application lifecycle and its events. I don't
 know
 when your onInit is getting called, but if it is after a request  
for

 data has been sent, that's too late, you need to do it before the
 request.

 -Original Message-
 From: flexcoders@yahoogroups.com  
[mailto:[EMAIL PROTECTED]

 On
 Behalf Of dnk
 Sent: Sunday, May 25, 2008 11:40 AM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] custom event not added - almost solved.

 Ok, I might be onto something here I added trace statements  
in all

 handlers and contructors, etc

 And the order my traces come back are:

 Controller
 getNewsData
 onInit

 The order my traces SHOULD come back are:

 Controller
 onInit
 getNewsData

 Since my event listeners are setup in my onInit, and if they are  
being

 added after my initial dispatchEvent is sent... well obviously they
 will not be called.

 So as a test I changed my onInt from:

 private function onInit( event:Event ):void
 {
 //setup event listeners
 /*systemManager is where event listener hangs
 out defines the
 relationship between event and handler*/

 systemManager.addEventListener(
 GetNewsEvent.GET_NEWS_EVENT,
 handler_GetNewsEvent );
 systemManager.addEventListener(
 AddNewsEvent.ADD_NEWS_EVENT,
 handler_AddNewsEvent );

  
systemManager 
.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,

 handler_NewsLoadedEvent );
 getNewsData();

 trace(onInit);

 }

 To:

 private function onInit( event:Event ):void
 {
 //setup event listeners
 /*systemManager is where event listener hangs
 out defines the
 relationship between event and handler*/

 systemManager.addEventListener(
 GetNewsEvent.GET_NEWS_EVENT,
 handler_GetNewsEvent );
 systemManager.addEventListener(
 AddNewsEvent.ADD_NEWS_EVENT,
 handler_AddNewsEvent );

  
systemManager 
.addEventListener( NewsDataLoadedEvent.NEWS_LOADED_EVENT,

 handler_NewsLoadedEvent );
 //getNewsData();
 //dispatchEvent(new
 GetNewsEvent(GetNewsEvent.GET_NEWS_EVENT));

 // Set a timer since the below function does not
 seem to get fired.
 var 

RE: [flexcoders] Data Grid issue

2008-05-25 Thread jitendra jain
Thanks Alex.

Finally I got it . What i did is itemEditBegining event set the 
dataGridEvent variable in the mxml component. Whenever i goes to the submit 
button i manually calls the itemEditEvent with an argument that is set with the 
help of itemEditBegining.This way i restrict the user for entering invalid data 
while pressing the submit button. I wonder itemEditEnd should fire 
automatically when user clicks on submit button.

Alex Harui [EMAIL PROTECTED] wrote:   
  No, I haven’t.  What happened when you tried it?
   
  
-
  
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
jitendra jain
 Sent: Friday, May 23, 2008 3:52 AM
 To: flex group flex
 Subject: [flexcoders] Data Grid issue
  
   
Hi Alex,
 
 I read your blog : 
 http://blogs.adobe.com/aharui/2008/03/datagrid_doubleclick_to_edit.html
Have u tried dispatching an itemEditEnd event with different 
DataGridEventReasons for submit and cancel ? Please let me know as iam facing 
the same problem. 
  
  Thanks in advance.
 
 
 
 
 Thanks,
 
 with Regards,
 Jitendra Jain
 Software Engineer
 91-9979960798

  
  
 


 
   


Thanks,

with Regards,
Jitendra Jain
Software Engineer
91-9979960798