Re: [flexcoders] Re: Flex alternatives

2012-01-13 Thread Richard Rodseth
I very much enjoyed my time as a Flex developer, and wish the Apache
project well. Some of the criticism of Adobe seems misplaced. The writing
was on the wall when the most popular mobile platform (iOS) didn't allow
browser plug-ins. I'm not painting Apple as a villain either. It's just
business.

Though Phonegap looks nice, AIR still seems pretty compelling for
cross-platform mobile *app* development. It will be interesting to watch
the level of investment in AIR (it is, after all, used by Adobe apps). Now
that browser plug-ins are unpopular/impossible, and captive runtime is the
way to go, it seems to me Adobe could open-source the AIR runtime, while
still retaining control of the Flash Player browser plug-in. Wouldn't that
further energize the Apache Flex project? The prospect of a cross-platform
mobile app framework with the side-benefit of running on
still-ubiquitous-on-desktop Flash Player?

Aside: Remember OpenLaszlo?

On Fri, Jan 13, 2012 at 6:28 AM, michael_reg...@dell.com wrote:

 **


 You bring up some good points.  I have been on a few calls between our
 company and with Adobe on this exact subject right after the announcements
 were made.  We grilled them with questions, and though I won’t fully
 disclose many of their answers here, our development teams were confident
 enough to stick with Adobe Flex.  We realize that long-term, technologies
 shift.  I started out as a C++ developer doing low-level SCSI.  Now doing
 UIs in Flex.  In 5 years will I be doing HTML 5, ZK, Silverlight, some
 other new technology?  Who knows.  But for now, I’m actually excited to
 have a greater role in the direction Flex takes for now, and welcome any
 challenges making it Open Source may bring.  

 ** **

 The product we developed using Adobe Flex was ranked as one of the top 15
 products for 2011 by CRN.  Didn’t see any HTML 5 apps there.  I think this
 says something about where Flex is, and it still holds some ground.  The
 technology decision should be based on your projects, your long-term
 direction, and your talent pool.  I’d recommend not jumping ship, just to
 jump ship.  You never know where that ship may sail!

 ** **

 *Michael J. Regert***

 ** **

 *From:* flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] *On
 Behalf Of *Ron G
 *Sent:* Thursday, January 12, 2012 11:39 AM

 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Re: Flex alternatives

 ** **

   

 Hi James,


 I certainly respect the decision of those who are sticking with Flex, but
 I would suggest that developers do so with the recognition that they may be
 developing with a technology that isn't going to be around that long.

 I could write at length about this, but, in a nutshell, here's why. On the
 one hand, you have an open-source project that is geared toward enterprise
 application development, but it is completely dependent on a proprietary
 runtime. That runtime is manufactured by a company who has stated its
 future is digital media and digital marketing, and that it believes the
 future of enterprise web application development is HTML5. It then begs the
 question, How long will they bloat their Flashplayer to support an
 open-source Flex community's enterprise web application development goals
 and wishes?

 To accommodate the Flex community, Adobe gets nothing in return for its
 expenditure of time and money in designing, developing, testing the
 features the Flex community requires now and in the future. It also means
 that, by supporting Flex in their runtime, the Flashplayer has an
 unnecessarily larger footprint than would otherwise be required.

 So, ask yourself if you truly believe Flex will be a supported product by
 Adobe in 5-10 years from now. I highly doubt it.

 On the other hand, I think if a developer uses Flash Pro to develop
 digital media for their applications, they can probably count on that being
 around indefinitely. But, not Flex.

 Ron

 --- In flexcoders@yahoogroups.com, James Ong yanlilei64@... wrote:
 
  Using ZK and Java is great. I'm still sticking to Flex for developing
  desktop applications and gaming.
  Of course, many will still using it for animations, there is no such
 thing
  as abandon, some developers
  are just over use Flash and end up hurting user experience than
 necessary.
 
  When it comes to web application, I stick to PHP but will definitely use
  Flex for mobile, desktop and
  components within the web browser.
 
 
  On Thu, Jan 12, 2012 at 10:16 AM, michael_regert@... wrote:
 
   **
  
  
   Staying with Flex. Not looking elsewhere.
  
   ** **
  
   *Michael*
  
   ** **
  
   *From:* flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com]
 *On
   Behalf Of *Ron G
   *Sent:* Wednesday, January 11, 2012 8:15 PM
   *To:* flexcoders@yahoogroups.com
   *Subject:* [flexcoders] Re: Flex alternatives
  
   ** **
  
   
  
   Yes, we have also abandoned Flex in favor of ZKoss. Since we are
 already a
   Java shop, on the 

Re: [flexcoders] Re: Flex alternatives

2012-01-13 Thread Richard Rodseth
I meant to say prospect of a cross-platform mobile app framework that
doesn't depend on a proprietary runtime

On Fri, Jan 13, 2012 at 9:17 AM, Richard Rodseth rrods...@gmail.com wrote:

 I very much enjoyed my time as a Flex developer, and wish the Apache
 project well. Some of the criticism of Adobe seems misplaced. The writing
 was on the wall when the most popular mobile platform (iOS) didn't allow
 browser plug-ins. I'm not painting Apple as a villain either. It's just
 business.

 Though Phonegap looks nice, AIR still seems pretty compelling for
 cross-platform mobile *app* development. It will be interesting to watch
 the level of investment in AIR (it is, after all, used by Adobe apps). Now
 that browser plug-ins are unpopular/impossible, and captive runtime is the
 way to go, it seems to me Adobe could open-source the AIR runtime, while
 still retaining control of the Flash Player browser plug-in. Wouldn't that
 further energize the Apache Flex project? The prospect of a cross-platform
 mobile app framework with the side-benefit of running on
 still-ubiquitous-on-desktop Flash Player?

 Aside: Remember OpenLaszlo?


 On Fri, Jan 13, 2012 at 6:28 AM, michael_reg...@dell.com wrote:

 **


 You bring up some good points.  I have been on a few calls between our
 company and with Adobe on this exact subject right after the announcements
 were made.  We grilled them with questions, and though I won’t fully
 disclose many of their answers here, our development teams were confident
 enough to stick with Adobe Flex.  We realize that long-term, technologies
 shift.  I started out as a C++ developer doing low-level SCSI.  Now doing
 UIs in Flex.  In 5 years will I be doing HTML 5, ZK, Silverlight, some
 other new technology?  Who knows.  But for now, I’m actually excited to
 have a greater role in the direction Flex takes for now, and welcome any
 challenges making it Open Source may bring.  

 ** **

 The product we developed using Adobe Flex was ranked as one of the top 15
 products for 2011 by CRN.  Didn’t see any HTML 5 apps there.  I think this
 says something about where Flex is, and it still holds some ground.  The
 technology decision should be based on your projects, your long-term
 direction, and your talent pool.  I’d recommend not jumping ship, just to
 jump ship.  You never know where that ship may sail!

 ** **

 *Michael J. Regert***

 ** **

 *From:* flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] *On
 Behalf Of *Ron G
 *Sent:* Thursday, January 12, 2012 11:39 AM

 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Re: Flex alternatives

 ** **

   

 Hi James,


 I certainly respect the decision of those who are sticking with Flex, but
 I would suggest that developers do so with the recognition that they may be
 developing with a technology that isn't going to be around that long.

 I could write at length about this, but, in a nutshell, here's why. On
 the one hand, you have an open-source project that is geared toward
 enterprise application development, but it is completely dependent on a
 proprietary runtime. That runtime is manufactured by a company who has
 stated its future is digital media and digital marketing, and that it
 believes the future of enterprise web application development is HTML5. It
 then begs the question, How long will they bloat their Flashplayer to
 support an open-source Flex community's enterprise web application
 development goals and wishes?

 To accommodate the Flex community, Adobe gets nothing in return for its
 expenditure of time and money in designing, developing, testing the
 features the Flex community requires now and in the future. It also means
 that, by supporting Flex in their runtime, the Flashplayer has an
 unnecessarily larger footprint than would otherwise be required.

 So, ask yourself if you truly believe Flex will be a supported product by
 Adobe in 5-10 years from now. I highly doubt it.

 On the other hand, I think if a developer uses Flash Pro to develop
 digital media for their applications, they can probably count on that being
 around indefinitely. But, not Flex.

 Ron

 --- In flexcoders@yahoogroups.com, James Ong yanlilei64@... wrote:
 
  Using ZK and Java is great. I'm still sticking to Flex for developing
  desktop applications and gaming.
  Of course, many will still using it for animations, there is no such
 thing
  as abandon, some developers
  are just over use Flash and end up hurting user experience than
 necessary.
 
  When it comes to web application, I stick to PHP but will definitely use
  Flex for mobile, desktop and
  components within the web browser.
 
 
  On Thu, Jan 12, 2012 at 10:16 AM, michael_regert@... wrote:
 
   **
  
  
   Staying with Flex. Not looking elsewhere.
  
   ** **
  
   *Michael*
  
   ** **
  
   *From:* flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com]
 *On
   Behalf Of *Ron G
   *Sent:* Wednesday, January 11, 2012 8:15 PM

Re: [flexcoders] Re: Flex alternatives

2012-01-13 Thread Richard Rodseth
Apache FlashKit !

On Fri, Jan 13, 2012 at 11:17 AM, Alex Harui aha...@adobe.com wrote:

 **


 Open-sourcing AIR would be an awesome thing, but the Apache project has to
 assume it won’t happen.



 On 1/13/12 9:19 AM, Richard Rodseth rrods...@gmail.com wrote:






 I meant to say prospect of a cross-platform mobile app framework that
 doesn't depend on a proprietary runtime

 On Fri, Jan 13, 2012 at 9:17 AM, Richard Rodseth rrods...@gmail.com
 wrote:

 I very much enjoyed my time as a Flex developer, and wish the Apache
 project well. Some of the criticism of Adobe seems misplaced. The writing
 was on the wall when the most popular mobile platform (iOS) didn't allow
 browser plug-ins. I'm not painting Apple as a villain either. It's just
 business.

 Though Phonegap looks nice, AIR still seems pretty compelling for
 cross-platform mobile *app* development. It will be interesting to watch
 the level of investment in AIR (it is, after all, used by Adobe apps). Now
 that browser plug-ins are unpopular/impossible, and captive runtime is the
 way to go, it seems to me Adobe could open-source the AIR runtime, while
 still retaining control of the Flash Player browser plug-in. Wouldn't that
 further energize the Apache Flex project? The prospect of a cross-platform
 mobile app framework with the side-benefit of running on
 still-ubiquitous-on-desktop Flash Player?

 Aside: Remember OpenLaszlo?


 On Fri, Jan 13, 2012 at 6:28 AM,  michael_reg...@dell.com wrote:






 You bring up some good points.  I have been on a few calls between our
 company and with Adobe on this exact subject right after the announcements
 were made.  We grilled them with questions, and though I won’t fully
 disclose many of their answers here, our development teams were confident
 enough to stick with Adobe Flex.  We realize that long-term, technologies
 shift.  I started out as a C++ developer doing low-level SCSI.  Now doing
 UIs in Flex.  In 5 years will I be doing HTML 5, ZK, Silverlight, some
 other new technology?  Who knows.  But for now, I’m actually excited to
 have a greater role in the direction Flex takes for now, and welcome any
 challenges making it Open Source may bring.

 The product we developed using Adobe Flex was ranked as one of the top 15
 products for 2011 by CRN.  Didn’t see any HTML 5 apps there.  I think this
 says something about where Flex is, and it still holds some ground.  The
 technology decision should be based on your projects, your long-term
 direction, and your talent pool.  I’d recommend not jumping ship, just to
 jump ship.  You never know where that ship may sail!


 *Michael J. Regert
 *

 *From:* flexcoders@yahoogroups.com 
 [mailto:flexcoders@yahoogroups.comflexcoders@yahoogroups.com]
 *On Behalf Of *Ron G
 *Sent:* Thursday, January 12, 2012 11:39 AM

 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Re: Flex alternatives



 Hi James,



 I certainly respect the decision of those who are sticking with Flex, but
 I would suggest that developers do so with the recognition that they may be
 developing with a technology that isn't going to be around that long.

 I could write at length about this, but, in a nutshell, here's why. On the
 one hand, you have an open-source project that is geared toward enterprise
 application development, but it is completely dependent on a proprietary
 runtime. That runtime is manufactured by a company who has stated its
 future is digital media and digital marketing, and that it believes the
 future of enterprise web application development is HTML5. It then begs the
 question, How long will they bloat their Flashplayer to support an
 open-source Flex community's enterprise web application development goals
 and wishes?

 To accommodate the Flex community, Adobe gets nothing in return for its
 expenditure of time and money in designing, developing, testing the
 features the Flex community requires now and in the future. It also means
 that, by supporting Flex in their runtime, the Flashplayer has an
 unnecessarily larger footprint than would otherwise be required.

 So, ask yourself if you truly believe Flex will be a supported product by
 Adobe in 5-10 years from now. I highly doubt it.

 On the other hand, I think if a developer uses Flash Pro to develop
 digital media for their applications, they can probably count on that being
 around indefinitely. But, not Flex.

 Ron

 --- In flexcoders@yahoogroups.com 
 mailto:flexcoders%40yahoogroups.comflexcoders%40yahoogroups.com
 , James Ong yanlilei64@... wrote:
 
  Using ZK and Java is great. I'm still sticking to Flex for developing
  desktop applications and gaming.
  Of course, many will still using it for animations, there is no such
 thing
  as abandon, some developers
  are just over use Flash and end up hurting user experience than
 necessary.
 
  When it comes to web application, I stick to PHP but will definitely use
  Flex for mobile, desktop and
  components within the web browser.
 
 
  On Thu

[flexcoders] Reading barcodes

2011-09-27 Thread Richard Rodseth
Can anyone recommend a good strategy for reading barcodes on an AIR 3 mobile
app?

The as3 port of the zxing library does not appear to have been updated since
2009, but may work well, for all I know.
But it occurs to me, that this could also be a good opportunity for a native
extension.

Any experiences or thoughts?


Re: [flexcoders] Reading barcodes

2011-09-27 Thread Richard Rodseth
Yes, I clearly don't want to do this from scratch, hence the question.

Any particular library you recommend? Any in AS3?

On Tue, Sep 27, 2011 at 9:43 AM, James Ong yanlile...@gmail.com wrote:

 **


 use ready made libraries from Sourceforge and you can get start faster.


 On Wed, Sep 28, 2011 at 12:37 AM, Richard Rodseth rrods...@gmail.comwrote:

 **


 Can anyone recommend a good strategy for reading barcodes on an AIR 3
 mobile app?

 The as3 port of the zxing library does not appear to have been updated
 since 2009, but may work well, for all I know.
 But it occurs to me, that this could also be a good opportunity for a
 native extension.

 Any experiences or thoughts?


  



Re: [flexcoders] Flex 3.5 to 4.1

2010-10-12 Thread Richard Rodseth
So far I have compatibility mode turned on and the Halo theme added. Working
through the errors.

The latest is that I get a null pointer exception in HaloBorder

Main Thread (Suspended: TypeError: Error #1009: Cannot access a property or
method of a null object reference.)
mx.skins.halo::HaloBorder/get borderMetrics
mx.core::Container/get borderMetrics
mx.core::Container/get viewMetrics
mx.core::Container/get viewMetricsAndPadding
mx.containers.utilityClasses::BoxLayout/
http://www.adobe.com/2006/flex/mx/internal::widthPadding
mx.containers.utilityClasses::BoxLayout/measure
mx.containers::Box/measure
mx.core::UIComponent/measureSizes
mx.core::UIComponent/validateSize
mx.core::Container/validateSize
mx.managers::LayoutManager/validateSize
mx.managers::LayoutManager/doPhasedInstantiation
mx.managers::LayoutManager/doPhasedInstantiationCallback

This related question did not appear to get a response on the forums:

http://forums.adobe.com/message/3149760

Thanks for any tips.

On Mon, Oct 11, 2010 at 3:25 PM, Glenn Williams gl...@tinylion.co.ukwrote:


  [Attachment(s) #12b9d6686db7c478_TopText from Glenn Williams included
 below]

 hi



 I found it a simple process on a fairly large project we were working on.



 to just get it to  compile you shouldn’t have any problems



 to then start adding spark.



 first change the application tag. mx: s: application



 that’s when the fun starts.



 the one thing I found useful to get your mx components looking how you
 expect, is to manually include the original halo css file. you can then use
 spark theme but still have any css of styling you’ve done on your mx
 components still work as you’d expect.



 I was about to start writing a list of ‘look outs’ but thought I’d have a
 look at your link first. it’s all in there, looks like a very good start
 anyway.



 our project was about 2500 source files and I think in total it was maybe a
 couple of days to have a spark application but, with all mx components and
 looking just like it was before the change. then it was just a matter of
 starting to replace some things.



 note. we did this as a test, the project was already complete and we used
 it to learn about the change from mx to s. it was quite simple (apart from
 needing to include the halo css default file by hand which caught us out.
 styles just weren’t doing what we expected, and as soon as we added the
 default.css from the halo directory all was well.



 One thing I will say – do it. Spark is in every way better.



 and once you have the luxury of starting a new project from scratch with
 the new spark architecture you’ll wonder how you ever managed without it.
 It’s a huge step forward in my opinion.



 it really is time to put flex 3 away and start enjoying the new framework.
 It’s wonderful to work with, and in all our tests just generally faster and
 more stable and uses less memory. In comparing the two there isn’t anything
 I miss about flex 3 when using flex 4. it’s worth the effort (well what
 little effort the change actually needs)





 if you have any trouble please feel free to email me off forum and we’ll
 help all we can.



 all the best



 glenn





 tiny*lion* development  design





 *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
 Behalf Of *Richard Rodseth
 *Sent:* Monday, October 11, 2010 10:09 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Flex 3.5 to 4.1





 Can anyone give me a sense for how big an effort it is to port from Flex
 3.6 to Flex 4 SDK, without (at first) taking advantage of any of the new
 features. In other words, just getting everything compiling and running as
 well as it did before, Halo components only.

 This recent article is helpful, but I'd like some more experience reports.

 http://www.adobe.com/devnet/flex/articles/flex3_to_flex4_transitioning.html

 Thanks

  

image001.jpg

[flexcoders] No openItems property on ADG?

2010-09-08 Thread Richard Rodseth
Just when I had it working so nicely on Tree, bound to a presentation model.

Is there anything equivalent for an ADG with a hierarchical data provider.


[flexcoders] Module-friendly modals

2010-09-07 Thread Richard Rodseth
Someone on the Mate forums advocated a way to treat a modal popup as a
state of a view, where the presentation model has a modalShown
property, and the view observes it using bindSetter.

This has the nice effect of avoiding the need to pass in
Application.application to createPopUp, but it's obviously quite a bit
more work to create the bubbling events and injections. And in the end
you typically want to center the popup over the whole application,
rather than some intermediate container.

So I find myself wondering if there is a cleaner way than
Application.application to refer to the root context. Follow the
DisplayObject.parent chain until it's null?


Re: [flexcoders] Tree - itemClose and change

2010-09-03 Thread Richard Rodseth
I was able to work around this issue by accessing selectedItem and updating
my presentation model during the itemClose operation.

But to answer your question, it looks like I get two valueCommits when
closing a node.

On Thu, Sep 2, 2010 at 10:58 PM, Alex Harui aha...@adobe.com wrote:



 I thought there was already a bug on that.  Do you get a valueCommit?



 On 9/2/10 4:23 PM, Richard Rodseth rrods...@gmail.com wrote:






 It appears that when you close a node in a tree control, the selection (of
 a contained node) is lost, but no change event is fired.

 Does this sound like a bug?

 I'm trying to restore tree state (selection and open nodes) across a
 service call. I've got the open nodes working pretty well and the refresh
 use case also mostly works (I store the selection as guids from the objects
 in question and find them again after the refresh). But it seems I will have
 to handle openItem and closeItem, and clear the guid-based selection if the
 node is contained in the path being closed.







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



Re: [flexcoders] Tree - itemClose and change

2010-09-03 Thread Richard Rodseth
Thanks. I'll consider using valueCommit in this case. I'd only used it in
the context of things like text fields before.

On Fri, Sep 3, 2010 at 1:06 PM, Alex Harui aha...@adobe.com wrote:



 ValueCommit is supposedly for “any changes to selection”, the change event
 is supposedly only for user-initiated changes to selection.  The binding
 system listens to both.  The change of selection on close is currently seen
 as programmatic since the user didn’t directly do it, but I think there is
 already a bug that argues that change should fire as well.



 On 9/3/10 11:12 AM, Richard Rodseth rrods...@gmail.com wrote:






 I was able to work around this issue by accessing selectedItem and updating
 my presentation model during the itemClose operation.

 But to answer your question, it looks like I get two valueCommits when
 closing a node.

 On Thu, Sep 2, 2010 at 10:58 PM, Alex Harui aha...@adobe.com wrote:






 I thought there was already a bug on that.  Do you get a valueCommit?



 On 9/2/10 4:23 PM, Richard Rodseth rrods...@gmail.com 
 http://rrods...@gmail.com  wrote:






 It appears that when you close a node in a tree control, the selection (of
 a contained node) is lost, but no change event is fired.

 Does this sound like a bug?

 I'm trying to restore tree state (selection and open nodes) across a
 service call. I've got the open nodes working pretty well and the refresh
 use case also mostly works (I store the selection as guids from the objects
 in question and find them again after the refresh). But it seems I will have
 to handle openItem and closeItem, and clear the guid-based selection if the
 node is contained in the path being closed.







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



[flexcoders] Tree - itemClose and change

2010-09-02 Thread Richard Rodseth
It appears that when you close a node in a tree control, the selection (of a
contained node) is lost, but no change event is fired.

Does this sound like a bug?

I'm trying to restore tree state (selection and open nodes) across a service
call. I've got the open nodes working pretty well and the refresh use case
also mostly works (I store the selection as guids from the objects in
question and find them again after the refresh). But it seems I will have to
handle openItem and closeItem, and clear the guid-based selection if the
node is contained in the path being closed.


[flexcoders] Flex 3.5 - 4 upgrade risk

2010-08-20 Thread Richard Rodseth
My colleagues in QA are having better results with Selenium + FlexMonkium
than with FlexMonkey + 3.5.
But FlexMonkium apparently only supports Flex 4.

I have been cautious/wary about proposing an upgrade to Flex 4 at this time,
particularly since I encountered a ComboBox bug introduced in 3.5 when I
upgraded to get fixes for charting bugs in 3.4. But a solid automation story
would be quite compelling.

So I guess I'm looking for reassurance, and also wondering a few things.

Is there some bug fix in automation libraries that makes it more robust even
if you're using Halo components?
What's compatibility mode and why would I use it?

Thanks.


[flexcoders] Image artifact

2010-08-19 Thread Richard Rodseth
I'm trying to do a HDividedBox where one of the segments is collapsible. But
in the open state, an artifact of the expand icon image appears at top left
even though its container is invisible in that state, and it's normal
position is halfway down the screen.
Code is something like the following.
Note that the expand icon is outside the HDvidedBox, and the collapse icon
is inside.
Any ideas?

mx:HBox width=100% height=100% borderStyle=solid

mx:VBox  visible={!(model.navigatorShown)}}
includeInLayout={!(model.navigatorShown)} height=100% 
mx:Spacer height=100%/
mx:Image id=leftGrip

  width=16 height=16
click=leftGrip_clickHandler(event)
source=@Embed('/assets/images/icon_open_right.png')/

mx:Spacer height=100%/
/mx:VBox

mx:HDividedBox id=dividedBox width=100% height=100%

mx:VBox width=200 height=100%
visible={model.navigatorShown} includeInLayout={model.navigatorShown}

!-- navigator plus collapse icon --
mx:HBox width=100% height=100% 

mx:VBox width=100% height=100% borderStyle=solid

mx:Label text=Navigator/

/mx:VBox

mx:VBox  visible={model.navigatorShown}}
includeInLayout={model.navigatorShown} height=100% 
mx:Spacer height=100%/
mx:Image id=rightGrip width=16 height=16
click=rightGrip_clickHandler(event)
source=@Embed('/assets/images/icon_close_left.png')/
 mx:Spacer height=100%/
/mx:VBox

/mx:HBox

/mx:VBox

mx:VBox width=80% height=100% borderStyle=solid
mx:Label text=RHS/
/mx:VBox

/mx:HDividedBox

/mx:HBox


[flexcoders] ComboBox fiasco

2010-08-03 Thread Richard Rodseth
Back in ComboBox hell, and finally read this:

https://bugs.adobe.com/jira/browse/SDK-25705

I've always had problems with comboboxes and binding, but didn't
realize this particular bug was *introduced* in 3.5, rather than
having been there all along. Of course I updated our application to
use 3.5 because of bad bugs in charting.

I'm glad bug fixes continue in the 3.x branch, but it's absolutely
critical that there are no regressions.
So while I hope 3.6 is imminent, let's hope it's well-tested.

I trust the testing infrastructure and architecture has been improved for 4.x.


Re: [flexcoders] Re: Refresh list with itemRenderer/ComboBox

2010-08-03 Thread Richard Rodseth
The workaround for ComboBox bug

https://bugs.adobe.com/jira/browse/SDK-25705

suggested by Ben Atkins worked for me. In fact, since I didn't have the
resize issues, I reduced it to the following.

I sent a separate nastygram (sorry) about regressions in the 3.x branch.

public class ComboBoxPatched extends ComboBox
{

public function ComboBoxPatched()
{
super();
}

//This addresses the problem where the list base wasn't reflecting
changes to the data provider
override public function set dataProvider(value:Object):void
{
super.dataProvider = value;

if (dropdown) {
dropdown.dataProvider = value;
}
}

}


On Thu, Jul 29, 2010 at 4:25 PM, Richard Rodseth rrods...@gmail.com wrote:

 Yes, that was my plan, but I've since discovered that I misspoke and my
 item renderer has a PopUpButton rather than a ComboBox (sorry!)

 Looking into other possible mistakes in my binding.

 On Thu, Jul 29, 2010 at 3:31 PM, Amy amyblankens...@bellsouth.net wrote:





 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Richard
 Rodseth rrods...@... wrote:
 
  Hmm. I did a diff on the 3.x and 3.5 versions of ComboBase and ComboBox,
 and
  didn't see anything that seemed relevant - just some stuff about
 tweening.

 Richard, have you considered subclassing and just fixing it yourself
 (assuming the part you need to fix isn't private, of course).

 -Amy

  





Re: [flexcoders] Re: Refresh list with itemRenderer/ComboBox

2010-07-29 Thread Richard Rodseth
Yes, that was my plan, but I've since discovered that I misspoke and my item
renderer has a PopUpButton rather than a ComboBox (sorry!)

Looking into other possible mistakes in my binding.

On Thu, Jul 29, 2010 at 3:31 PM, Amy amyblankens...@bellsouth.net wrote:





 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Richard
 Rodseth rrods...@... wrote:
 
  Hmm. I did a diff on the 3.x and 3.5 versions of ComboBase and ComboBox,
 and
  didn't see anything that seemed relevant - just some stuff about
 tweening.

 Richard, have you considered subclassing and just fixing it yourself
 (assuming the part you need to fix isn't private, of course).

 -Amy

  



Re: [flexcoders] Refresh list with itemRenderer/ComboBox

2010-07-28 Thread Richard Rodseth
True - it's given me many headaches.

Any ideas for a workaround? A judiciously-placed callLater ? Some
combination of invalidateXX ?
Even something like this doesn't work:

var source:Array = conditions.source;
conditions.source = [];
conditions.source = source;
conditionList.invalidateList();


On Tue, Jul 27, 2010 at 10:12 PM, Alex Harui aha...@adobe.com wrote:



 Flex 3.5 has some issues with ComboBox updating.



 On 7/27/10 4:22 PM, Richard Rodseth rrods...@gmail.com wrote:






 I have two scenarios where I have to refresh rows of a list or
 datagrid because the contents are computed, and one of the inputs  to
 the computation (some meta-information) has changed.

 In the first (a DataGrid) I just have a labelFunction for one of the
 columns, and calling refresh() on the ArrayCollection in the
 presentation model does the trick.

 The second is more complicated - the list has an inline item renderer
 which is really a mini-editor containing a combo box. I'm struggling
 to get the combobox label to update. Tried calling refresh() on the
 array collection, invalidateList() on the list, and even
 executeBindings() on the list, to no avail. Binding works in all other
 use cases, eg. inserting and deleting items from the list.

 Any special considerations with an inline item renderer or combobox
 when forcing a refresh?

 As an aside, this description from the LiveDocs for executeBindings is
 a bit odd.

 
 Executes the data bindings into this UIComponent object. Workaround
 for MXML container/bindings problem (177074): override
 Container.executeBindings() to prefer descriptor.document over
 parentDocument in the call to BindingManager.executeBindings(). This
 should always provide the correct behavior for instances created by
 descriptor, and will provide the original behavior for
 procedurally-created instances. (The bug may or may not appear in the
 latter case.) A more complete fix, guaranteeing correct behavior in
 both non-DI and reparented-component scenarios, is anticipated for
 updater 1.
 





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



Re: [flexcoders] Refresh list with itemRenderer/ComboBox

2010-07-28 Thread Richard Rodseth
Good to know. Of course, in the real world, we can't update on a whim, so
any other suggestions are welcome.
I may be able to get the bug deferred.

On Wed, Jul 28, 2010 at 9:58 AM, Alex Harui aha...@adobe.com wrote:



 3.6 is due out soon.  It is fixed in that code base.  I think there may be
 nightly build on the 3.x branch.



 On 7/28/10 9:23 AM, Richard Rodseth rrods...@gmail.com wrote:






 True - it's given me many headaches.

 Any ideas for a workaround? A judiciously-placed callLater ? Some
 combination of invalidateXX ?
 Even something like this doesn't work:

 var source:Array = conditions.source;
 conditions.source = [];
 conditions.source = source;
 conditionList.invalidateList();


 On Tue, Jul 27, 2010 at 10:12 PM, Alex Harui aha...@adobe.com wrote:






 Flex 3.5 has some issues with ComboBox updating.



 On 7/27/10 4:22 PM, Richard Rodseth rrods...@gmail.com 
 http://rrods...@gmail.com  wrote:






 I have two scenarios where I have to refresh rows of a list or
 datagrid because the contents are computed, and one of the inputs  to
 the computation (some meta-information) has changed.

 In the first (a DataGrid) I just have a labelFunction for one of the
 columns, and calling refresh() on the ArrayCollection in the
 presentation model does the trick.

 The second is more complicated - the list has an inline item renderer
 which is really a mini-editor containing a combo box. I'm struggling
 to get the combobox label to update. Tried calling refresh() on the
 array collection, invalidateList() on the list, and even
 executeBindings() on the list, to no avail. Binding works in all other
 use cases, eg. inserting and deleting items from the list.

 Any special considerations with an inline item renderer or combobox
 when forcing a refresh?

 As an aside, this description from the LiveDocs for executeBindings is
 a bit odd.

 
 Executes the data bindings into this UIComponent object. Workaround
 for MXML container/bindings problem (177074): override
 Container.executeBindings() to prefer descriptor.document over
 parentDocument in the call to BindingManager.executeBindings(). This
 should always provide the correct behavior for instances created by
 descriptor, and will provide the original behavior for
 procedurally-created instances. (The bug may or may not appear in the
 latter case.) A more complete fix, guaranteeing correct behavior in
 both non-DI and reparented-component scenarios, is anticipated for
 updater 1.
 





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



Re: [flexcoders] Refresh list with itemRenderer/ComboBox

2010-07-28 Thread Richard Rodseth
Hmm. I did a diff on the 3.x and 3.5 versions of ComboBase and ComboBox, and
didn't see anything that seemed relevant - just some stuff about tweening.

On Wed, Jul 28, 2010 at 10:09 AM, Richard Rodseth rrods...@gmail.comwrote:

 Good to know. Of course, in the real world, we can't update on a whim, so
 any other suggestions are welcome.
 I may be able to get the bug deferred.


 On Wed, Jul 28, 2010 at 9:58 AM, Alex Harui aha...@adobe.com wrote:



 3.6 is due out soon.  It is fixed in that code base.  I think there may be
 nightly build on the 3.x branch.



 On 7/28/10 9:23 AM, Richard Rodseth rrods...@gmail.com wrote:






 True - it's given me many headaches.

 Any ideas for a workaround? A judiciously-placed callLater ? Some
 combination of invalidateXX ?
 Even something like this doesn't work:

 var source:Array = conditions.source;
 conditions.source = [];
 conditions.source = source;
 conditionList.invalidateList();


 On Tue, Jul 27, 2010 at 10:12 PM, Alex Harui aha...@adobe.com wrote:






 Flex 3.5 has some issues with ComboBox updating.



 On 7/27/10 4:22 PM, Richard Rodseth rrods...@gmail.com 
 http://rrods...@gmail.com  wrote:






 I have two scenarios where I have to refresh rows of a list or
 datagrid because the contents are computed, and one of the inputs  to
 the computation (some meta-information) has changed.

 In the first (a DataGrid) I just have a labelFunction for one of the
 columns, and calling refresh() on the ArrayCollection in the
 presentation model does the trick.

 The second is more complicated - the list has an inline item renderer
 which is really a mini-editor containing a combo box. I'm struggling
 to get the combobox label to update. Tried calling refresh() on the
 array collection, invalidateList() on the list, and even
 executeBindings() on the list, to no avail. Binding works in all other
 use cases, eg. inserting and deleting items from the list.

 Any special considerations with an inline item renderer or combobox
 when forcing a refresh?

 As an aside, this description from the LiveDocs for executeBindings is
 a bit odd.

 
 Executes the data bindings into this UIComponent object. Workaround
 for MXML container/bindings problem (177074): override
 Container.executeBindings() to prefer descriptor.document over
 parentDocument in the call to BindingManager.executeBindings(). This
 should always provide the correct behavior for instances created by
 descriptor, and will provide the original behavior for
 procedurally-created instances. (The bug may or may not appear in the
 latter case.) A more complete fix, guaranteeing correct behavior in
 both non-DI and reparented-component scenarios, is anticipated for
 updater 1.
 





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





Re: [flexcoders] Tree click vs change

2010-07-28 Thread Richard Rodseth
Thanks. This worked well.

On Fri, Jul 2, 2010 at 2:43 PM, Alex Harui aha...@adobe.com wrote:



 Add a high priority mouseDown handler and record the selectedIndex then.



 On 7/2/10 2:34 PM, Richard Rodseth rrods...@gmail.com wrote:






 We have a datagrid that gets updated when the user clicks a node in a tree
 (or moves through it using arrow keys).
 We're handling the change event in the tree to issue the update request.
 A request has come in that clicking an already selected node should do a
 refresh.

 We tried having both change and click handlers, where the click handler
 would check if the selection was unchanged. But that didn't work because the
 change event fires first so the selection reported a click time is always
 the same.

 Any suggestions?





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



[flexcoders] Refresh list with itemRenderer/ComboBox

2010-07-27 Thread Richard Rodseth
I have two scenarios where I have to refresh rows of a list or
datagrid because the contents are computed, and one of the inputs  to
the computation (some meta-information) has changed.

In the first (a DataGrid) I just have a labelFunction for one of the
columns, and calling refresh() on the ArrayCollection in the
presentation model does the trick.

The second is more complicated - the list has an inline item renderer
which is really a mini-editor containing a combo box. I'm struggling
to get the combobox label to update. Tried calling refresh() on the
array collection, invalidateList() on the list, and even
executeBindings() on the list, to no avail. Binding works in all other
use cases, eg. inserting and deleting items from the list.

Any special considerations with an inline item renderer or combobox
when forcing a refresh?

As an aside, this description from the LiveDocs for executeBindings is
a bit odd.


Executes the data bindings into this UIComponent object. Workaround
for MXML container/bindings problem (177074): override
Container.executeBindings() to prefer descriptor.document over
parentDocument in the call to BindingManager.executeBindings(). This
should always provide the correct behavior for instances created by
descriptor, and will provide the original behavior for
procedurally-created instances. (The bug may or may not appear in the
latter case.) A more complete fix, guaranteeing correct behavior in
both non-DI and reparented-component scenarios, is anticipated for
updater 1.



Re: [flexcoders] Refresh list with itemRenderer/ComboBox

2010-07-27 Thread Richard Rodseth
I'm not re-populating the array. Imagine it's a list of employees, and one
of the properties is a job id. When displaying the list, the job title is
looked up (eg. by a labelFunction on a DataGridColumn). Now, imagine the job
title is edited elsewhere in the application. When we detect this (eg. via a
listener) we can just call refresh() on the employee array, and the
itemrenderers will run again.

The second scenario I alluded to would be something like having a combobox
in the grid cell for changing the job type. Once again the job title needs
to be re-displayed if it is changed elsewhere, but in this case it is the
dynamically-computed label of the combobox.



On Tue, Jul 27, 2010 at 6:21 PM, Amanda Machutta amachu...@gmail.comwrote:



 Hi Richard,

 How are you refreshing the ArrayCollection? If you are doing something like
 this:

 oldArr = newArry;

 then its not going to work because of the way binding works. If you haven't
 done it already, try this:

 oldArr.removeAll();

 for(var i:int=0; inewArr.length; i++){
   oldArr.addItem(newArr.getItemAt(i));
 }

 Good luck!
 Amanda

 On Tue, Jul 27, 2010 at 7:22 PM, Richard Rodseth rrods...@gmail.comwrote:



 I have two scenarios where I have to refresh rows of a list or
 datagrid because the contents are computed, and one of the inputs to
 the computation (some meta-information) has changed.

 In the first (a DataGrid) I just have a labelFunction for one of the
 columns, and calling refresh() on the ArrayCollection in the
 presentation model does the trick.

 The second is more complicated - the list has an inline item renderer
 which is really a mini-editor containing a combo box. I'm struggling
 to get the combobox label to update. Tried calling refresh() on the
 array collection, invalidateList() on the list, and even
 executeBindings() on the list, to no avail. Binding works in all other
 use cases, eg. inserting and deleting items from the list.

 Any special considerations with an inline item renderer or combobox
 when forcing a refresh?

 As an aside, this description from the LiveDocs for executeBindings is
 a bit odd.

 
 Executes the data bindings into this UIComponent object. Workaround
 for MXML container/bindings problem (177074): override
 Container.executeBindings() to prefer descriptor.document over
 parentDocument in the call to BindingManager.executeBindings(). This
 should always provide the correct behavior for instances created by
 descriptor, and will provide the original behavior for
 procedurally-created instances. (The bug may or may not appear in the
 latter case.) A more complete fix, guaranteeing correct behavior in
 both non-DI and reparented-component scenarios, is anticipated for
 updater 1.
 




 --
 ´¨)   __o
   .·´  .·´¨)¸.·´¨)  _'\ .
 (¸.·´ (¸.·´ (¸.·´¨¨  Amanda ¨¨( * )  (   )
  



Re: [flexcoders] Value Object --- Object Proxy --- huh???

2010-07-24 Thread Richard Rodseth
Not sure it's worth the trouble, but did you have some particular technique
in mind?

I think I might have asked about this before, but if MXML had a way to do
constructor injection it could also help frameworks like Mate so they don't
need tags with attributes called arguments.

On Fri, Jul 23, 2010 at 3:46 PM, Alex Harui aha...@adobe.com wrote:



 You could write your set functions to be write-once.



 On 7/23/10 11:35 AM, Richard Rodseth rrods...@gmail.com wrote:






 Getting a little off-topic, but in case anyone's interested:


 http://www.developer.com/lang/other/article.php/3874551/Clojure-Immutability-at-the-Language-Level.htm

 One Flex-specific wrinkle is that if you define a class with a 1 argument
 constructor and getters only, you can't instantiate it in MXML. And in AS3,
 you can't have mutliple constructors. I'm not sure, but I imagine some of
 the serialization libraries for JSON etc might have issues too if you don't
 have the zero-argument constructor.

 On Fri, Jul 23, 2010 at 11:25 AM, Richard Rodseth rrods...@gmail.com
 wrote:

 Yes, obviously. But not the same thing.


 If you write your VO’s to have only get functions, they are effectively
 immutable.







 On 7/23/10 8:56 AM, Richard Rodseth rrods...@gmail.com 
 http://rrods...@gmail.com  wrote:






 Interesting. I haven't used that one either.

 The docs emphasize the addEventListener capability, which I guess
 distinguishes this from plain old Object, which can also hold arbitrary
 properties.

 http://livedocs.adobe.com/flex/3/langref/mx/utils/ObjectProxy.html

 As an aside, I would love to have language support for designating VOs as
 immutable.

 On Thu, Jul 22, 2010 at 6:11 PM, Alex Harui aha...@adobe.com 
 http://aha...@adobe.com  wrote:






 ObjectProxy is a generic VO.  It is dynamic and can hold any properties and
 values.  And it is slow.  Best to create custom Vos that are strongly typed.



 On 7/22/10 2:52 PM, mark.embrey mark.c.emb...@gmail.com 
 http://mark.c.emb...@gmail.com  http://mark.c.emb...@gmail.com  wrote:






 I'm trying to wrap my feeble brain around these concepts.

 Are they the same? -similar? -completely different?

 Your feedback will be appreciated by this greenhorn.

 Mark






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



Re: [flexcoders] Value Object --- Object Proxy --- huh???

2010-07-23 Thread Richard Rodseth
Interesting. I haven't used that one either.

The docs emphasize the addEventListener capability, which I guess
distinguishes this from plain old Object, which can also hold arbitrary
properties.

http://livedocs.adobe.com/flex/3/langref/mx/utils/ObjectProxy.html

As an aside, I would love to have language support for designating VOs as
immutable.

On Thu, Jul 22, 2010 at 6:11 PM, Alex Harui aha...@adobe.com wrote:



 ObjectProxy is a generic VO.  It is dynamic and can hold any properties and
 values.  And it is slow.  Best to create custom Vos that are strongly typed.



 On 7/22/10 2:52 PM, mark.embrey mark.c.emb...@gmail.com wrote:






 I'm trying to wrap my feeble brain around these concepts.

 Are they the same? -similar? -completely different?

 Your feedback will be appreciated by this greenhorn.

 Mark






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



Re: [flexcoders] Value Object --- Object Proxy --- huh???

2010-07-23 Thread Richard Rodseth
Yes, obviously. But not the same thing.


 If you write your VO’s to have only get functions, they are effectively
 immutable.







 On 7/23/10 8:56 AM, Richard Rodseth rrods...@gmail.com wrote:






 Interesting. I haven't used that one either.

 The docs emphasize the addEventListener capability, which I guess
 distinguishes this from plain old Object, which can also hold arbitrary
 properties.

 http://livedocs.adobe.com/flex/3/langref/mx/utils/ObjectProxy.html

 As an aside, I would love to have language support for designating VOs as
 immutable.

 On Thu, Jul 22, 2010 at 6:11 PM, Alex Harui aha...@adobe.com wrote:






 ObjectProxy is a generic VO.  It is dynamic and can hold any properties and
 values.  And it is slow.  Best to create custom Vos that are strongly typed.



 On 7/22/10 2:52 PM, mark.embrey mark.c.emb...@gmail.com 
 http://mark.c.emb...@gmail.com  wrote:






 I'm trying to wrap my feeble brain around these concepts.

 Are they the same? -similar? -completely different?

 Your feedback will be appreciated by this greenhorn.

 Mark






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



Re: [flexcoders] Value Object --- Object Proxy --- huh???

2010-07-23 Thread Richard Rodseth
Getting a little off-topic, but in case anyone's interested:

http://www.developer.com/lang/other/article.php/3874551/Clojure-Immutability-at-the-Language-Level.htm

One Flex-specific wrinkle is that if you define a class with a 1 argument
constructor and getters only, you can't instantiate it in MXML. And in AS3,
you can't have mutliple constructors. I'm not sure, but I imagine some of
the serialization libraries for JSON etc might have issues too if you don't
have the zero-argument constructor.

On Fri, Jul 23, 2010 at 11:25 AM, Richard Rodseth rrods...@gmail.comwrote:

 Yes, obviously. But not the same thing.


 If you write your VO’s to have only get functions, they are effectively
 immutable.







 On 7/23/10 8:56 AM, Richard Rodseth rrods...@gmail.com wrote:






 Interesting. I haven't used that one either.

 The docs emphasize the addEventListener capability, which I guess
 distinguishes this from plain old Object, which can also hold arbitrary
 properties.

 http://livedocs.adobe.com/flex/3/langref/mx/utils/ObjectProxy.html

 As an aside, I would love to have language support for designating VOs as
 immutable.

 On Thu, Jul 22, 2010 at 6:11 PM, Alex Harui aha...@adobe.com wrote:






 ObjectProxy is a generic VO.  It is dynamic and can hold any properties
 and values.  And it is slow.  Best to create custom Vos that are strongly
 typed.



 On 7/22/10 2:52 PM, mark.embrey mark.c.emb...@gmail.com 
 http://mark.c.emb...@gmail.com  wrote:






 I'm trying to wrap my feeble brain around these concepts.

 Are they the same? -similar? -completely different?

 Your feedback will be appreciated by this greenhorn.

 Mark






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





[flexcoders] Button with tooltip but no overskin

2010-07-22 Thread Richard Rodseth
Is there a simple way to set up a button so that it's appearance
doesn't change on rollOver, but the tooltip does appear?

I am simulating a menu bar of sorts using a horizontal layout of
PopUpButtons and Buttons. The Buttons are just filler that need to
follow the style of the others, but have no associated action. But
some have meaningful labels and tooltips.

In other words, I need to create a dead button with the same style
as others, and a tooltip.


[flexcoders] Re: Button with tooltip but no overskin

2010-07-22 Thread Richard Rodseth
I should have noted that this is for Flex 3.

I created a subclass of ButtonSkin which overrides name() to return upSkin.

If anyone has a more elegant solution please let me know.

On Thu, Jul 22, 2010 at 12:35 PM, Richard Rodseth rrods...@gmail.com wrote:
 Is there a simple way to set up a button so that it's appearance
 doesn't change on rollOver, but the tooltip does appear?

 I am simulating a menu bar of sorts using a horizontal layout of
 PopUpButtons and Buttons. The Buttons are just filler that need to
 follow the style of the others, but have no associated action. But
 some have meaningful labels and tooltips.

 In other words, I need to create a dead button with the same style
 as others, and a tooltip.



Re: [flexcoders] Value Object --- Object Proxy --- huh???

2010-07-22 Thread Richard Rodseth
Hi Mark

In the fairly large applications I've worked on, I've not had occasion to
use Proxy, if you mean this:

http://livedocs.adobe.com/flex/3/langref/flash/utils/Proxy.html

Basically it lets you create an object that poses as something else,
possibly supplementing it. For example, in the example given, they create a
ProxyArray which actually derives from Proxy, but (dynamically) implements
the properties, operators and methods of Array, adding sum() and clear()
methods.

Others may disagree, and I'd love to hear of good examples, but I would
actually think twice before using this. You're sacrificing type safety and
possibly performance.

On the other hand, Value Objects (closely related to DTOs [Data Transfer
Objects], and to be contrasted with Entity objects), are bread and butter
things.

http://c2.com/cgi/wiki?ValueObject

Their identity is based on their state rather than on their object
identity. This way, you can have multiple copies of the same conceptual
value object

i.e. two Date instances with the same day, month etc. represent the same
date, whereas

 var employee:Employee

might refer to different Employee instances at different times, in which
case we're talking about different Employees.

In a Flex app, VOs are typically created to represent messages. Your API
(whether AMF, JSON or XML) will return flattened data which is then
converted into an object instance tree structure (not to be confused with a
class inheritance tree, if you're new to OOP).

If you are creating these VO classes yourself (as opposed to using ones
whose source is generated by tools provided by LiveCycle, WebOrb etc) you
should resist the impulse to add business logic to them. They'll typically
have nothing more than a few public properties.

So you might have both an EmployeeVO and an Employee class, where EmployeeVO
is a Value Object or DTO, and Employee is an entity.

Hope this helps. I'm sure others will weigh in.

- Richard
P.S. It's perhaps more appropriate to server-side work, but I love Eric
Evans' book on Domain-Driven-Design
http://domaindrivendesign.org/



On Thu, Jul 22, 2010 at 2:52 PM, mark.embrey mark.c.emb...@gmail.comwrote:



 I'm trying to wrap my feeble brain around these concepts.

 Are they the same? -similar? -completely different?

 Your feedback will be appreciated by this greenhorn.

 Mark

  



[flexcoders] DateTimeAxis labels

2010-07-14 Thread Richard Rodseth
My stakeholders almost always seem to want something for DateTimeAxis labels
that I can't give them out of the box.
Example: I have a weeks worth of data in 15-minute increments, and would
like the labels at 12AM and 12PM. Or if only one per day, at 12PM rather
than 12AM.

But if I set labelUnits to hours, I get one label per day at 12AM.

Anyone discovered any tricks?


Re: [flexcoders] DateTimeAxis labels

2010-07-14 Thread Richard Rodseth
Before embarking on potentially time-consuming or risky customization, we
usually have to weigh other priorities. But thanks, I'll keep that in mind,
and look into it when time permits.

On Wed, Jul 14, 2010 at 3:30 PM, Brendan Meutzner bmeutz...@gmail.comwrote:



 Have you looked at using a custom IAxisRenderer for the series in which you
 limit the labels which are shown?  You would be able see the labels which
 are to be displayed and show/hide them accordingly.  I believe that you'll
 find the setter for gutters has the labels which are added automatically.


 Brendan



 On Wed, Jul 14, 2010 at 4:56 PM, Richard Rodseth rrods...@gmail.comwrote:



 My stakeholders almost always seem to want something for DateTimeAxis
 labels that I can't give them out of the box.
 Example: I have a weeks worth of data in 15-minute increments, and would
 like the labels at 12AM and 12PM. Or if only one per day, at 12PM rather
 than 12AM.

 But if I set labelUnits to hours, I get one label per day at 12AM.

 Anyone discovered any tricks?



  



[flexcoders] Flashbuilder 4.0.1 debugger issue?

2010-07-12 Thread Richard Rodseth
A colleague is experiencing a problem where our app hangs the browser when
run in the debugger, but not when launched in non-debug mode (from
Flashbuilder). He's the only one on the team who started Flex work since the
release of 4.0.1 so I'm wondering if there are any known problems that could
explain this.


[flexcoders] Re: Flashbuilder 4.0.1 debugger issue?

2010-07-12 Thread Richard Rodseth
He's also on Flash Player 10.1 and after deleting shared objects used by our
splash screen, the app is locking up earlier (i.e. before dismissing the
splash screen. Are there some changes I should know about relating to 10.1,
security sandboxes, Shared Objects and the 4.0.1 debugger?

On Mon, Jul 12, 2010 at 2:41 PM, Richard Rodseth rrods...@gmail.com wrote:

 A colleague is experiencing a problem where our app hangs the browser when
 run in the debugger, but not when launched in non-debug mode (from
 Flashbuilder). He's the only one on the team who started Flex work since the
 release of 4.0.1 so I'm wondering if there are any known problems that could
 explain this.





[flexcoders] Flashbuilder hang loading workbench

2010-07-09 Thread Richard Rodseth
This is happening again this morning, and I don't remember how I got past it
before.

Flashbuilder hangs at the start up splash screen (before workspace selection
even) while displaying Loading  workbench. OS X spinning beachball. Must
force quit. Launching with -clean didn't help.

Anyone else?


[flexcoders] Re: Flashbuilder hang loading workbench

2010-07-09 Thread Richard Rodseth
Deleting the .snap file mentioned here did the trick:

http://www.michaellabieniec.com/?p=51

On Fri, Jul 9, 2010 at 10:08 AM, Richard Rodseth rrods...@gmail.com wrote:

 This is happening again this morning, and I don't remember how I got past
 it before.

 Flashbuilder hangs at the start up splash screen (before workspace
 selection even) while displaying Loading  workbench. OS X spinning
 beachball. Must force quit. Launching with -clean didn't help.

 Anyone else?



[flexcoders] DateTimeAxis - day + hour:minute

2010-07-09 Thread Richard Rodseth
I have a Flex 3 LineChart which displays data for one day or one week, in
15-minute increments. In the week version I need the axis labels to include
day name (not specific date) + hour:minute, or perhaps someway to indicate
the day only on the 0:00 hour:minute label.

Thanks for any suggestions.


[flexcoders] Mate: listener injector vs manager/PM binding

2010-07-02 Thread Richard Rodseth
Design question for any other Mate users out there. Will cross-post to Mate
forum.

I use Mate with the Manager + Presentation Model pattern.
i.e. presentation model dispatches bubbling events. Mate event map invokes
services calls, sets result on manager. Properties are injected from manager
to presentation model.

I find it very convenient to have a data status property in the
presentation model for each service call, with values NOT_CURRENT, LOADING,
LOADED and ERROR. Then the view can display appropriate status and progress
indicators based on this property.

One approach (a) is to have the event map set the status on the manager and
have the map inject that status into the presentation model.

Another (b) is to set the status in the presentation model just before
dispatching the event, and when receiving the result (i.e. in a custom
setter).

I like the directness of (b), but it doesn't cover the error case unless the
manager also has something like a faultevent property that also gets
injected into the presentation model.

A third approach (c) would use listener injectors. The map would inject a
listener into the presentation model and would announce a special failure
event.

Thoughts?


[flexcoders] Tree click vs change

2010-07-02 Thread Richard Rodseth
We have a datagrid that gets updated when the user clicks a node in a tree
(or moves through it using arrow keys).
We're handling the change event in the tree to issue the update request.
A request has come in that clicking an already selected node should do a
refresh.

We tried having both change and click handlers, where the click handler
would check if the selection was unchanged. But that didn't work because the
change event fires first so the selection reported a click time is always
the same.

Any suggestions?


Re: [flexcoders] Re: Mate: listener injector vs manager/PM binding

2010-07-02 Thread Richard Rodseth
The map shouldn't interact with the PM (other than building it with
ObjectBuilder and injecting it into the view).
I'm leaning towards a). That way it's centralized and manager properties can
potentially be injected into multiple presentation models.




On Fri, Jul 2, 2010 at 1:56 PM, turbo_vb timh...@aol.com wrote:



 I usually use (b). For the error, you can call a public method in the PM
 from the faultHandler in the map; as one alternative.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Richard
 Rodseth rrods...@... wrote:
 
  Design question for any other Mate users out there. Will cross-post to
 Mate
  forum.
 
  I use Mate with the Manager + Presentation Model pattern.
  i.e. presentation model dispatches bubbling events. Mate event map
 invokes
  services calls, sets result on manager. Properties are injected from
 manager
  to presentation model.
 
  I find it very convenient to have a data status property in the
  presentation model for each service call, with values NOT_CURRENT,
 LOADING,
  LOADED and ERROR. Then the view can display appropriate status and
 progress
  indicators based on this property.
 
  One approach (a) is to have the event map set the status on the manager
 and
  have the map inject that status into the presentation model.
 
  Another (b) is to set the status in the presentation model just before
  dispatching the event, and when receiving the result (i.e. in a custom
  setter).
 
  I like the directness of (b), but it doesn't cover the error case unless
 the
  manager also has something like a faultevent property that also gets
  injected into the presentation model.
 
  A third approach (c) would use listener injectors. The map would inject a
  listener into the presentation model and would announce a special failure
  event.
 
  Thoughts?
 

  



Re: [flexcoders] Re: Mate: listener injector vs manager/PM binding

2010-07-02 Thread Richard Rodseth
Haven't looked at Swiz yet, but as I mentioned, I can certainly announce an
event in the faultHandler and inject a listener for it in the PM.

On Fri, Jul 2, 2010 at 3:36 PM, turbo_vb timh...@aol.com wrote:



 I agree, but it can; since the map knows about the PM anyway. This is where
 Swiz has an advantage with the Mediate metadata. In that case the PM method
 can just listens for an event; which can be dispatched on fault.

 -TH


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Richard
 Rodseth rrods...@... wrote:
 
  The map shouldn't interact with the PM (other than building it with
  ObjectBuilder and injecting it into the view).
  I'm leaning towards a). That way it's centralized and manager properties
 can
  potentially be injected into multiple presentation models.
 
 
 
 
  On Fri, Jul 2, 2010 at 1:56 PM, turbo_vb timh...@... wrote:
 
  
  
   I usually use (b). For the error, you can call a public method in the
 PM
   from the faultHandler in the map; as one alternative.
  
  
   --- In flexcoders@yahoogroups.com 
   flexcoders%40yahoogroups.comflexcoders%
 40yahoogroups.com, Richard

   Rodseth rrodseth@ wrote:
   
Design question for any other Mate users out there. Will cross-post
 to
   Mate
forum.
   
I use Mate with the Manager + Presentation Model pattern.
i.e. presentation model dispatches bubbling events. Mate event map
   invokes
services calls, sets result on manager. Properties are injected from
   manager
to presentation model.
   
I find it very convenient to have a data status property in the
presentation model for each service call, with values NOT_CURRENT,
   LOADING,
LOADED and ERROR. Then the view can display appropriate status and
   progress
indicators based on this property.
   
One approach (a) is to have the event map set the status on the
 manager
   and
have the map inject that status into the presentation model.
   
Another (b) is to set the status in the presentation model just
 before
dispatching the event, and when receiving the result (i.e. in a
 custom
setter).
   
I like the directness of (b), but it doesn't cover the error case
 unless
   the
manager also has something like a faultevent property that also gets
injected into the presentation model.
   
A third approach (c) would use listener injectors. The map would
 inject a
listener into the presentation model and would announce a special
 failure
event.
   
Thoughts?
   
  
  
  
 

  



Re: [flexcoders] Bug in Flex Chart in Flash Builder?

2010-06-10 Thread Richard Rodseth
Funny you should mention this. I just encountered an issue where the axis
would scale to 100 after a resize (in my case the chart is being re-parented
in a different layout with more space).

I worked around it by computing the maximum myself in my presentation model,
and binding the axis maximum property to my computed value.

On Thu, Jun 10, 2010 at 8:16 AM, Raymond Brown silenttr...@yahoo.comwrote:



 I have created a simple chart in flex, if I resize the window by dragging
 the corner edge everything works.  If I try to click a button and change the
 graph screen width and height via a state the Y scale of the graph resets to
 0 through 100.  When my data is between 0 and 3 obviously this doesn't work.
  The only way to fix it is reload the entire page which stinks for user
 interaction.  I have asked this question before on this list with no answer
 - am I the only person hitting this or rather using flex charts and changing
 their size via a state?

 i.e.

  ...width.state1=100% width.state2=250...

  I capture the resize event and tried to invalidate the display list and
 refresh the data provider but nothing works.

 -r

  



Re: [flexcoders] Blocking

2010-06-03 Thread Richard Rodseth
I was able to make an adjustment to the surrounding code, so this is no
longer an issue for me, but thanks for the information.

On Thu, Jun 3, 2010 at 3:55 AM, Oleg Sivokon olegsivo...@gmail.com wrote:



 You can load it with JavaScript synchronously, ExternalInterface is also
 synchronous, however, it is possible that you will run out of time and the
 application will crash because of that. Because, even though you can
 try-catch timeout error, if the function that produced the error won't exit,
 you will get another error that you cannot try-catch.
  



[flexcoders] Blocking

2010-06-02 Thread Richard Rodseth
I know this sounds terrible, but is there a way to wrap an asynchronous call
in one which blocks while waiting for it to complete?

I'm loading XML via URLLoader to configure a mock API implementation and am
limited in what I can change in the main application architecture. So I need
a way to block while loading the configuration file. I've tried setting a
_loadState variable and looping while it's set to loading, but that didn't
seem to do the trick.


Re: [flexcoders] Blocking

2010-06-02 Thread Richard Rodseth
Thanks. I guess it makes sense now that I think about it.

On Wed, Jun 2, 2010 at 9:05 PM, Alex Harui aha...@adobe.com wrote:



 I don’t know of any way to block for async network calls.



 On 6/2/10 6:59 PM, Richard Rodseth rrods...@gmail.com wrote:






 I know this sounds terrible, but is there a way to wrap an asynchronous
 call in one which blocks while waiting for it to complete?

 I'm loading XML via URLLoader to configure a mock API implementation and am
 limited in what I can change in the main application architecture. So I need
 a way to block while loading the configuration file. I've tried setting a
 _loadState variable and looping while it's set to loading, but that didn't
 seem to do the trick.





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



Re: [flexcoders] AS3/MXML Display list

2010-05-31 Thread Richard Rodseth
I'm not an old-school Flash developer, so I'm sure you'll get
better-informed replies, but I would just note that if all you care about is
back-end connection, HttpService, Binding etc. can be all instantiated in
AS3, with no markup required. Also, this in the script block is going to
refer to a class which descends from UIComponent which descends from
DisplayObject.

On Mon, May 31, 2010 at 4:52 PM, Clark Stevenson a.scots...@gmail.comwrote:



 Hey all.

 Can someone please help me understand how to work with the display list?

 Im an AS3 developer and very fond of the freedom i have with AS3. MXML
 has a great deal of useful components for connection to the backend
 and so on. These components could be handy for me and thus i need to
 use the MXML framework.

 So you start a new MXML Project and under the Script tag you add this code:

 fx:Script
 ![CDATA[
 private var circle:Sprite;

 circle = new Sprite();
 circle.graphics.beginFill(0x00);
 circle.graphics.drawCircle(100, 100, 100);
 circle.graphics.endFill();
 addChild(circle);
 ]]
 /fx:Script

 Everything from the begin fill is an error.

 Can someone explain to me why Sprite() is AS3, why its available to
 the Script tags but why its not really supported?

 I just feel that MXML is screwing up my understanding of the player.
 Main.as is a game and it extends Sprite So if MXML was AS3, id
 simply add an instance of

 var main:Main = new Main(); --- this is my entire game.

 So you think, well Main extends Canvas but the Script tags on
 Canvas dont understand addChild either

 Is what i am trying to do just impossible? I know that MXML is a time
 saver and so on, but to be honest, i hate markup and i just cant find
 a way to go back what what i know.

 This is something which has bugged me for years... Id love to
 understand flex more, but after investing so many years in AS3
 development, its just another AS2  AS3 jump to start rewriting every
 single project in MXML and to be honest, i cant be bothered right now.
 If i cant use MXML i cant use them and that great, but theres
 trillions of forum posts on google with a trillion views on this
 subject and none of them really agree.

 Cheers
  



Re: [flexcoders] E4X wildcard/dynamic query

2010-05-29 Thread Richard Rodseth
Thanks. I'll explore those techniques, but if that's what it takes, I think
I'd be inclined to just return xml.nodes and iterate in code.

Or perhaps

result = xml.node.(matches(???))

assuming there's a way to refer to the current node in place of ???

I was hoping there was something like

q = { a : 1 b:* }
result = xml.node.(@a == q.a  @b == q.b)

I suppose another approach would be to ensure that each node has all the
candidate attributes, with some of them having a value any, but that would
be a pity.


On Sat, May 29, 2010 at 3:08 AM, Oleg Sivokon olegsivo...@gmail.com wrote:



 var xml : XML =
 nodes
 node a=1/
 node a=1 b=2/
 /nodes;
 xml.no...@*.(/a|b/.test(localName())  doSomething(valueOf()));
 . . .
 private function doSomething(xml:XML):void { trace(xml); }

 Like this?
  



Re: [flexcoders] E4X wildcard/dynamic query

2010-05-29 Thread Richard Rodseth
 Thanks Oleg. I got something similar working. The requirement is just to
get the most specific result set with a variable number of supplied query
parameters. The following seems to do the trick, but I'm still surprised if
there isn't something more native.

private function evaluate(data:XML, query:Object):XMLList {
trace(Evaluate  + query.company +   + query.location);
var result:XMLList = data.node.(match(valueOf(), query) );
return result;
}

private function match(node:XML, query:Object):Boolean {
if (query.company  no...@company != query.company)
return false;
if (query.location  no...@location != query.location)
return false;
return true;
}


   var data:XML = nodes
  node company=google
  google
  /node
  node company=google location=seattle
google seattle
  /node
  node company=google location=san jose
google san jose
  /node
  node company=adobe location=san jose
adobe san jose
  /node
  node company=adobe location=seattle
adobe seattle
  /node
/nodes

var q1:Object = { company : google, location: null };
var q2:Object = { company : google , location: seattle };
var q3:Object = { company : null , location: seattle };



var result1:XMLList = evaluate(data, q1);
trace(result1);
var result2:XMLList = evaluate(data, q2);
trace(result2);
var result3:XMLList = evaluate(data, q3);
trace(result3);

Output:
Evaluate google null
node company=googlegoogle/node
node company=google location=seattlegoogle seattle/node
node company=google location=san josegoogle san jose/node
Evaluate google seattle
google seattle
Evaluate null seattle
node company=google location=seattlegoogle seattle/node
node company=adobe location=seattleadobe seattle/node


On Sat, May 29, 2010 at 9:02 AM, Oleg Sivokon olegsivo...@gmail.com wrote:



 Yes, valueOf() in the context of filter operator will return you the
 reference to the node currently processed. E4X, although uses special
 opcodes, from the AS3 programmer's perspective is the same part of the
 language as functions or variables are :) So, when you iterate over XML
 using E4X operators you are essentially doing that in code. If you want,
 it's not like XPath or regular expressions, think of LinQ as a better
 analogue.
 So, if the requirement is to check if all fields of an object have
 corresponding attributes, I would do it like so:

 var xml : XML =
 nodes
 item foo=12345/
  item foo=34567 bar=qwerty/
 /nodes;
 var pattern:Object = { foo : true, bar : true };
 xml.item.(this.check(valueOf(), pattern)).(trace(valueOf().toXMLString()));

 . . .

 private function check(node:XML, pattern:Object):Boolean
 {
 for (var p:String in pattern)
  {
 if (!(@ + p in node)) return false;
 }
  return true;
 }

 Best.

 Oleg
  



Re: [flexcoders] E4X wildcard/dynamic query

2010-05-29 Thread Richard Rodseth
Not sure where you got the idea that I'm validating. I'm actually loading a
node to use for configuration information for a mock api (where the mock api
has parameters which may or may not have non-null values). If the configurer
chooses to specify a configuration for a specific company and  location I
want to pick that node when the api user provides a company and location as
inputs. The node with no attributes would be the default configuration. I
can certainly see that I could require that the nodes all have the same
attributes with some specifying a null value, but I think the approach
we've arrived at makes for a cleaner configuration file.

With a database I can say

select where company=google

or I can say

select where company=google and location = seattle

The column values can be nullable so I don't have to specify a value for
each column in each row.

Anyway, I'm happy with the solution, I mean no disrespect for E4X, and
perhaps my usage is atypical. Thanks for the help!


On Sat, May 29, 2010 at 11:04 AM, Oleg Sivokon olegsivo...@gmail.comwrote:



 Well, normally you would know what parameters are required for the node to
 have. So, you would just write an E4X for that specific set of requirements
 and if the requirements change you would replace the entire block. Just as
 you would replace CSS in HTML template. That is I kind of fail to see the
 point in making validation dynamic and construct it at runtime instead of
 hardcoding it. What I mean is, since you know that you have to look for
 @company and @location attributes - why would you provide them dynamically
 and try to construct a validating expression instead of having that
 expression hardcoded? As per my experience the hardcoded validation always
 works better... - less errors, easier to read code. Compare this to
 constructing DTD or XSL dynamically - usually it kind of defeats the purpose
 of having those tools :)
 Well, I think this all comes from the inherent to XML lack of typing and
 structure. It is usually to generic for the data it serializes. There are
 different solutions for transferring data preserving typing and stucture,
 which are also more compact and often times easier to use - AMF and Protobuf
 would be the most popular probably.
  



[flexcoders] E4X wildcard/dynamic query

2010-05-28 Thread Richard Rodseth
Does attribute matching in E4X include some kind of wildcard value?

I'd like to be able to do something like:

nodes.node.(attribute( a) == query.a  attribute(b) == query.b)

nodes
node a=1
/node
node a=1 b=2
/node
nodes

and have both nodes match if query.b is null.


Re: [flexcoders] Re: Security sandbox violation

2010-05-26 Thread Richard Rodseth
That's how I started I out and will most likely end up. But getting the
error while debugging (which has since gone away) and reading the responses
here indicated it shouldn't work.

On Wed, May 26, 2010 at 6:06 AM, valdhor valdhorli...@embarqmail.comwrote:



 Why not just keep networking on and access the local file with a local URL?

 mx:HttpService url=test.xml ...

 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Richard
 Rodseth rrods...@... wrote:
 
  Thanks. That's good to know about.
  It seems, though, that one has to choose between allowing local access or
  network access.
  Can anyone tell me if it's possible to create a single SWF (plus
 companion
  wrapper html and config xml that can either be hosted on a web server, or
  unzipped and run locally? Or would the end user have to use that page you
  linked to?
 
  On Tue, May 25, 2010 at 6:18 AM, valdhor valdhorli...@...wrote:

 
  
  
   What I do for debugging purposes is to set my debug folder as a trusted
   source in
  
 http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
  
   To do this...
   Click Edit Locations-Add Location
   Click Browse for Folder
   Browse to your bin-debug folder
  
   This allows you to debug locally - ie. from a
   file://location_of_bin-debug_HTML_file. If you have a local server
 running
   (Which I do) the you can set your run/debug settings to open the html
 file
   on your local server. ie.
   http://127.0.0.1/myproject/bin-debug/myproject.html. In this case, you
   would need a crossdomain.xml file.
  
  
   --- In flexcoders@yahoogroups.com 
   flexcoders%40yahoogroups.comflexcoders%
 40yahoogroups.com, Richard

   Rodseth rrodseth@ wrote:
   
Not sure I follow that page, but it appears that the
 -use-network=false
compiler flag may be helpful for this scenario.
   
If only FB allowed you to set different compiler options for
 different
applications within a project.
   
On Mon, May 24, 2010 at 4:11 PM, Oleg Sivokon olegsivokon@ wrote:
   


 No, it is different. If the SWF is embedded in HTML page, it
 requires
   that
 you specify the trusted locations on your machine, so it could load
 content:

  
 http://macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
 Read carefully the text in gray under the picture.
 But, if you launch it in standalone player, then, I reckon, it
 should
   be
 able to access local files.


   
  
  
  
 

  



Re: [flexcoders] Re: Security sandbox violation

2010-05-25 Thread Richard Rodseth
I'm not sure we're all talking about the same thing, but there must be
zillions of SWFs accessing external XML configurations without any user
intervention.
I haven't tested on a web server yet, but this -use-network=false seems
appropriate.

On Tue, May 25, 2010 at 8:49 AM, Amy amyblankens...@bellsouth.net wrote:





 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Oleg
 Sivokon olegsivo...@... wrote:
 
  No, it is different. If the SWF is embedded in HTML page, it requires
 that
  you specify the trusted locations on your machine, so it could load
  content:
 
 http://macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
  Read carefully the text in gray under the picture.
  But, if you launch it in standalone player, then, I reckon, it should be
  able to access local files.
 

 No, I am pretty sure you (and all your users) will need to use the Settings
 Manager page in order to trust the directory with your XML in it.

 Apparently, you can provide a config file to get around this:
 http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7c95.html,
  but the directory where this is supposed to live doesn't even exist on my
 computer, and there is no clue of where to get one to use as a starting
 point.

 Good luck!

 Amy

  



Re: [flexcoders] Re: Security sandbox violation

2010-05-25 Thread Richard Rodseth
I'm obviously thoroughly confused. Presumably -use-network must be true in
order to run the folder from the server, because the swf will be local
once it's trying to read the XML config file sitting beside the SWF on the
server.

I'm hoping I don't need a different SWF for the second scenario (unzipping a
folder and opening the wrapper html locally.

I just tried again, launching the debugger, even without setting
-use-network to false, and this time it worked.

On Tue, May 25, 2010 at 11:08 AM, Richard Rodseth rrods...@gmail.comwrote:

 I'm not sure we're all talking about the same thing, but there must be
 zillions of SWFs accessing external XML configurations without any user
 intervention.
 I haven't tested on a web server yet, but this -use-network=false seems
 appropriate.


 On Tue, May 25, 2010 at 8:49 AM, Amy amyblankens...@bellsouth.net wrote:





 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Oleg
 Sivokon olegsivo...@... wrote:
 
  No, it is different. If the SWF is embedded in HTML page, it requires
 that
  you specify the trusted locations on your machine, so it could load
  content:
 
 http://macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
  Read carefully the text in gray under the picture.
  But, if you launch it in standalone player, then, I reckon, it should be
  able to access local files.
 

 No, I am pretty sure you (and all your users) will need to use the
 Settings Manager page in order to trust the directory with your XML in it.

 Apparently, you can provide a config file to get around this:
 http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7c95.html,
  but the directory where this is supposed to live doesn't even exist on my
 computer, and there is no clue of where to get one to use as a starting
 point.

 Good luck!

 Amy

  





Re: [flexcoders] Re: Security sandbox violation

2010-05-25 Thread Richard Rodseth
Thanks. That's good to know about.
It seems, though, that one has to choose between allowing local access or
network access.
Can anyone tell me if it's possible to create a single SWF (plus companion
wrapper html and config xml that can either be hosted on a web server, or
unzipped and run locally? Or would the end user have to use that page you
linked to?

On Tue, May 25, 2010 at 6:18 AM, valdhor valdhorli...@embarqmail.comwrote:



 What I do for debugging purposes is to set my debug folder as a trusted
 source in
 http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

 To do this...
 Click Edit Locations-Add Location
 Click Browse for Folder
 Browse to your bin-debug folder

 This allows you to debug locally - ie. from a
 file://location_of_bin-debug_HTML_file. If you have a local server running
 (Which I do) the you can set your run/debug settings to open the html file
 on your local server. ie.
 http://127.0.0.1/myproject/bin-debug/myproject.html. In this case, you
 would need a crossdomain.xml file.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Richard
 Rodseth rrods...@... wrote:
 
  Not sure I follow that page, but it appears that the -use-network=false
  compiler flag may be helpful for this scenario.
 
  If only FB allowed you to set different compiler options for different
  applications within a project.
 
  On Mon, May 24, 2010 at 4:11 PM, Oleg Sivokon olegsivo...@... wrote:
 
  
  
   No, it is different. If the SWF is embedded in HTML page, it requires
 that
   you specify the trusted locations on your machine, so it could load
   content:
  
 http://macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
   Read carefully the text in gray under the picture.
   But, if you launch it in standalone player, then, I reckon, it should
 be
   able to access local files.
  
  
 

  



Re: [flexcoders] Re: Security sandbox violation

2010-05-25 Thread Richard Rodseth
Thanks. That sounds like a no for supporting my two use cases, unless the
customer adds a trusted location or opens the SWF in the standalone player.

On Tue, May 25, 2010 at 12:45 PM, Oleg Sivokon olegsivo...@gmail.comwrote:



 OK, it's like this:
 SWF launched in standalone player can interact with the system AND load
 remote content, just like the browser can do the same thing.
 SWF launched in browser plugin can only access permitted folders on your
 hard disc. To allow access to the folder you should either use the web
 interface (see my previous link), or read from the link Ami posted and try
 to figure out how to do that on Mac (you are not required to use web
 interface to establish local trust relationships between SWF and specific
 locations in file system, it's just that, I simply don't know how to do that
 on Mac...)
 There's yet another option for launching a SWF - that's how I usually do
 that - from the local HTTP server, in such case it acts more like as if it
 was deployed to the actual server and all the following rules apply. I would
 definitely recommend the later way of debugging as it is the most similar to
 the live situation.
 The loading of content other than SWF into another SWF is governed by
 policy files aka crossdomain.xml. You need these files if you are loading
 content from domains other than SWF origin.
 The loading of other SWFs by SWF is governed by two things:
 ApplicationDomain provided to the Loader when loading SWF with
 LoaderContext - by default it won't allow crosscripting.
 Security.allowDomain() doesn't define how classes are loaded into
 application domain, however, should prevent security errors related to
 crosscripting.

 Well, yes, it is complicated...
  



Re: [flexcoders] Re: Security sandbox violation

2010-05-25 Thread Richard Rodseth
Sorry :) That seems to happen a lot with my topics.

Use case 1:
 Customer (a sales engineer) accesses a demo that is hosted on the web like
any other Flex app. This demo makes no api calls, but does need to access an
XML config file that lives in a data folder beside the SWF

Use case 2:
Sales engineer has a copy of the entire directory (swf, wrapper html, config
file) and runs it locally

I think your second point confirms that to support both use cases with one
version of the application, the customer would have to add a trusted
location so that the app could get to the config. That may be fine, I would
have to check.

Since this is all read-only stuff, I would have hoped I could do it with one
SWF and no user-intervention, but I imagine there are good reasons for these
restrictions.


On Tue, May 25, 2010 at 3:26 PM, Alex Harui aha...@adobe.com wrote:



 I got lost trying to follow this topic.  Whether it is browser or
 standalone shouldn’t matter.  What matters is the url of the SWF (file://or
 http://), the trust file settings on the computer, the use-network flag,
 and how you access the external resources.

 If you build a SWF to run locally then it cannot access the network.
 If you build a SWF to access the network, it cannot access the local files
 unless trusted.
 Even if trusted, you may run into issues using certain file paths.  Be sure
 to use relative paths to subfolders of the trusted folder.


 On 5/25/10 2:42 PM, Richard Rodseth rrods...@gmail.com wrote:






 Thanks. That sounds like a no for supporting my two use cases, unless the
 customer adds a trusted location or opens the SWF in the standalone player.

 On Tue, May 25, 2010 at 12:45 PM, Oleg Sivokon olegsivo...@gmail.com
 wrote:






 OK, it's like this:
 SWF launched in standalone player can interact with the system AND load
 remote content, just like the browser can do the same thing.
 SWF launched in browser plugin can only access permitted folders on your
 hard disc. To allow access to the folder you should either use the web
 interface (see my previous link), or read from the link Ami posted and try
 to figure out how to do that on Mac (you are not required to use web
 interface to establish local trust relationships between SWF and specific
 locations in file system, it's just that, I simply don't know how to do that
 on Mac...)
 There's yet another option for launching a SWF - that's how I usually do
 that - from the local HTTP server, in such case it acts more like as if it
 was deployed to the actual server and all the following rules apply. I would
 definitely recommend the later way of debugging as it is the most similar to
 the live situation.
 The loading of content other than SWF into another SWF is governed by
 policy files aka crossdomain.xml. You need these files if you are loading
 content from domains other than SWF origin.
 The loading of other SWFs by SWF is governed by two things:
 ApplicationDomain provided to the Loader when loading SWF with
 LoaderContext - by default it won't allow crosscripting.
 Security.allowDomain() doesn't define how classes are loaded into
 application domain, however, should prevent security errors related to
 crosscripting.

 Well, yes, it is complicated...










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



[flexcoders] Security sandbox violation

2010-05-24 Thread Richard Rodseth
I'm creating a demo swf that won't attach to a server and may be hosted, or
launched from the desktop. I wish to externalize some data in a separate xml
or text file that will live beside the SWF rather than being embedded in it
(actually I may need both).

What's the best approach here?

In using HTTPService to read the data file (which I placed in html-template
so it got copied to bin-debug), I got a security sandbox error running under
the Flexbuilder debugger.


Re: [flexcoders] Security sandbox violation

2010-05-24 Thread Richard Rodseth
Yes, that's what I'm seeing with both URLLoader and HTTPService. So I guess
my question becomes:

How do you debug this stuff in FB ?

On Mon, May 24, 2010 at 12:18 PM, Oleg Sivokon olegsivo...@gmail.comwrote:



 Please correct me if I'm wrong, but I think that if you launch it in
 standalone player, you shouldn't get the security error, well, maybe for
 system or read-only files, or, maybe due to other system restrictions, but
 generally it should just work...
  



Re: [flexcoders] Security sandbox violation

2010-05-24 Thread Richard Rodseth
Potentially both. The client wishes to host it on a web server (with no app
server/db access) but it could also get run from the desktop, unless we
provide the wrapper as part of our solution. The browser version is
required.


On Mon, May 24, 2010 at 12:48 PM, Oleg Sivokon olegsivo...@gmail.comwrote:



 Sorry, are you running it in standalone player or in browser? There
 shouldn't be a problem if you run it in standalone player.
  



Re: [flexcoders] Security sandbox violation

2010-05-24 Thread Richard Rodseth
And both seem to work when I'm launching from the desktop, but not from the
debugger.

On Mon, May 24, 2010 at 1:19 PM, Richard Rodseth rrods...@gmail.com wrote:

 Potentially both. The client wishes to host it on a web server (with no app
 server/db access) but it could also get run from the desktop, unless we
 provide the wrapper as part of our solution. The browser version is
 required.



 On Mon, May 24, 2010 at 12:48 PM, Oleg Sivokon olegsivo...@gmail.comwrote:



 Sorry, are you running it in standalone player or in browser? There
 shouldn't be a problem if you run it in standalone player.
  





Re: [flexcoders] Security sandbox violation

2010-05-24 Thread Richard Rodseth
It's possible I have multiple players on my system, and FB is using a
different one. By launch, I just meant using the Run/Launch button within FB
as opposed to finding the wrapper html in the Finder and opening it.

On Mon, May 24, 2010 at 2:04 PM, Oleg Sivokon olegsivo...@gmail.com wrote:



 Not sure I get it, how do you launch that from debugger? There are
 several options available in FB (and few more in SDK and in alternative
 debuggers), you can launch in browser, and if you have debug player
 installed there, it will start the debugger client in FB, or, you can launch
 in standalone debugger player, it's hard to tell which player exactly FB
 will use, but most often it will pick the one from your SDK, and that will
 be a debug player, so that again it will connect back to the debugger client
 in FB. One more option to debug is by launching fdb commandline debugger...
 On the other hand, if you don't launch that in debug player, how do you know
 there aren't errors?
  



Re: [flexcoders] Security sandbox violation

2010-05-24 Thread Richard Rodseth
Standard behavior in FB is to launch in browser (the html-wrapper folder
gets copied to bin-debug with template items filled in. I'm guessing you
aren't an FB user - I'm not away of any other way to launch from within FB.

On Mon, May 24, 2010 at 3:14 PM, Oleg Sivokon olegsivo...@gmail.com wrote:



 When you click launch it may either launch in browser or in standalone
 player. Which one does it launch?
  



Re: [flexcoders] Security sandbox violation

2010-05-24 Thread Richard Rodseth
Uh oh. So there appears to be a Safari/Firefox difference. I was launching
Safari when opening the html file in the Finder, and Firefox in Eclipse.

Whichever way I launch (fb or Finder), I get the security error in Firefox,
and not in Safari.

Sorry for the confusion. So now I'm back to wondering if my approach is
incorrect, whether I need a crossdomain.xml etc etc.

To recap: I just need a folder with a swf, wrapper html and external data
file. Might be hosted on the web, or e-mailed to someone. I'll read up more
about security, but if anyone has tips about this scenario, I'd appreciate
them.


On Mon, May 24, 2010 at 3:37 PM, Oleg Sivokon olegsivo...@gmail.com wrote:



 Well, I am, but I usually compile with Ant and launch the player from the
 build script. So, I really didn't remember which are the default settings.
 Well, that's not really related. In your case you'd need to configure the
 builder to launch whatever it compiles in the run configuration follow these
 steps:
 http://livedocs.adobe.com/flex/3/html/help.html?content=compile_debug_4.html#149153
 they shouldn't be very different if you have FB4.

 Best.

 Oleg
  



Re: [flexcoders] Security sandbox violation

2010-05-24 Thread Richard Rodseth
Not sure I follow that page, but it appears that the -use-network=false
compiler flag may be helpful for this scenario.

If only FB allowed you to set different compiler options for different
applications within a project.

On Mon, May 24, 2010 at 4:11 PM, Oleg Sivokon olegsivo...@gmail.com wrote:



 No, it is different. If the SWF is embedded in HTML page, it requires that
 you specify the trusted locations on your machine, so it could load
 content:
 http://macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
 Read carefully the text in gray under the picture.
 But, if you launch it in standalone player, then, I reckon, it should be
 able to access local files.
  



[flexcoders] TabNavigator

2010-05-21 Thread Richard Rodseth
Is there an event dispatched by TabNavigator when the *user* switches tabs?

change is dispatched when the selected change happens
programmatically (eg. because selectedChild is bound).


Re: [flexcoders] Re: TabNavigator

2010-05-21 Thread Richard Rodseth
You might mean click, in which case yes. It is dispatched when clicking
with the content area of the navigator, but not on the button bar.
And it wouldn't cover keyboard navigation.

On Fri, May 21, 2010 at 1:06 PM, turbo_vb timh...@aol.com wrote:



 You try itemClick?

 -TH


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Richard
 Rodseth rrods...@... wrote:
 
  Is there an event dispatched by TabNavigator when the *user* switches
 tabs?
 
  change is dispatched when the selected change happens
  programmatically (eg. because selectedChild is bound).
 

  



Re: [flexcoders] Script timeout binding selection in Tree

2010-05-18 Thread Richard Rodseth
I think I already mentioned it was called twice. I can double-check
tomorrow.

On Mon, May 17, 2010 at 9:35 PM, Alex Harui aha...@adobe.com wrote:



 Set a breakpoint on setSelectionDataLoop.  See how often it gets called.



 On 5/17/10 4:49 PM, Richard Rodseth rrods...@gmail.com wrote:






 Thanks for trying. No, the presentation model has an array collection whose
 .source gets changed after an HTTPService call returns (although I should
 mention that I am using my mock service layer at the moment). I added a a
 collection change listener to the collection reference.
 I have set a breakpoint in setSelectionDataLoop(). I hit it twice (the
 parameters appear the same - index 0, items array containing the object to
 select, useFind=false). Then the debugger stopped with the finally{} block
 in Binding.watcherFired highlighted and the stack crawl below. Below this
 stack crawl I've included the last few lines of the one that shows up in the
 console.

 Main Thread (Suspended: Error: Error #1502: A script has executed for
 longer than the default timeout period of 15 seconds.)
 mx.binding::Binding/watcherFired
 mx.binding::Watcher/notifyListeners
 mx.binding::PropertyWatcher/eventHandler
 flash.events::EventDispatcher/dispatchEventFunction [no source]
 flash.events::EventDispatcher/dispatchEvent [no source]

 com.companyname.admin.deviceshome.ui.presentation::DevicesHome/changeSelectedGroupIds


 com.companyname.admin.deviceshome.ui.presentation::DevicesHome/groupsChangedListener

 flash.events::EventDispatcher/dispatchEventFunction [no source]
 flash.events::EventDispatcher/dispatchEvent [no source]
 mx.collections::ListCollectionView/dispatchEvent
 mx.collections::ListCollectionView/
 http://www.adobe.com/2006/flex/mx/internal::reset
 mx.collections::ListCollectionView/set list
 mx.collections::ArrayCollection/set source
 anonymous
 mx.rpc::Responder/result
 anonymous
 Array$/_forEach [no source]
 Array/http://adobe.com/AS3/2006/builtin::forEach [no source]
 anonymous
 flash.utils::Timer/_timerDispatch [no source]
 flash.utils::Timer/tick [no source]

 Console:

 Error: Error #1502: A script has executed for longer than the default
 timeout period of 15 seconds.
 at mx.controls.treeClasses::HierarchicalViewCursor/moveNext()
 at
 mx.controls.listClasses::ListBase/setSelectionDataLoop()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:6455]


 On Mon, May 17, 2010 at 4:09 PM, Oleg Sivokon olegsivo...@gmail.com
 wrote:






 I wish I could help more... well here's another guess:
 - if you are using XML / XMLList, and have used insertBefore / isertAfter
 from the same XML / XMLList, then it is a known bug.
 - if you dispatch collectionChange on your own you might have messed
 something in the event's properties, which then will make the collection run
 in a loop thinking it's being updated over and over again. It is slow, but
 it isn't that slow to run out of script timeout limit :)
 Anyways, bindings are the first suspect in such case, but if that's not...
 ah, and, why won't you debug it? the debugger should be able to look into
 the framework sources. If, for whatever reason it doesn't, copy the Tree and
 other classes involved into your project and try debugging this way.

 Best.

 Oleg










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



Re: [flexcoders] Script timeout binding selection in Tree

2010-05-18 Thread Richard Rodseth
Two or three times. Then I get the spinning beach ball.

On Mon, May 17, 2010 at 11:12 PM, Richard Rodseth rrods...@gmail.comwrote:

 I think I already mentioned it was called twice. I can double-check
 tomorrow.


 On Mon, May 17, 2010 at 9:35 PM, Alex Harui aha...@adobe.com wrote:



 Set a breakpoint on setSelectionDataLoop.  See how often it gets called.



 On 5/17/10 4:49 PM, Richard Rodseth rrods...@gmail.com wrote:






 Thanks for trying. No, the presentation model has an array collection
 whose .source gets changed after an HTTPService call returns (although I
 should mention that I am using my mock service layer at the moment). I added
 a a collection change listener to the collection reference.
 I have set a breakpoint in setSelectionDataLoop(). I hit it twice (the
 parameters appear the same - index 0, items array containing the object to
 select, useFind=false). Then the debugger stopped with the finally{} block
 in Binding.watcherFired highlighted and the stack crawl below. Below this
 stack crawl I've included the last few lines of the one that shows up in the
 console.

 Main Thread (Suspended: Error: Error #1502: A script has executed for
 longer than the default timeout period of 15 seconds.)
 mx.binding::Binding/watcherFired
 mx.binding::Watcher/notifyListeners
 mx.binding::PropertyWatcher/eventHandler
 flash.events::EventDispatcher/dispatchEventFunction [no source]
 flash.events::EventDispatcher/dispatchEvent [no source]

 com.companyname.admin.deviceshome.ui.presentation::DevicesHome/changeSelectedGroupIds


 com.companyname.admin.deviceshome.ui.presentation::DevicesHome/groupsChangedListener

 flash.events::EventDispatcher/dispatchEventFunction [no source]
 flash.events::EventDispatcher/dispatchEvent [no source]
 mx.collections::ListCollectionView/dispatchEvent
 mx.collections::ListCollectionView/
 http://www.adobe.com/2006/flex/mx/internal::reset
 mx.collections::ListCollectionView/set list
 mx.collections::ArrayCollection/set source
 anonymous
 mx.rpc::Responder/result
 anonymous
 Array$/_forEach [no source]
 Array/http://adobe.com/AS3/2006/builtin::forEach [no source]
 anonymous
 flash.utils::Timer/_timerDispatch [no source]
 flash.utils::Timer/tick [no source]

 Console:

 Error: Error #1502: A script has executed for longer than the default
 timeout period of 15 seconds.
 at mx.controls.treeClasses::HierarchicalViewCursor/moveNext()
 at
 mx.controls.listClasses::ListBase/setSelectionDataLoop()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:6455]


 On Mon, May 17, 2010 at 4:09 PM, Oleg Sivokon olegsivo...@gmail.com
 wrote:






 I wish I could help more... well here's another guess:
 - if you are using XML / XMLList, and have used insertBefore / isertAfter
 from the same XML / XMLList, then it is a known bug.
 - if you dispatch collectionChange on your own you might have messed
 something in the event's properties, which then will make the collection run
 in a loop thinking it's being updated over and over again. It is slow, but
 it isn't that slow to run out of script timeout limit :)
 Anyways, bindings are the first suspect in such case, but if that's not...
 ah, and, why won't you debug it? the debugger should be able to look into
 the framework sources. If, for whatever reason it doesn't, copy the Tree and
 other classes involved into your project and try debugging this way.

 Best.

 Oleg










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





Re: [flexcoders] Script timeout binding selection in Tree

2010-05-18 Thread Richard Rodseth
That sounds about right. moveNext() does appear in the stack sometimes, and
I am changing the data provider contents.
I may have to put the restoreselection code somewhere other than in a
collection change handler.



On Tue, May 18, 2010 at 9:16 AM, Alex Harui aha...@adobe.com wrote:



 If that’s true, on the second invocation, step through it.  It might be
 hung up in moveNext() not advancing to the next item, maybe because you’ve
 run out of items.



 On 5/17/10 11:12 PM, Richard Rodseth rrods...@gmail.com wrote:






 I think I already mentioned it was called twice. I can double-check
 tomorrow.

 On Mon, May 17, 2010 at 9:35 PM, Alex Harui aha...@adobe.com wrote:






 Set a breakpoint on setSelectionDataLoop.  See how often it gets called.



 On 5/17/10 4:49 PM, Richard Rodseth rrods...@gmail.com 
 http://rrods...@gmail.com  wrote:






 Thanks for trying. No, the presentation model has an array collection whose
 .source gets changed after an HTTPService call returns (although I should
 mention that I am using my mock service layer at the moment). I added a a
 collection change listener to the collection reference.
 I have set a breakpoint in setSelectionDataLoop(). I hit it twice (the
 parameters appear the same - index 0, items array containing the object to
 select, useFind=false). Then the debugger stopped with the finally{} block
 in Binding.watcherFired highlighted and the stack crawl below. Below this
 stack crawl I've included the last few lines of the one that shows up in the
 console.

 Main Thread (Suspended: Error: Error #1502: A script has executed for
 longer than the default timeout period of 15 seconds.)
 mx.binding::Binding/watcherFired
 mx.binding::Watcher/notifyListeners
 mx.binding::PropertyWatcher/eventHandler
 flash.events::EventDispatcher/dispatchEventFunction [no source]
 flash.events::EventDispatcher/dispatchEvent [no source]

 com.companyname.admin.deviceshome.ui.presentation::DevicesHome/changeSelectedGroupIds


 com.companyname.admin.deviceshome.ui.presentation::DevicesHome/groupsChangedListener

 flash.events::EventDispatcher/dispatchEventFunction [no source]
 flash.events::EventDispatcher/dispatchEvent [no source]
 mx.collections::ListCollectionView/dispatchEvent
 mx.collections::ListCollectionView/
 http://www.adobe.com/2006/flex/mx/internal::reset
 mx.collections::ListCollectionView/set list
 mx.collections::ArrayCollection/set source
 anonymous
 mx.rpc::Responder/result
 anonymous
 Array$/_forEach [no source]
 Array/http://adobe.com/AS3/2006/builtin::forEach [no source]
 anonymous
 flash.utils::Timer/_timerDispatch [no source]
 flash.utils::Timer/tick [no source]

 Console:

 Error: Error #1502: A script has executed for longer than the default
 timeout period of 15 seconds.
 at mx.controls.treeClasses::HierarchicalViewCursor/moveNext()
 at
 mx.controls.listClasses::ListBase/setSelectionDataLoop()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:6455]


 On Mon, May 17, 2010 at 4:09 PM, Oleg Sivokon olegsivo...@gmail.com 
 http://olegsivo...@gmail.com  wrote:






 I wish I could help more... well here's another guess:
 - if you are using XML / XMLList, and have used insertBefore / isertAfter
 from the same XML / XMLList, then it is a known bug.
 - if you dispatch collectionChange on your own you might have messed
 something in the event's properties, which then will make the collection run
 in a loop thinking it's being updated over and over again. It is slow, but
 it isn't that slow to run out of script timeout limit :)
 Anyways, bindings are the first suspect in such case, but if that's not...
 ah, and, why won't you debug it? the debugger should be able to look into
 the framework sources. If, for whatever reason it doesn't, copy the Tree and
 other classes involved into your project and try debugging this way.

 Best.

 Oleg










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



Re: [flexcoders] Script timeout binding selection in Tree

2010-05-18 Thread Richard Rodseth
I've attempted to create a one-file test case, and while it doesn't exhibit
the script timeout, the selection restoration does not work as part of the
collection listener.
Is it significant that selectedItems does not show up in code completion
while selectedIndices does?

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=vertical minWidth=955 minHeight=600

creationComplete=application1_creationCompleteHandler(event)


mx:Script
![CDATA[
import mx.collections.ArrayCollection;
import mx.events.CollectionEvent;
import mx.events.CollectionEventKind;
import mx.events.FlexEvent;
import mx.events.ListEvent;


[Bindable]
public var items:ArrayCollection = new ArrayCollection();

[Bindable(event=selectionChanged)]
public function get selectedItems():Array {
return _selectedItems;
}

private var _selectedItems:Array = [];
private var _selectedIds:Array = [];

private function selectItems(items:Array):void {
_selectedItems = items;
_selectedIds = this.toIds(items);

dispatchEvent(new Event(selectionChanged));
}

protected function
application1_creationCompleteHandler(event:FlexEvent):void
{
items.addEventListener(CollectionEvent.COLLECTION_CHANGE,
itemsListener, false, 0, true);
}

private function itemsListener(event:CollectionEvent):void {
if (event.kind == CollectionEventKind.RESET) {
this.restoreSelection();
}
}

private function refresh():void {

this.items.source = [ { uid:1, name:Root, children: [ {
uid:2, name:Child } ] } ];

}

private function toIds(items:Array):Array {
var result:Array = new Array();
for each (var item:Object in items) {
result.push(item.uid);
}
return result;
}

private function toItems(ids:Array):Array {
var root:Object = this.items ? this.items.getItemAt(0) :
null;

var result:Array = new Array();
for each (var id:String in ids) {
var item:Object = find(root, id);
if (item) {
result.push(item);
}
}
return result;
}

private function restoreSelection():void {
_selectedItems = toItems(_selectedIds);
dispatchEvent(new Event(selectionChanged));

}

private function find(start:Object, uid:String):Object {
if (start.uid == uid)
return start;
for each (var child:Object in start.children) {
var found:Object = this.find(child, uid);
if (found)
return found;
}
return null;
}


protected function tree1_changeHandler(event:ListEvent):void
{
this.selectItems(theTree.selectedItems);
}

protected function button1_clickHandler(event:MouseEvent):void
{
this.refresh();
}



]]
/mx:Script


mx:Tree id=theTree
 dataProvider={this.items}
 selectedItems={this.selectedItems}
 labelField=name
 allowMultipleSelection=true
 change=tree1_changeHandler(event)/

mx:Button label=Refresh click=refresh()/
mx:Button label=Restore Selection click=restoreSelection()/


/mx:Application


On Tue, May 18, 2010 at 9:23 AM, Richard Rodseth rrods...@gmail.com wrote:

 That sounds about right. moveNext() does appear in the stack sometimes, and
 I am changing the data provider contents.
 I may have to put the restoreselection code somewhere other than in a
 collection change handler.




 On Tue, May 18, 2010 at 9:16 AM, Alex Harui aha...@adobe.com wrote:



 If that’s true, on the second invocation, step through it.  It might be
 hung up in moveNext() not advancing to the next item, maybe because you’ve
 run out of items.



 On 5/17/10 11:12 PM, Richard Rodseth rrods...@gmail.com wrote:






 I think I already mentioned it was called twice. I can double-check
 tomorrow.

 On Mon, May 17, 2010 at 9:35 PM, Alex Harui aha...@adobe.com wrote:






 Set a breakpoint on setSelectionDataLoop.  See how often it gets called.



 On 5/17/10 4:49 PM, Richard Rodseth rrods...@gmail.com 
 http://rrods...@gmail.com  wrote:






 Thanks for trying. No, the presentation model has an array collection
 whose .source gets changed after an HTTPService call

Re: [flexcoders] Script timeout binding selection in Tree

2010-05-18 Thread Richard Rodseth
My bad (at least in this example). The selectedItems getter is incorrect.

On Tue, May 18, 2010 at 12:15 PM, Richard Rodseth rrods...@gmail.comwrote:

 I've attempted to create a one-file test case, and while it doesn't exhibit
 the script timeout, the selection restoration does not work as part of the
 collection listener.
 Is it significant that selectedItems does not show up in code completion
 while selectedIndices does?

 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=vertical minWidth=955 minHeight=600

 creationComplete=application1_creationCompleteHandler(event)
 

 mx:Script
 ![CDATA[
 import mx.collections.ArrayCollection;
 import mx.events.CollectionEvent;
 import mx.events.CollectionEventKind;
 import mx.events.FlexEvent;
 import mx.events.ListEvent;


 [Bindable]
 public var items:ArrayCollection = new ArrayCollection();

 [Bindable(event=selectionChanged)]
 public function get selectedItems():Array {
 return _selectedItems;
 }

 private var _selectedItems:Array = [];
 private var _selectedIds:Array = [];

 private function selectItems(items:Array):void {
 _selectedItems = items;
 _selectedIds = this.toIds(items);

 dispatchEvent(new Event(selectionChanged));
 }

 protected function
 application1_creationCompleteHandler(event:FlexEvent):void
 {
 items.addEventListener(CollectionEvent.COLLECTION_CHANGE,
 itemsListener, false, 0, true);
 }

 private function itemsListener(event:CollectionEvent):void {
 if (event.kind == CollectionEventKind.RESET) {
 this.restoreSelection();
 }
 }

 private function refresh():void {

 this.items.source = [ { uid:1, name:Root, children: [ {
 uid:2, name:Child } ] } ];

 }

 private function toIds(items:Array):Array {
 var result:Array = new Array();
 for each (var item:Object in items) {
 result.push(item.uid);
 }
 return result;
 }

 private function toItems(ids:Array):Array {
 var root:Object = this.items ? this.items.getItemAt(0) :
 null;

 var result:Array = new Array();
 for each (var id:String in ids) {
 var item:Object = find(root, id);
 if (item) {
 result.push(item);
 }
 }
 return result;
 }

 private function restoreSelection():void {
 _selectedItems = toItems(_selectedIds);
 dispatchEvent(new Event(selectionChanged));

 }

 private function find(start:Object, uid:String):Object {
 if (start.uid == uid)
 return start;
 for each (var child:Object in start.children) {
 var found:Object = this.find(child, uid);
 if (found)
 return found;
 }
 return null;
 }


 protected function tree1_changeHandler(event:ListEvent):void
 {
 this.selectItems(theTree.selectedItems);
 }

 protected function button1_clickHandler(event:MouseEvent):void
 {
 this.refresh();
 }



 ]]
 /mx:Script


 mx:Tree id=theTree
  dataProvider={this.items}
  selectedItems={this.selectedItems}
  labelField=name
  allowMultipleSelection=true
  change=tree1_changeHandler(event)/

 mx:Button label=Refresh click=refresh()/
 mx:Button label=Restore Selection click=restoreSelection()/


 /mx:Application



 On Tue, May 18, 2010 at 9:23 AM, Richard Rodseth rrods...@gmail.comwrote:

 That sounds about right. moveNext() does appear in the stack sometimes,
 and I am changing the data provider contents.
 I may have to put the restoreselection code somewhere other than in a
 collection change handler.




 On Tue, May 18, 2010 at 9:16 AM, Alex Harui aha...@adobe.com wrote:



 If that’s true, on the second invocation, step through it.  It might be
 hung up in moveNext() not advancing to the next item, maybe because you’ve
 run out of items.



 On 5/17/10 11:12 PM, Richard Rodseth rrods...@gmail.com wrote:






 I think I already mentioned it was called twice. I can double-check
 tomorrow.

 On Mon, May 17, 2010 at 9:35 PM, Alex Harui aha...@adobe.com wrote:






 Set a breakpoint on setSelectionDataLoop.  See how

Re: [flexcoders] Script timeout binding selection in Tree

2010-05-18 Thread Richard Rodseth
Here's a corrected test case, where only the persistent uids are stored, and
selectedItems is computed.  The Restore Selection button works, the
collection event listener doesn't. It would be great if someone could give
this a whirl and confirm what I see. Not sure how this relates to the script
timeout, but I really need a reliable way to move the selection into the
model and bind to it.

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=vertical minWidth=955 minHeight=600

creationComplete=application1_creationCompleteHandler(event)


mx:Script
![CDATA[
import mx.collections.ArrayCollection;
import mx.events.CollectionEvent;
import mx.events.CollectionEventKind;
import mx.events.FlexEvent;
import mx.events.ListEvent;


[Bindable]
public var items:ArrayCollection = new ArrayCollection();

[Bindable(event=selectionChanged)]
public function get selectedItems():Array {
return toItems(_selectedIds);
}

private var _selectedIds:Array = [];

private function selectItems(items:Array):void {
_selectedIds = this.toIds(items);

dispatchEvent(new Event(selectionChanged));
}

protected function
application1_creationCompleteHandler(event:FlexEvent):void
{
items.addEventListener(CollectionEvent.COLLECTION_CHANGE,
itemsListener, false, 0, true);
}

private function itemsListener(event:CollectionEvent):void {
if (event.kind == CollectionEventKind.RESET) {
this.restoreSelection();
}
}

private function refresh():void {

this.items.source = [ { uid:1, name:Root, children: [ {
uid:2, name:Child } ] } ];

}

private function toIds(items:Array):Array {
var result:Array = new Array();
for each (var item:Object in items) {
result.push(item.uid);
}
return result;
}

private function toItems(ids:Array):Array {
var root:Object = this.items ? this.items.getItemAt(0) :
null;

var result:Array = new Array();
for each (var id:String in ids) {
var item:Object = find(root, id);
if (item) {
result.push(item);
}
}
return result;
}

private function toIndices(ids:Array):Array {
var root:Object = this.items ? this.items.getItemAt(0) :
null;

var result:Array = new Array();
for each (var id:String in ids) {
var item:Object = find(root, id);
if (item) {
var index:int = this.items.getItemIndex(item);
result.push(index);
}
}
return result;
}

private function restoreSelection():void {
//_selectedItems = toItems(_selectedIds);
dispatchEvent(new Event(selectionChanged));

}

private function find(start:Object, uid:String):Object {
if (start.uid == uid)
return start;
for each (var child:Object in start.children) {
var found:Object = this.find(child, uid);
if (found)
return found;
}
return null;
}


protected function tree1_changeHandler(event:ListEvent):void
{
this.selectItems(theTree.selectedItems);
}

protected function button1_clickHandler(event:MouseEvent):void
{
this.refresh();
}



]]
/mx:Script


mx:Tree id=theTree
 dataProvider={this.items}
 selectedItems={this.selectedItems}
 labelField=name
 allowMultipleSelection=true
 change=tree1_changeHandler(event)/

mx:Button label=Refresh click=refresh()/
mx:Button label=Restore Selection click=restoreSelection()/


/mx:Application


On Tue, May 18, 2010 at 12:24 PM, Richard Rodseth rrods...@gmail.comwrote:

 My bad (at least in this example). The selectedItems getter is incorrect.


 On Tue, May 18, 2010 at 12:15 PM, Richard Rodseth rrods...@gmail.comwrote:

 I've attempted to create a one-file test case, and while it doesn't
 exhibit the script timeout, the selection restoration does not work as part
 of the collection listener.
 Is it significant that selectedItems does not show up in code completion
 while selectedIndices does

Re: [flexcoders] Script timeout binding selection in Tree

2010-05-18 Thread Richard Rodseth
Thanks for testing.

At this point, I consider this a bug, that the tree does not display its
selection, when it is updated via binding of selectedItems, where the
property bound to is updated in response to a RESET of the data provider
collection.

My workaround might interest some people. It is inspired by the
pop-ups-with-presentation-manager pattern described by Theo Iconara
Hultberg here:

http://mate.asfusion.com/forums/topic.php?id=591

So, using BindingUtils.bindSetter,  I have a function in the view which
observes a status property in the presentation model. In the past, I have
also used the Observe tag from Adobe consulting for this sort of thing. The
observing function does the selection updating (though tree.selectedItems is
still bound as well). The status property in the presentation model is
updated when the collection is reset.

In order to get this to work, I *still* had to wrap the view-based selection
updating in a callLater(), which I hate, but such is life.


On Tue, May 18, 2010 at 6:20 PM, Oleg Sivokon olegsivo...@gmail.com wrote:



 If I rewrite it to SDK 4 (it's basically the same tree anyway), the
 collection event listener is called... well, I cannot see anything
 extraordinary in what it does to be honest.
  



[flexcoders] Script timeout binding selection in Tree

2010-05-17 Thread Richard Rodseth
I'm getting the following error:

Error: Error #1502: A script has executed for longer than the default
timeout period of 15 seconds.
at ?()
at 
mx.controls.treeClasses::HierarchicalViewCursor/moveNext()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\controls\treeClasses\HierarchicalViewCursor.as:449]
at 
mx.controls.listClasses::ListBase/setSelectionDataLoop()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:6455]
at 
mx.controls.listClasses::ListBase/commitSelectedItems()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:6360]
at mx.controls.listClasses::ListBase/set
selectedItems()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:2938]

I'm binding the selectedItems property of the tree to a model property.
I'm also trying to preserve the selection when the contents of the
data provider changes, so I have a COLLECTION_CHANGE listener which
builds a new selection array.
The combination of these two is somehow causing this error.
Any ideas what the cause might be, or how best to debug?


Re: [flexcoders] Script timeout binding selection in Tree

2010-05-17 Thread Richard Rodseth
Thanks. Without the binding the timeout does not occur, since that's what
causes the rather complex method ListBase.setSelectionDataLoop to be called.
I suspect that it might have to do with looking for a selected object that
is not part of the data provider collection, but that's only a temporary
situation, and adding a selectedItemsCompareFunction did not help.

Still digging...

On Mon, May 17, 2010 at 1:04 AM, Oleg Sivokon olegsivo...@gmail.com wrote:



 First of I'd remove all the bindings, because binding may be silencing
 errors ans than may be running in loop not knowing what to update first. I
 also think that you only copied the top of the error stack trace, could you
 tell if there was something looking like recursion, i.e. you would see
 repetitive blocks of stack frames.

 Best.

 Oleg
  



Re: [flexcoders] Script timeout binding selection in Tree

2010-05-17 Thread Richard Rodseth
I'm still stumped by this. Wish I had more information to add.
The use case is that the user is navigating (via a button and a bookmarking
mechanism I built) to a different screen, resulting in
a) a change of active tab
b) a refresh of the tree in that tab via asynchronous API call
c) selection of a specific item in that tree

Also, when on that screen, just clicking on different tabs should refresh
the data but not lose the selection.

So yes, I am more-or-less-simultaneously trying to update the contents of
the list and ensure the selection is not lost.

The TabNavigator's selected child, the tree's data provider and
selectedItems are all bound to presentation model properties.
The data provider has a CollectionChange listener to try to restore the
selectedItems property when the tree contents are changed.
Selection restoration works fine if I don't do the data refresh.
Navigation state change works fine if I don't do the selection restoration.
The two together, not so much.

On Mon, May 17, 2010 at 11:09 AM, Richard Rodseth rrods...@gmail.comwrote:

 Thanks. Without the binding the timeout does not occur, since that's what
 causes the rather complex method ListBase.setSelectionDataLoop to be called.
 I suspect that it might have to do with looking for a selected object that
 is not part of the data provider collection, but that's only a temporary
 situation, and adding a selectedItemsCompareFunction did not help.

 Still digging...


 On Mon, May 17, 2010 at 1:04 AM, Oleg Sivokon olegsivo...@gmail.comwrote:



 First of I'd remove all the bindings, because binding may be silencing
 errors ans than may be running in loop not knowing what to update first. I
 also think that you only copied the top of the error stack trace, could you
 tell if there was something looking like recursion, i.e. you would see
 repetitive blocks of stack frames.

 Best.

 Oleg
  





Re: [flexcoders] Script timeout binding selection in Tree

2010-05-17 Thread Richard Rodseth
Thanks for trying. No, the presentation model has an array collection whose
.source gets changed after an HTTPService call returns (although I should
mention that I am using my mock service layer at the moment). I added a a
collection change listener to the collection reference.
I have set a breakpoint in setSelectionDataLoop(). I hit it twice (the
parameters appear the same - index 0, items array containing the object to
select, useFind=false). Then the debugger stopped with the finally{} block
in Binding.watcherFired highlighted and the stack crawl below. Below this
stack crawl I've included the last few lines of the one that shows up in the
console.

Main Thread (Suspended: Error: Error #1502: A script has executed for longer
than the default timeout period of 15 seconds.)
mx.binding::Binding/watcherFired
mx.binding::Watcher/notifyListeners
mx.binding::PropertyWatcher/eventHandler
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]

com.companyname.admin.deviceshome.ui.presentation::DevicesHome/changeSelectedGroupIds


com.companyname.admin.deviceshome.ui.presentation::DevicesHome/groupsChangedListener

flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
mx.collections::ListCollectionView/dispatchEvent
mx.collections::ListCollectionView/
http://www.adobe.com/2006/flex/mx/internal::reset
mx.collections::ListCollectionView/set list
mx.collections::ArrayCollection/set source
anonymous
mx.rpc::Responder/result
anonymous
Array$/_forEach [no source]
Array/http://adobe.com/AS3/2006/builtin::forEach [no source]
anonymous
flash.utils::Timer/_timerDispatch [no source]
flash.utils::Timer/tick [no source]

Console:

Error: Error #1502: A script has executed for longer than the default
timeout period of 15 seconds.
at mx.controls.treeClasses::HierarchicalViewCursor/moveNext()
at
mx.controls.listClasses::ListBase/setSelectionDataLoop()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:6455]


On Mon, May 17, 2010 at 4:09 PM, Oleg Sivokon olegsivo...@gmail.com wrote:



 I wish I could help more... well here's another guess:
 - if you are using XML / XMLList, and have used insertBefore / isertAfter
 from the same XML / XMLList, then it is a known bug.
 - if you dispatch collectionChange on your own you might have messed
 something in the event's properties, which then will make the collection run
 in a loop thinking it's being updated over and over again. It is slow, but
 it isn't that slow to run out of script timeout limit :)
 Anyways, bindings are the first suspect in such case, but if that's not...
 ah, and, why won't you debug it? the debugger should be able to look into
 the framework sources. If, for whatever reason it doesn't, copy the Tree and
 other classes involved into your project and try debugging this way.

 Best.

 Oleg
  



[flexcoders] Re: Folder-style dragOver highlight on tree

2010-05-12 Thread Richard Rodseth
I'm now aware of dropIndicatorSkin and found an example that
customized the skin to do this:

g.beginFill(0xa1bde2, 0.5);
g.drawRect(-5, -1, w, 23);

which is obviously a bit, er, hard-coded.

The location and height for the skin appear to be set for drawing a
line between nodes. Recall that I just want to highlight the node
itself, as though it were being selected.

Tree.showDropFeedback and ListBase.showDropFeedback are quite large
methods (with side-effects) to be overriding. Is that my best option,
or can I have my skin access the tree node?

Recommendations or examples appreciated.I feel sure someone must have
used a tree to represent a folder hierarchy.
Thanks.




On Tue, May 11, 2010 at 3:40 PM, Richard Rodseth rrods...@gmail.com wrote:
 I'm maintaining some code which has a dragEnter handler which sets
 selectedIndex in order to highlight the destination tree node

 Can anyone point me at some sample code to do this, or a public method
 to highlight the item without selecting it? The showDropFeedback
 method draws a line between items, which is not the desired effect.

 Thanks.



Re: [flexcoders] Re: Folder-style dragOver highlight on tree

2010-05-12 Thread Richard Rodseth
Could you elaborate a bit, please? The component is already used with a
custom renderer. Are you suggesting that the dragEnter method should just do
the highlighting directly? Makes sense, I suppose.

On Wed, May 12, 2010 at 10:24 AM, Alex Harui aha...@adobe.com wrote:



 I would use a custom renderer.



 On 5/12/10 9:50 AM, Richard Rodseth rrods...@gmail.com wrote:






 I'm now aware of dropIndicatorSkin and found an example that
 customized the skin to do this:

 g.beginFill(0xa1bde2, 0.5);
 g.drawRect(-5, -1, w, 23);

 which is obviously a bit, er, hard-coded.

 The location and height for the skin appear to be set for drawing a
 line between nodes. Recall that I just want to highlight the node
 itself, as though it were being selected.

 Tree.showDropFeedback and ListBase.showDropFeedback are quite large
 methods (with side-effects) to be overriding. Is that my best option,
 or can I have my skin access the tree node?

 Recommendations or examples appreciated.I feel sure someone must have
 used a tree to represent a folder hierarchy.
 Thanks.

 On Tue, May 11, 2010 at 3:40 PM, Richard Rodseth rrods...@gmail.com 
 mailto:rrodseth%40gmail.com rrodseth%40gmail.com  wrote:
  I'm maintaining some code which has a dragEnter handler which sets
  selectedIndex in order to highlight the destination tree node
 
  Can anyone point me at some sample code to do this, or a public method
  to highlight the item without selecting it? The showDropFeedback
  method draws a line between items, which is not the desired effect.
 
  Thanks.
 





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



Re: [flexcoders] Re: Folder-style dragOver highlight on tree

2010-05-12 Thread Richard Rodseth
No, this is dragging items from a datagrid to a tree.

On Wed, May 12, 2010 at 10:43 AM, Baz li...@thinkloop.com wrote:



 Doesn't the node already highlight because you are rolling over it?
  



Re: [flexcoders] Re: Folder-style dragOver highlight on tree

2010-05-12 Thread Richard Rodseth
Though I strive to avoid subclassing the standard components, the code I
inherited already has a Tree subclass, so I added the following:

public function highlightItem(item:IListItemRenderer,
highlighted:Boolean):void {
this.drawItem(item, false, highlighted);
}

And call it from the renderer's dragEnter handler:

MyTreeSubclass(this.listData.owner).highlightItem(this, true);

Seems to be working OK.


On Wed, May 12, 2010 at 10:56 AM, Richard Rodseth rrods...@gmail.comwrote:

 No, this is dragging items from a datagrid to a tree.


 On Wed, May 12, 2010 at 10:43 AM, Baz li...@thinkloop.com wrote:



 Doesn't the node already highlight because you are rolling over it?
  





Re: [flexcoders] Re: Folder-style dragOver highlight on tree

2010-05-12 Thread Richard Rodseth
And of course I had to add to my renderers dragExit:

MyTreeSubclass(this.listData.

 owner).highlightItem(this,false );



On Wed, May 12, 2010 at 11:10 AM, Richard Rodseth rrods...@gmail.comwrote:

 Though I strive to avoid subclassing the standard components, the code I
 inherited already has a Tree subclass, so I added the following:

 public function highlightItem(item:IListItemRenderer,
 highlighted:Boolean):void {
 this.drawItem(item, false, highlighted);
 }

 And call it from the renderer's dragEnter handler:

 MyTreeSubclass(this.listData.owner).highlightItem(this, true);

 Seems to be working OK.



 On Wed, May 12, 2010 at 10:56 AM, Richard Rodseth rrods...@gmail.comwrote:

 No, this is dragging items from a datagrid to a tree.


 On Wed, May 12, 2010 at 10:43 AM, Baz li...@thinkloop.com wrote:



 Doesn't the node already highlight because you are rolling over it?
  






[flexcoders] Folder-style dragOver highlight on tree

2010-05-11 Thread Richard Rodseth
I'm maintaining some code which has a dragEnter handler which sets
selectedIndex in order to highlight the destination tree node

Can anyone point me at some sample code to do this, or a public method
to highlight the item without selecting it? The showDropFeedback
method draws a line between items, which is not the desired effect.

Thanks.


Re: [flexcoders] Re: mvc pattern for flex

2010-05-06 Thread Richard Rodseth
I like Mate, but the lack of type safety in the event map *is* an issue. But
I don't find dealing with imports an issue. When entering something like:

   MethodInvoker generator={ReportsManager} method=receiveData

I just delete the last two characters of ReportsManager and press
Control-Space.

On Thu, May 6, 2010 at 8:11 AM, Amy amyblankens...@bellsouth.net wrote:





 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Wally
 Kolcz wko...@... wrote:
 
  I love and am a big advocate for Mate. Simple to learn, lots of good
  built in tools, not MVC code in your views or business logic so if you
  want to change down the road, just pop it out and handle the events.

 My limited experience with Mate is that it does the opposite of what
 whoever wrote the code completion stuff in Flex Builder was expecting, so
 you wind up typing a lot of import statements and stuff that you could
 normally let the editor handle. It seems like this would eat up any time you
 might save by using this architecture.

  



[flexcoders] Overhead of curly braces :)

2010-05-06 Thread Richard Rodseth
Something I've always wondered.

If I wish to use a constant, rather than a literal

eg

view:DailyView day={Days.MONDAY} /

does the compiler know that this is not a bindable property, or does
it add unnessary listeners?


Re: [flexcoders] Bindable metadata tag event name

2010-05-02 Thread Richard Rodseth
Either I'm not following, or you have something else wrong.
If a model object (or the MXML component itself) has a property with custom
getter and setter as I showed, you can most certainly say

mx:Text text = {model.txt}/

or

mx:Text text = {this.txt} /

Of course I'm referring to one-way binding - I have not yet played with
binding in Flex 4.

On Sat, May 1, 2010 at 10:21 PM, sasuke uzumaki.naruto...@gmail.com wrote:




 Hi,

 Yes, even I've done that. But my main gripe is that when you have a
 Bindable
 tag with your custom event name, is it not possible to use it directly with
 any custom/built-in flex control?


 [Bindable(myEvent)]
 private var txt:String = HI;

 mx:Text text={txt} / // is this not possible if I use custom events?

 I've always used plain bindable tags but I'd like to know whether I can
 achieve the same auto-updation functionality when it comes to using
 bindable
 tags with custom events.

 Regards,
 sasuke


 Richard Rodseth wrote:
 
  I've never looked at the implementation. When I do this, I create a
 custom
  getter and setter:
 
  [Bindable(fooChanged)]
  public function get foo():Boolean {
  return _foo;
  }
 
  public function set foo(value:Boolean):void {
  if (value != _foo) {
  _foo = value;
  dispatchEvent(new Event(fooChanged))
  }
  }
 
  Note that you can also have computed properties based on multiple
  properties:
 
  [Bindable(fooChanged)]
  [Bindable(barChanged)]
  public function get foobar():Boolean {
  return _foo  _bar;
  }
 
 
 
  On Sat, May 1, 2010 at 12:54 PM, sasuke 
  uzumaki.naruto...@gmail.comuzumaki.naruto.is%40gmail.com
 
  wrote:
 
 
 
 
  Hi folks,
 
  The Bindable metadata tag allows an optional event name to be specified
  which would be event name that would be dispatched when the property in
  consideration changes. I've read somewhere that specifying a distinct
  event
  name for each bindable property reduces the performance overhead (less
  work
  for BindingUtils or so it seems, I can't seem to find the actual
  implementation detail). But this doesn't work with bindable properties
  when
  used with flex controls. For e.g. this *works*
 
  mx:Script
  [Bindable]
  private var txt:String = HI;
 
  private function onCreationCompleteDone(event:Event):void
  {
  txt = Changed text!;
  }
  /mx:Script
  mx:Text text={txt} /
 
  This doesn't (notice the event name specified):
 
  mx:Script
  [Bindable(myEvent)]
  private var txt:String = HI;
 
  private function onCreationCompleteDone(event:Event):void
  {
  txt = Changed text!; // Never called!
  }
  /mx:Script
  mx:Text text={txt} /
 
  I did try analyzing the autogenerated AS files; the ones generated when
 I
  use simple [Bindable] is pretty easy to understand since it generates
  plain
  getter and setter for the `txt` property but when I use
  [Bindable(someEvent)], the code generated is a bit cryptic with the
  stuff
  with Watchers and all that.
 
  Would someone be kind enough to shed some light on this matter? How this
  all
  this Bindable stuff work under the hood?
 
  TIA,
  sasuke
  --
  View this message in context:
 
 http://old.nabble.com/Bindable-metadata-tag---event-name-tp28422913p28422913.html
  Sent from the FlexCoders mailing list archive at Nabble.com.
 
 
 
 
 

 --
 View this message in context:
 http://old.nabble.com/Bindable-metadata-tag---event-name-tp28422913p28424902.html

 Sent from the FlexCoders mailing list archive at Nabble.com.

  



Re: [flexcoders] Bindable metadata tag event name

2010-05-01 Thread Richard Rodseth
I've never looked at the implementation. When I do this, I create a custom
getter and setter:

[Bindable(fooChanged)]
public function get foo():Boolean {
  return _foo;
}

public function set foo(value:Boolean):void {
  if (value != _foo) {
_foo = value;
   dispatchEvent(new Event(fooChanged))
}
}

Note that you can also have computed properties based on multiple
properties:

[Bindable(fooChanged)]
[Bindable(barChanged)]
public function get foobar():Boolean {
  return _foo  _bar;
}



On Sat, May 1, 2010 at 12:54 PM, sasuke uzumaki.naruto...@gmail.com wrote:




 Hi folks,

 The Bindable metadata tag allows an optional event name to be specified
 which would be event name that would be dispatched when the property in
 consideration changes. I've read somewhere that specifying a distinct event
 name for each bindable property reduces the performance overhead (less work
 for BindingUtils or so it seems, I can't seem to find the actual
 implementation detail). But this doesn't work with bindable properties when
 used with flex controls. For e.g. this *works*

 mx:Script
 [Bindable]
 private var txt:String = HI;

 private function onCreationCompleteDone(event:Event):void
 {
 txt = Changed text!;
 }
 /mx:Script
 mx:Text text={txt} /

 This doesn't (notice the event name specified):

 mx:Script
 [Bindable(myEvent)]
 private var txt:String = HI;

 private function onCreationCompleteDone(event:Event):void
 {
 txt = Changed text!; // Never called!
 }
 /mx:Script
 mx:Text text={txt} /

 I did try analyzing the autogenerated AS files; the ones generated when I
 use simple [Bindable] is pretty easy to understand since it generates plain
 getter and setter for the `txt` property but when I use
 [Bindable(someEvent)], the code generated is a bit cryptic with the stuff
 with Watchers and all that.

 Would someone be kind enough to shed some light on this matter? How this
 all
 this Bindable stuff work under the hood?

 TIA,
 sasuke
 --
 View this message in context:
 http://old.nabble.com/Bindable-metadata-tag---event-name-tp28422913p28422913.html
 Sent from the FlexCoders mailing list archive at Nabble.com.

  



Re: [flexcoders] Re: Binding and square brackets

2010-04-30 Thread Richard Rodseth
without introducing an ArrayCollection

The data is an array and always changes atomically. Wrapping it in an
ArrayCollection is certainly one option.

On Fri, Apr 30, 2010 at 8:15 AM, Amy amyblankens...@bellsouth.net wrote:





 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Richard
 Rodseth rrods...@... wrote:
 
  I'm interested in getting rid of Data binding will not be able to
  detect changes when using square bracket operator without introducing
  an ArrayCollection.
  The view displays data for the seven days of the week. Not using a
  repeater (though one could).
 
  I invite opinions on the relative merits (performance/elegance) of the
  following:
 
  A) Split the data in the presentation model when the combined data comes
 in
 
  c:DailyView day=Monday data={model.mondayData}
  c:DailyView day=Tuesday data={model.tuesdayData}
 
  Obviously only an option because there are only seven days.
 
  B) Use a function in the view
 
  private function dailyData(combinedDailyData:Array, dayIndex:int) {
  return model.combinedData[day]; // could also use a dictionary
  }
 
  c:DailyView day=Monday data={this.dailyData(model.stuff, 0)}/
 
  C) A bindable non-getter in the presentation model
 
  c:DailyView day=Monday data={model.dataForDay(0)}/
 
  In the model:
  [Bindable(event=combinedDataChanged)]
  public function dataForDay(day:int):Array {
  return combinedData[day];
  }
 
  Obviously the setter for combinedData dispatches combinedDataChanged.
 
  I actually wasn't aware, or had forgotten, that C) is possible on a
  non-getter function until I tried it just now. I actually like this
  option because it encapsulates the storage used (array, dictionary,
  whatever). I think I just answered my own question.
 

 Had you considered just using getItemAt() on your ArrayCollection?

  



[flexcoders] Flashbuilder hang loading workbench

2010-04-30 Thread Richard Rodseth
Not a good way to end the week. FlashBuilder hangs loading the
workbench. Spinning beach ball, must Force Quit. Is there some cache I
can delete to get up and running again?
I saw a similar post on the flex forums from a few days ago, but no
one has responded.


[flexcoders] Binding and square brackets

2010-04-29 Thread Richard Rodseth
I'm interested in getting rid of Data binding will not be able to
detect changes when using square bracket operator without introducing
an ArrayCollection.
The view displays data for the seven days of the week. Not using a
repeater (though one could).

I invite opinions on the relative merits (performance/elegance) of the
following:

A) Split the data in the presentation model when the combined data comes in

c:DailyView day=Monday data={model.mondayData}
c:DailyView day=Tuesday data={model.tuesdayData}

Obviously only an option because there are only seven days.

B) Use a function in the view

private function dailyData(combinedDailyData:Array, dayIndex:int) {
return model.combinedData[day]; // could also use a dictionary
}

c:DailyView day=Monday data={this.dailyData(model.stuff, 0)}/

C) A bindable non-getter in the presentation model

c:DailyView day=Monday data={model.dataForDay(0)}/

In the model:
[Bindable(event=combinedDataChanged)]
public function dataForDay(day:int):Array {
  return combinedData[day];
}

Obviously the setter for combinedData dispatches combinedDataChanged.

I actually wasn't aware, or had forgotten, that C) is possible on a
non-getter function until I tried it just now. I actually like this
option because it encapsulates the storage used (array, dictionary,
whatever). I think I just answered my own question.


[flexcoders] Selection highlighting in Flashbuilder 4

2010-04-28 Thread Richard Rodseth
I just started using FB4 (standalone) for real work, and the selection
highlighting in the editor is driving me nuts. Is there some
preference I need to change? Basically, I get no highlighting when
dragging over text, until I release the mouse. I'm on OS X.


[flexcoders] State of the art JSON

2010-04-22 Thread Richard Rodseth
I've used AS3CoreLib's JSON encoding/decoding in the past, but some
code I'm maintaining now has custom JSON handling.
Note: we use ISO 8601 for Dates.

Looking at the Flashbuilder 4 data wizards (briefy), I see JSON
support and references to something call fiber, but am unclear
whether this is tied to LiveCycle, and whether it's Flex 4 specific.

So I guess I'm wondering what the best-practice is these days for JSON support
a) With Flex 3
b) With Flex 4

Thanks.


Re: [flexcoders] Drag and drop vs scrolling

2010-04-21 Thread Richard Rodseth
Thanks. I was able to fix the highlighting issue by modifying some code that
used listData.rowIndex to use  calculateDropIndex() instead. Autoscroll
doesn't work, but I can live with that.

On Tue, Apr 20, 2010 at 11:41 PM, Alex Harui aha...@adobe.com wrote:



 Some folks have tried making the renderer a drop target in order to add
 different meaning to dropping in folders.  In theory it should work, but I
 think I’d work from the Tree instead, and then I would expect autoscroll to
 work.



 On 4/20/10 3:31 PM, Richard Rodseth rrods...@gmail.com wrote:






 I inherited some code which supports drag and drop from a list to a
 node of a tree. Unfortunately it does not work when the tree is
 scrolled.
 Not only does the tree not autoscroll, but even if you scroll the
 target item into view before beginning the drag, incorrect nodes
 highlight.

 I didn't see any code that's doing coordinate transformations, but did
 notice that there is a custom TreeItemRenderer, which contains the
 listeners for dragEnter etc.
 I'm guessing this is the root of the problem, since renderers are recycled.

 I've no idea why things were done this way, and am wondering if this
 is a legitimate idiom, or if I need to start over with listeners
 defined at the Tree level.

 Also, is autoscroll supported if you do things the right way?





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



[flexcoders] Drag and drop vs scrolling

2010-04-20 Thread Richard Rodseth
I inherited some code which supports drag and drop from a list to a
node of a tree. Unfortunately it does not work when the tree is
scrolled.
Not only does the tree not autoscroll, but even if you scroll the
target item into view before beginning the drag, incorrect nodes
highlight.

I didn't see any code that's doing coordinate transformations, but did
notice that there is a custom TreeItemRenderer, which contains the
listeners for dragEnter etc.
I'm guessing this is the root of the problem, since renderers are recycled.

I've no idea why things were done this way, and am wondering if this
is a legitimate idiom, or if I need to start over with listeners
defined at the Tree level.

Also, is autoscroll supported if you do things the right way?


Re: [flexcoders] Exceeding Flash's Capabilities?

2010-04-14 Thread Richard Rodseth
How many items are you (and the Excel user) talking about?
What sort of Flex charts are you using?
Are you using AMF, XML or JSON to retrieve the data?

On Wed, Apr 14, 2010 at 3:48 PM, trefalgar trefal...@yahoo.com wrote:



 The majority of my flex work revolves around graphing data. If for some
 reason a user picks a lot of statistics to graph, over an even longer period
 of time, the amount of data that comes back to the Flash application
 overwhelms flash, consuming all of the boxes resources and regularly
 crashing the browser.

 Is there anything in the developers bag of tricks to help with this kind of
 problem, or is the sheer amount of data too much for the
 application/SDK/solution to handle?

 I understand I can put a limit on the amount of data returned, but as the
 user states, I can pull it out of the database, via Excel, and it works.

 Tref

  



Re: [flexcoders] Re: Property values based on Multiple Conditions

2010-04-13 Thread Richard Rodseth
I did a little Googling for you:

http://twopointoh.vox.com/library/post/boolean-operations-in-mxml.html

Depending on what you are building, the Presentation Model pattern may be
overkill, but it's worth knowing about.

On Tue, Apr 13, 2010 at 12:28 AM, Doug doug_pie...@ymail.com wrote:





 Awesome stuff guys!!

 The amp; thing didn't work for me when I tried that... I thought just
 maybe, but nah. This was part of the source of my question, How do you do a
 logical AND?

 The function method that Richard posted is something I am going to try as I
 think that's exactly what I'm looking for. I would like to avoid setting up
 an event listener, but if that's the only way...

 Thanks again for the help thus far... if anybody has anything else, please
 let me know!


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Richard
 Rodseth rrods...@... wrote:
 
  Rick is correct. You can also use a local binding function like this:
 
  s:Button enabled={enableButton(showMe, hideMe)}/
 
  where enableButton is a function in your Script block that takes two
 boolean
  parameters.
 
  Or, if you have a presentation model, it could have a computed property
  buttonEnabled
 
  s:Button enabled={model.buttonEnabled}/
 
  Excerpt of presentation model:
 
  [Bindable(event=showMeChanged)]
  [Bindable(event=hideMeChanged)]
  public function get buttonEnabled():Boolean {
  return showMe  hideMe;
  }
 
  public function set showMe(value:Boolean):void {
  if (value != this.showMe) {
  this.showMe = value;
  dispatchEvent(new Event(showMeChanged));
  }
  }
 
  Hope this helps.
 
 
  On Mon, Apr 12, 2010 at 4:31 PM, Rick Genter rick.gen...@... wrote:
 
  
  
  
   On Apr 12, 2010, at 10:31 AM, Doug wrote:
  
I seem to have little success with this and would like to know other
 ways
   of accomplishing what I want to do.
   
I'm trying to enable/disable a button based on two pieces of
 criteria. It
   would seem that a logical OR or a logical AND would bridge these much
 like
   an IF statement, however, I'm struggling to make it work 100%.
   
Consider a button:
   
s:Button enabled={showMe || hideMe}/
   
This button's enabled property is based upon the binding of the
 variables
   for showMe and hideMe. If showMe or hideMe is true then the button
 is
   enabled. This works fine when using a logical OR. However, the
 following -
   using a logical AND - does not:
   
s:Button enabled={showMe  hideMe}/
   
How do you do a logical AND?? Also, if I wanted to set showMe and
 hideMe
   based on several lines of code how would I best do it? How would you
 bind a
   function output to a display object? I only see a way to do it based
 upon
   event:
   
[Bind (event: some event here]
private function myFunction():void{}
   
Thanks in advance!!
  
   I haven't tried this, but I suspect that you are being bitten by XML.
 Try
   this:
  
   s:Button enabled={showMe amp;amp; hideMe}/
  
   --
   Rick Genter
   rick.gen...@... rick.genter%40gmail.com
  
  
  
 

  



[flexcoders] Variable-height popup

2010-04-12 Thread Richard Rodseth
In the context of:

mx:PopUpButton
  mx:popup
 mx:VBox
 
 /mx:VBox
  /mx:popup
/mx:PopUpButton

Is there a simple way to give the popup a height of, say, 50% of the
current application height, along with a min and max height?


Re: [flexcoders] Property values based on Multiple Conditions

2010-04-12 Thread Richard Rodseth
Rick is correct. You can also use a local binding function like this:

s:Button enabled={enableButton(showMe, hideMe)}/

where enableButton is a function in your Script block that takes two boolean
parameters.

Or, if you have a presentation model, it could have a computed property
buttonEnabled

s:Button enabled={model.buttonEnabled}/

Excerpt of presentation model:

[Bindable(event=showMeChanged)]
[Bindable(event=hideMeChanged)]
public function get buttonEnabled():Boolean {
  return showMe  hideMe;
}

public function set showMe(value:Boolean):void {
   if (value != this.showMe) {
  this.showMe = value;
  dispatchEvent(new Event(showMeChanged));
   }
}

Hope this helps.


On Mon, Apr 12, 2010 at 4:31 PM, Rick Genter rick.gen...@gmail.com wrote:




 On Apr 12, 2010, at 10:31 AM, Doug wrote:

  I seem to have little success with this and would like to know other ways
 of accomplishing what I want to do.
 
  I'm trying to enable/disable a button based on two pieces of criteria. It
 would seem that a logical OR or a logical AND would bridge these much like
 an IF statement, however, I'm struggling to make it work 100%.
 
  Consider a button:
 
  s:Button enabled={showMe || hideMe}/
 
  This button's enabled property is based upon the binding of the variables
 for showMe and hideMe. If showMe or hideMe is true then the button is
 enabled. This works fine when using a logical OR. However, the following -
 using a logical AND - does not:
 
  s:Button enabled={showMe  hideMe}/
 
  How do you do a logical AND?? Also, if I wanted to set showMe and hideMe
 based on several lines of code how would I best do it? How would you bind a
 function output to a display object? I only see a way to do it based upon
 event:
 
  [Bind (event: some event here]
  private function myFunction():void{}
 
  Thanks in advance!!

 I haven't tried this, but I suspect that you are being bitten by XML. Try
 this:

 s:Button enabled={showMe amp;amp; hideMe}/

 --
 Rick Genter
 rick.gen...@gmail.com rick.genter%40gmail.com

  



[flexcoders] Flash Builder Subversive

2010-03-25 Thread Richard Rodseth
I'm referring to the Subversion Eclipse plug-in.

Has anyone installed it in Flash Builder? I found a blog post about
Subclipse, but not Subversive.
I *really* wish Flash Builder had subversion support built-in...


Re: [flexcoders] Flash Builder Subversive

2010-03-25 Thread Richard Rodseth
I use Flexbuilder 3 plug-in the same way, but always seem to have trouble
with installation, so I'm thinking of switching to the the standalone
version this time. I just installed Subclipse - maybe I'll give it a try.

http://blogs.adobe.com/jasonsj/2010/03/installing_subclipse_in_flash_builder_4.html

On Thu, Mar 25, 2010 at 10:40 AM, Julien Nicoulaud primo...@gmail.comwrote:



 Of course, Flash Builder is just an Eclipse plugin. I use it with
 Subversive and many other Eclipse plugins without any conflict.

 2010/3/25 Richard Rodseth rrods...@gmail.com



 I'm referring to the Subversion Eclipse plug-in.

 Has anyone installed it in Flash Builder? I found a blog post about
 Subclipse, but not Subversive.
 I *really* wish Flash Builder had subversion support built-in...


  



Re: [flexcoders] Re: Framework Choice

2010-03-24 Thread Richard Rodseth
I've been pretty happy with Mate and the Presentation Model pattern. My main
issue is the lack of type-safety in the event maps, so at some point I
should check out Swiz, Parsley etc.

On Wed, Mar 24, 2010 at 10:00 AM, Oleg Sivokon olegsivo...@gmail.comwrote:



 If you know there are Cairngorm and Mate, you can be sure, you can write
 one of your own. And if you used either one of those even briefly, you can
 write a better one. This said, my choice would be none. I'm writing that
 myself, and, you just cannot imagine my happiness - two days ago I finally
 removed the last Cairngorm piece from the big project I inherited long ago
 and had a hell of a time refactoring.
 Don't make yourself a victim of other short-witted programmers, unless you
 absolutely must. Your own errors are much easier to fix, especially, if you
 work alone or with a small team.

 Best.

 Oleg
  



  1   2   3   4   5   6   7   >