[flexcoders] Re: Debugger disconnects for one project only

2008-10-03 Thread JWOpitz
That fixed it.  Thanks for the suggestion.



[flexcoders] Re: Debugger disconnects for one project only

2008-10-02 Thread JWOpitz
Forgot to mention that I also removed and reinstalled the debug player
with no luck as well.



[flexcoders] Debugger disconnects for one project only

2008-10-02 Thread JWOpitz
I just started experiencing this issue recently.  A certain project I
am working on which is basically a very simple Flex application.  The
only thing that is different than any other Flex application is that
it is deployed to a local web server.  Nothing unique, in fact almost
all of my flex projects are deployed in this manner.  

Anyway this project in particular, when launched in debug mode,
immediately kills the debugger version of Flash player in FF.  It
works fine in Safari.  But the FF version disconnects from the
debugger as soon as it loads in the browser.  I have deleted the
project and rebuilt it from the SVN repo with no luck.

Any suggestions are much appreciated.  Thanks.



[flexcoders] Re: Flex is time consuming

2008-08-18 Thread JWOpitz
I also believe that Adobe needs to kick it into gear and come out
with a patch ASAP that addresses the, from my experience, the absolute
slowest compiler on the planet.

If you haven't already, learn to use the command-line compiler and an
ANT script then.  I don't think it is nearly as slow as the Flex
Builder compiler.  3-7 seconds to compile via ANT is pretty fast to me.



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

 Although I agree that 16000 lines of code broken between only 7
 classes certainly seems like a further break down of code into smaller
 classes is necessary, I also believe that Adobe needs to kick it into
 gear and come out with a patch ASAP that addresses the, from my
 experience, the absolute slowest compiler on the planet.  Also with
 that, they need to get a patch out that doesn't go into a full
 workspace build just because I make a small change to a class.  I've
 even simply added a space and saved which caused a full workspace
 build.  To me, placing this as a top priority for Flex 4 is great and
 I thank them for that, but that doesn't help me now.  My single
 greatest productivity killer right now is having to wait 60-90 seconds
 everytime I save a file.
 
 
 
 --- In flexcoders@yahoogroups.com, Howard Fore howard.fore@ wrote:
 
  Sounds like you need to break it down further...
  
  On Mon, Aug 18, 2008 at 9:30 AM, litesh_b321 litesh_b321@ wrote:
  
   Hi gyus
   i have around 16000 line of code
   which is already broke up in two mxml file and five class file
  
  
  
  -- 
  Howard Fore, howard.fore@
  The universe tends toward maximum irony. Don't push it. - Jeff
Atwood
 





[flexcoders] Re: Numbers gone crazy: 5 - 4.8 = 0.2000000000000018 ?

2008-07-21 Thread JWOpitz
My buddy Mike had just written a blog posting on this -
http://mikeorth.com/?p=8

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

 this is well discussed and a side effect of dealing with Floats
 
 On Mon, Jul 21, 2008 at 12:03 PM, Kuldeep Atil [EMAIL PROTECTED]
 wrote:
 
well, u can use number.tofixed(2);
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
b_alen
  alen.balja@ wrote:
  
   Here is how I arrived at this:
  
   var res:Number;
  
   var a:Number = 5;
   var b:Number = 4.8;
  
   res = a - b;
   trace(result:  + res + , a:  + a + , b:  + b);
  
  
   The trace clearly shows that the value of a is 5, and the value of b
   is 4.8. However the end result is clearly shown as
  0.2018.
  
   Ok, I wanted to create a workaround where I will make sure that b is
   really 4.8, and I used toPecision() method.
  
   var b1:String = b.toPrecision(2);
   var b2:Number = Number(b1);
   trace(b1:  + b1 + , b2:  + b2);
  
   res = a - b2;
   trace(result:  + res + , b1:  + b1 + , b2:  + b2);
  
  
   Again with same result. b2 was traced as 4.8, but the end result
  still
   showing 0.2018. As this can of course break all further
   calculations I had to make sure result is really holding a value
  that
   it should, based on all mathematical logic. So I did this:
  
   var res1:String = res.toPrecision(2);
   res = Number(res1);
  
   trace(result:  + res);
  
   I got the expected result and the value of res is now 0.2.
  
   This is however very ugly, in case I'm not doing something wrong.
   Every time we expect a floating point value in our calculation we
  have
   to handle it to ensure the proper value is calculated, because what
   Flash calculates is just wrong. Also, every intermediate calculation
   has to be stored in a variable converted to String with toPrecision
   and back to Number for future use. I really don't know how to
  properly
   handle this and would appreciate any advice. Imagine the shopping
  cart
   system with this sort of unpredictable behavior.
  
   For the end, here's one more weirdness:
  
   var c:Number = 488.8;
  
   trace(c:  + c +  , c.toPrec:  + c.toPrecision(2));
  
  
   Traces out c: 4.8, c.toPrec: 4.9e+2
  
  
  
  
   Thanks,
  
   Alen
  
  
  
  
  
  
  
  
  
  
   var c:Number = 488.8;
  
 
   
 
 
 
 
 -- 
 j:pn
 \\no comment





[flexcoders] Re: synchronous events in flex

2008-06-28 Thread JWOpitz
There are many ways to do what you are looking for, though in a
asyncronous manner.  Ralf suggested binding a view to a prop on the
model, upon updating will update the view.  That is probably the most
OO way of doing it within the MVC framework.  But it also is harder to
do more view-specific validation.  As for disallowing the user to
interact with the app until a response is received, you could
basically have your app in a disabled mode until your IResponder
triggers on the response.  Upon result or fault tell the model to
allow further interaction and subsequent validation if applicable.

Awhile back I wrote some articles on doing just this when your design
requires a bit more in terms of validation and error handling.  You
can read up on it here.  Would be interested in your thoughts as well.

http://jwopitz.wordpress.com/2008/04/24/tutorial-handling-service-validation-errors-cairngorm/

http://jwopitz.wordpress.com/2008/04/25/tutorial-handling-service-validation-errors-cairngorm-part-2/

http://jwopitz.wordpress.com/2008/04/25/tutorial-handling-service-validation-errors-cairngorm-part-3/

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

 You could either set a bindable property on your model,
 or pass in a object, which does the result handling.
 
 Cheers
 Ralf.
 
 On Sat, Jun 28, 2008 at 8:09 PM,  [EMAIL PROTECTED] wrote:
  You mean if i have to display an alert message 'Customer name already
  exists' them i have to put this code in result method as follows,
Basically
  this is Command class which implements IResponder .
 
  public function result( event : Object ) : void
  {
  // Some processing
  Alert.show( 'Name XYZ Already Exists' ) ;
  CursorManager.removeBusyCursor();
  Application.application.enabled =true ;
  }
  If you meant this then don't you think it is not good design , now
suppose
  if instead of Alert message i am going to display inline error
message on
  the view then i have to access view in my command class to display
error
  message.
  ,
 
  - Original Message -
  From: Paul Andrews [EMAIL PROTECTED]
  To: flexcoders@yahoogroups.com
  Sent: Sat, 28 Jun 2008 19:00:07 +0100
  Subject: Re: [flexcoders] synchronous events in flex
 
  - Original Message -
  From: [EMAIL PROTECTED]
  To: flexcoders@yahoogroups.com
  Sent: Saturday, June 28, 2008 2:54 PM
  Subject: [flexcoders] synchronous events in flex
 
 
   Hi
   Can anyone tell me how to write synchronous events in flex
application?
 
  There are no synchronous events.
 
   I am calling an Httpservice on focus out event of text field this
   service
   checks name duplication. I want my application to wait for
service to
   finish and then do some processing
 
  Supply a result handler for the httpservice and put your code in
that. It
  will be called asynchronously when the result is ready.
 
  Flex doesn't do waiting, except through event handlers.
 
   Thanks in advance
 
  Paul
 





[flexcoders] Re: How to use WebServices in Flex 3?

2008-05-23 Thread JWOpitz
--- In flexcoders@yahoogroups.com, barry.beattie [EMAIL PROTECTED]
wrote:

  Well I prefer not to mess with the generated code, for the maintenance
  sake.
  
  Robert
 
 dumb question time...
 
 how do you guys usually manage the generated code when the webserver
 target moves from, say, development to a production environment and
 the soap address changes?
 
 (since part of the soap address is used in the generated code's
 package name and even the event types)
 
 
 refactor all the generated code via Flex Builder?
 generate it again when the WSDL changes?
 something else?


Something I did at a financial institute was to store the URLs in an
XML file.  I'd have a section for pred and a section for dev.  And I
would just comment them out for whatever environment was used.  Then I
would use AppCoreLib to load the xml and reference the keys in the
appCoreLib.business.Settings.getInstance().getURL(key) to
dynamically set the web service urls.






[flexcoders] Re: How to use WebServices in Flex 3?

2008-05-23 Thread JWOpitz
forgot to give the link - http://code.google.com/p/appcorelib/

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

  Well I prefer not to mess with the generated code, for the maintenance
  sake.
  
  Robert
 
 dumb question time...
 
 how do you guys usually manage the generated code when the webserver
 target moves from, say, development to a production environment and
 the soap address changes?
 
 (since part of the soap address is used in the generated code's
 package name and even the event types)
 
 
 refactor all the generated code via Flex Builder?
 generate it again when the WSDL changes?
 something else?





[flexcoders] Re: Flex + AMFPHP + POG?

2008-03-12 Thread JWOpitz
Here is a link to the tutorial -
http://jwopitz.wordpress.com/2008/03/12/tutorial-flex-amfphp-pog/

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

 Alrighty folks.  I got this figured out.  With some help from a fellow
 at Adobe, I got Flex + AMF + POG running smoothly.  I will post back
 once I get a tutorial on my blog up for doing this.
 
 --- In flexcoders@yahoogroups.com, JWOpitz jwopitz@ wrote:
 
  Hi Troy.
  
  I have tried to use the PHP5 w/o the PDO driver (instead they built
  their own MySQL DB layer) and it never seemed to even get as far as
  reading the config file for it.  I didn't spend a whole lot of time
  going down that road but I may revisit it.
  
  If you happen to get POG working with AMFPHP, please let me know your
  setup as I would love to get it working.  I really want to use POG too
  for the same reasons you mention.  It seems super light weight and for
  a non PHP person, very easy to follow the framework.  CakePHP just
  seems like too much for me. But if I can't get this working, I may
  have to revisit it as well.
  
  J
  
  --- In flexcoders@yahoogroups.com, Troy Gilbert troy.gilbert@
  wrote:
  
 I know the config for my AMFPHP is setup as I can hit other
 services
 on it that make use of manual queries. I have no idea where the
 problem lies. The only other hint I can provide is that awhile
 back I
 had run into an issue where AMFPHP would say it had issues
  finding the
 MySQL PDO driver (which POG makes use of). However I know I have
 those drivers installed because a) I can use the local POG
 setup app
 to test for dependencies and b) I see the drivers in the
phpInfo()
   
   Have you tried using POG without PDO (with its pre-5.1 data layer)?
   There may be some compatibility issues between AMFPHP and PDO?
   
   I've not seen POG before, but am intrigued by it. I've been looking
   for a really lightweight system for working with MySQL in PHP. I'm
   currently using CakePHP, which is great, but it's way heavier than I
   need because my server-side model is very simple and I'm not
using any
   of the view infrastructure.
   
   Troy.
  
 





[flexcoders] Re: Flex + AMFPHP + POG?

2008-03-11 Thread JWOpitz
Alrighty folks.  I got this figured out.  With some help from a fellow
at Adobe, I got Flex + AMF + POG running smoothly.  I will post back
once I get a tutorial on my blog up for doing this.

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

 Hi Troy.
 
 I have tried to use the PHP5 w/o the PDO driver (instead they built
 their own MySQL DB layer) and it never seemed to even get as far as
 reading the config file for it.  I didn't spend a whole lot of time
 going down that road but I may revisit it.
 
 If you happen to get POG working with AMFPHP, please let me know your
 setup as I would love to get it working.  I really want to use POG too
 for the same reasons you mention.  It seems super light weight and for
 a non PHP person, very easy to follow the framework.  CakePHP just
 seems like too much for me. But if I can't get this working, I may
 have to revisit it as well.
 
 J
 
 --- In flexcoders@yahoogroups.com, Troy Gilbert troy.gilbert@
 wrote:
 
I know the config for my AMFPHP is setup as I can hit other
services
on it that make use of manual queries. I have no idea where the
problem lies. The only other hint I can provide is that awhile
back I
had run into an issue where AMFPHP would say it had issues
 finding the
MySQL PDO driver (which POG makes use of). However I know I have
those drivers installed because a) I can use the local POG
setup app
to test for dependencies and b) I see the drivers in the phpInfo()
  
  Have you tried using POG without PDO (with its pre-5.1 data layer)?
  There may be some compatibility issues between AMFPHP and PDO?
  
  I've not seen POG before, but am intrigued by it. I've been looking
  for a really lightweight system for working with MySQL in PHP. I'm
  currently using CakePHP, which is great, but it's way heavier than I
  need because my server-side model is very simple and I'm not using any
  of the view infrastructure.
  
  Troy.
 





[flexcoders] Re:Drag and Drop issues

2008-02-21 Thread JWOpitz
this is a shameless plug but what the hell.  You could certainly look
at the dNdLib for some guidance in dragging and dropping content.

http://code.google.com/p/flex-drag-n-drop-lib/

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

 I've got it working... you have to make sure there is a background,
which
 can just have it's alpha set to 0, but it needs to be there for the
 component to register the event.
 
 On Thu, Feb 21, 2008 at 12:29 PM, Jon Harris [EMAIL PROTECTED] wrote:
 
 
  Hi, this is just a quick stab at your problem:  maybe have the parent
  component that gets fired up or excited by the event do some 'hit
testing'
  on it's children, and do some sort of further dispatch or
signalling from
  there to the appropriate child component.
 
  I haven't noticed a 'z-order' property on the Flex components, but
I would
  have though that would be what was needed to bring components to
the 'top'
  or 'front'... maybe the alpha value  puts a  wonkiness into that.
 The hit
  test would have to be shared in proportion to the alpha channel
value
  no?
 
 
 
  --
  Be a better friend, newshound, and know-it-all with Yahoo! Mobile.
Try it
 
now.http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
  
 





[flexcoders] Re: handling events from embedded swf assets

2008-02-08 Thread JWOpitz
Its Interesting the way loading and unloading of swfs work in flash9.

Also, remember I am loading into a FLEX application not another Flash app.



[flexcoders] Re: handling events from embedded swf assets

2008-02-08 Thread JWOpitz
Inside the FLA, on the particular symbol in question, I have
dispatchEvent(new Event(movieClipStopped, true, true));  This is
supposed to bubble up as far as it can go.

On the flex app I have registered to listen for that event, to do
something as simple as putting a break point there.

Nothing happens.  So is there another way of registering for this
event that I am not getting?

Also keep in mind, this symbol is embedded via the [Embed] tag rather
than just the swf.  Does this play a part?  I am really hoping this is
a simple matter of some syntax since you say it is possible.

Thanks,
j


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

 Its definitely possible.
 
 of course you have to register to listen to it.
 
 
 Its Interesting the way loading and unloading of swfs work in flash9.
 
 You probably already know, but the swf is unloaded after it is loaded  
 automatically.
 watch the console.
 
 to clean it up all you need to do is remove the references to what's  
 been loaded in.
 
 
 
 On 08/02/2008, at 10:30 AM, JWOpitz wrote:
 
  I have a as3 swf w/ various movie clip assets in it. Some of them are
  dispatching bubbling events that I want to listen for in order to
  unload those assets afterwards.
 
  In the flex app I have an AssetImporter class that has bindable prop
  like so:
 
  [Bindable]
  [Embed(source=assets/swf/someSwf.swf, symbol=someMC)]
  public var someSprite:Class;
 
  Now on the end frame of the someMC, its dispatching a new
  Event(movieClipEnded, true, true);
 
  I want to be able to listen to this from the Flex app and load a
  different embedded asset after the event is dispatched. On the app I
  am listening for an event of the same type which is expected to be
  bubbling up through the display architecture.
 
  a) is this possible, it doesn't seem likely since Flex seems to be
  ignoring it and the mc fails to stop()
 
  b) if so, what is the syntax for doing so?
 
 
 





[flexcoders] handling events from embedded swf assets

2008-02-07 Thread JWOpitz
I have a as3 swf w/ various movie clip assets in it.  Some of them are
dispatching bubbling events that I want to listen for in order to
unload those assets afterwards.

In the flex app I have an AssetImporter class that has bindable prop
like so:

[Bindable]
[Embed(source=assets/swf/someSwf.swf, symbol=someMC)]
public var someSprite:Class;

Now on the end frame of the someMC, its dispatching a new
Event(movieClipEnded, true, true);

I want to be able to listen to this from the Flex app and load a
different embedded asset after the event is dispatched. On the app I
am listening for an event of the same type which is expected to be
bubbling up through the display architecture.

a) is this possible, it doesn't seem likely since Flex seems to be
ignoring it and the mc fails to stop()

b) if so, what is the syntax for doing so?



[flexcoders] Re: Adding Event to Object that doesnt have one

2008-02-05 Thread JWOpitz
Well to answer your first question: How do I add events to an item
that does not have any? -  your object can implement the
IEventDispatcher interface or you can extend EventDispatcher.  Either
way is the only way that you are going to get your object to be able
to make use of the Flash Player's event system.

I really can't answer your second question with any authority since I
haven't done much with Flex Charts.  I think from what code I did have
to work on, it was pretty much a situation where you retrieve the x,y
coords of the mouse relative to the whole chart.  I could be wrong at
various points but I think that is the only way I have seen it done.

Justin


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

 I'm new to flex so there may be an obvious way to do this that I am
 missing.
  
 In my charts, my users want to drill down from the month view to the
 days of month view by clicking on the month name (categoryAxis,
 categoryfield) for the horizontal axis.
  
 However, from what I can see CategoryAxis has no mouse events (or any
 other events) associated with it.  So my question is specific but may
 have broad application.
  
 1.  How do I add events to an item that does not have any?
 2.  How do I associate this event with a layout on the screen where the
 object seemingly keeps no reference to position?
  
 The only thing I can think of is pursuing looking at the fully rendered
 chart, figuring out x and y coordinates of the items (from an eyes on
 view),  and then making areas of the screen clickable (and able to
 generate events).   This does not seem very generic though and seems
 heavily dependent up on eyes on the screen (which seems fraught with
 peril to me).
  
 Suggestions? 
  
 Since I'm new to flex, it would really help me if the answer could be
 tied specifically to the categoryAxis issue thats stumping me.
  
 brad





[flexcoders] Re: Cairngorm AMFPHP

2007-12-19 Thread JWOpitz
Hi Steve,

Thanks for the feedback.  To answer some questions and to ask more
here I go:

1. Yes I am using the RemoteClass tag however I am not using the
registerClassAlias function.  Hadn't heard anything about using it but
will look into it.  So does that work in conjunction with the Metadata
tag?  How exactly are you utilizing the import?

2. My commands do the same thing (I scrapped the whole Cairngorm
delegate thing) so I think that should be fine.

3. Nope, never did that so that might help too.


Wow, I am really surprised by the lack of documentation or rather the
wealth of misinformation.  All the examples I was looking at never
mentioned any of this.  Nor did they really pose the issue in the
framework of Flex and Cairngorm.

Thanks,
Justin

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

 I use AMFPHP no issues here... my Objects transfer just fine
 
 1.Have you registered the class alias in your UserVO.as?
 
 import flash.net.registerClassAlias;  
 [RemoteClass(alias=UserVO)]
 
 
 2.My service calls in my delegates look like this.
 
 public function getUser(vo:UserVO):void
 {
   var token:AsyncToken = this.service.getUser(vo);
   token.addResponder(this.responder);
 }
 
 3. Did you set the classMappingsPath in gateway.php?
 
 $gateway-setClassMappingsPath(my/path/to/voDir/);
 
 
 
 steve
 
 
 
 --- In flexcoders@yahoogroups.com, JWOpitz jwopitz@ wrote:
 
  an update to this:
  
  I ended up dropping the casting to the UserVO.php.  So the function
  signature looks like:
  
   function getUser ($user){}
  
  rather than 
  
   function getUser (UserVO $user){}
  
  then inside the new function I set the type to an object using:
  
   settype(user, object);
  
  this allows the php function to be able to retrieve the object
  propeties such as $user-name or $user-password since it sees it as
  an object rather than the array flex likes to send.
  
  Though this works, it doesn't sit well with me because I thought the
  whole idea of remoting was to be able to pass classes around without
  having to do these kind of work arounds.
  
  If anyone has any ideas on this, please give me a shout.
  
  Thanks,
  J
 





[flexcoders] Re: Cairngorm AMFPHP

2007-12-18 Thread JWOpitz
an update to this:

I ended up dropping the casting to the UserVO.php.  So the function
signature looks like:

 function getUser ($user){}

rather than 

 function getUser (UserVO $user){}

then inside the new function I set the type to an object using:

 settype(user, object);

this allows the php function to be able to retrieve the object
propeties such as $user-name or $user-password since it sees it as
an object rather than the array flex likes to send.

Though this works, it doesn't sit well with me because I thought the
whole idea of remoting was to be able to pass classes around without
having to do these kind of work arounds.

If anyone has any ideas on this, please give me a shout.

Thanks,
J



[flexcoders] Re: How to use mx.modules.Module class in ActionScript Project

2007-12-17 Thread JWOpitz
I don't have any small examples I could post here but if you want to
dive into using MVC on Flex, check out the Cairngorm framework.  It
provides you some useful classes to extend and implement regarding the
structuring of the varous MVC components.

ModelLocator is a simple singleton class with getter/setter properties
and I like to extend eventDispatcher.  Some folks like to make it a
bindable class, however I try to avoid that as it has some overhead
involved.  It looks something like this:

package {

public class ModelLocator extends EventDispatcher
{

   private static var _instance:ModelLocator;

   public static function getInstance ():ModelLocator
   {
  if (!_instance)
 _instance = new ModelLocator();
  
  return _instance;
   }

   function ModelLocator (){}; //have this be an internal function so
you don't have a publicly exposed constructor.

}
}

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

 Hello J,
 I am new to Design Patterns and currently using ARPX so I know 4 -5
 patterns. I am using Application Domain but found that it can't help
 me in Shell/Module pattern so I opt for mx.modules package. As you
 mentioned Model Locator, please I would like to have a sample if you
 can give me. Although I looked at it. Its same like Spring Service in
 java. Please give any sample for Model Locator so that I can get
 Shell/Module pattern 
 



[flexcoders] Re: How to use mx.modules.Module class in ActionScript Project

2007-12-17 Thread JWOpitz
I forgot to show you how you use it.  So anywhwere in the application
you can now say: ModelLocator.getInstance().someProperty...

It provides you global access throughout you application.

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

 I don't have any small examples I could post here but if you want to
 dive into using MVC on Flex, check out the Cairngorm framework.  It
 provides you some useful classes to extend and implement regarding the
 structuring of the varous MVC components.
 
 ModelLocator is a simple singleton class with getter/setter properties
 and I like to extend eventDispatcher.  Some folks like to make it a
 bindable class, however I try to avoid that as it has some overhead
 involved.  It looks something like this:
 
 package {
 
 public class ModelLocator extends EventDispatcher
 {
 
private static var _instance:ModelLocator;
 
public static function getInstance ():ModelLocator
{
   if (!_instance)
  _instance = new ModelLocator();
   
   return _instance;
}
 
function ModelLocator (){}; //have this be an internal function so
 you don't have a publicly exposed constructor.
 
 }
 }
 
 --- In flexcoders@yahoogroups.com, cksachdev cksachdev@ wrote:
 
  Hello J,
  I am new to Design Patterns and currently using ARPX so I know 4 -5
  patterns. I am using Application Domain but found that it can't help
  me in Shell/Module pattern so I opt for mx.modules package. As you
  mentioned Model Locator, please I would like to have a sample if you
  can give me. Although I looked at it. Its same like Spring Service in
  java. Please give any sample for Model Locator so that I can get
  Shell/Module pattern 
 





[flexcoders] Re: How to use mx.modules.Module class in ActionScript Project

2007-12-16 Thread JWOpitz
Regarding the singleton implementation, if you are using a MVC
approach, does not the ModelLocator instance provide a central place
for communicating data back a forth form the views?

I too am working on a Module based application.  THough I haven't
encountered any issue so far, I am curious to know that if you have
various {bindings} found in the various modules, when those modules
get unloaded and loaded back in, do those binding update automatically?

I am sure I could make a quick test app to see but thought I would
throw this out for food for thought.

Thanks,
j

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

 The same I tried. But in ActionScript Project I am unable to import
 mx.modules.Module class. As you mentioned I should use
 parentApplication. parentApplication is available in mx.modules.Module
 class. I am unable to access any properties or methods of this class.
 
 Please help...
 --- In flexcoders@yahoogroups.com, ben.clinkinbeard
 ben.clinkinbeard@ wrote:
 
  He just means that you can manually set a ref to the parent app. So
  when you load a module do something like this:
  
  newModule.parentApp = this;
  
  
  
  --- In flexcoders@yahoogroups.com, cksachdev cksachdev@ wrote:
  
   Hi Alex,
   Please describe it more clearly. So that all ActionScript
Projects can
use that concept. 
   
   
   Thanks
   --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote:
   
You will have to design your own communication method.  You can
 use a
singleton object or pass references into the instances.

 



From: flexcoders@yahoogroups.com
  [mailto:[EMAIL PROTECTED] On
Behalf Of cksachdev
Sent: Thursday, December 13, 2007 2:43 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to use mx.modules.Module class in
  ActionScript
Project

 

I wanted to use Shell/Module concept in my ActionScript project. I
used mx.modules.ModuleBase Class in my Module. The problem I am
 facing
is When I want to communicate from one module to another module I
don't have parentApplication object as I am not using
mx.modules.Module class.
And in ModuleBase Class there are very few properties
available. Any
body have the solution for this.

In the import statement I can't see mx.modules.Module class. I am
using Flex 3 Beta. Please suggest some solution so that I can
 use the
Shell/Module concept in my ActionScript project. This concept
I read
on Roger Gonzalez blog (http://blogs.adobe.com/rgonzalez/flex/
http://blogs.adobe.com/rgonzalez/flex/ ).
   
  
 





[flexcoders] Cairngorm AMFPHP

2007-12-16 Thread JWOpitz
Hi folks,

I am jumping into the realm of PHP and MySQL.  I have fared decently
but have encountered this issue which I have yet to find a solution to.

I am passing valueObjects (VOs) in and out of the application.  When
the vo gets passed out from flex it looks something like this:

//in the Cairngorm command
var token:AsyncToken = call.send(UserVO(vo));
token.addResponders(this);

//the php service
include_once(vo/UserVO.php);
class MyService
{
public function someMethod (UserVO $vo)
{
// do stuff;
}
}

The issue I am getting is that even tho the AS3 vo is using the
[RemoteClass] metadata tag and is pointing to the PHP equivalent vo, I
get this error back on the fault response of the Cairngorm command:

Error Code:
AMFPHP_RUNTIME_ERROR

Error Details:
Argument 1 passed to userServices::getUser() must be an instance of
UserVO, array given

My question is, even tho I am casting the VO as the type expected on
both sides, what I am doing incorrectly?  Somehow the parameter being
sent is getting interpretted as an array or simple object.  When I
remove the PHP type casting and return the parameter sent, the object
comes back as an ObjectProxy tho the properties are intact.


Thanks in advance for your help,
Jwopitz



[flexcoders] Re: What type of applications i can build using flex?

2007-12-16 Thread JWOpitz
You can use flex to build all sorts of applications, from small
rapidly developed prototypes and POCs to huge enterprise level
applications.  And it handles multimedia as good as any RIA type
technology.  

I don't know much about .NET other than it has deployment dependencies
on having a Windows back end (or so I think).  I can't say whether it
is faster or not to develop on .NET vs Flex.  

In order to deploy a Flex app, you have only to worry that the user
has the flash player and if not, there are several ways you can
deliver your content anyway.  Besides the Flash player has the best
penetration stats of any browser plugin out there.

I worked with some guys at Fidelity who were cranking out a Flex
prototype app in under 2 weeks consistently.  That is pretty damn
impressive.



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

 Hello everyone ,
 
 I am a .NET developer and i read about flex as a fast application
 development environment.i chack the showcases in the adobe site and i
 find that all that applications that build using flex are a multimedia
 applications.
 my question is : 
 can i use flex to develope a non-multimedia app. like finance or
 planning applications? and is it faster ( for develop ) than visual
 studio .net ?
 
 Thanks for your help





[flexcoders] Re: Basic Question from a Flex Newbie

2007-12-16 Thread JWOpitz
I am not sure how familiar you are with MVC but you might wanna take a
look at using an application model to store string data.  Normally, a
popup will have content specific strings such as prompts for
comboboxes and the title of the popup that it and only it should know
or be concerned about.  

But assume for the second that your popup is a change password popup
right?  It would need to know a few things about your username and old
password to display and compare against.  You don't really want the
view that created this popup to have to know about what to put inside
it to display regarding those properties.  Instead, you would have
properties on the model somewhere called userName, password.  Since
the model should be a singleton, then you can have the popup get the
instance of the model and grab those properties via binding {}.

So you textInput inside your popup has no need to communicate with the
view that created it, not does that view need to know anything about
the popup.  The popup looks to the model for information.  

That is a rather lengthy response to a simple question but I think it
will lead you to a more clean implementation.  

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

 Hello All 
 
 I have been using Flash and AS3 for some time now, however I am new
to Flex (and this group) and looking forward to seeing all that it can
do.  I have come across a situation which I believe to be rather
simple to resolve, yet I have been unable to do so. I have my
Application file which is calling a PopUp Component created with a
 TitleWindow Component. I have a button in the Application file that
 when it's clicked will open the PopUpComponent. How can I pass a
 variable/parameter from the Application to the TitleWindow for the
 text . Here's the code I am using in Application:
 
 --
 ?xml version=1.0 encoding=utf-8?
 
 mx:Script
 ![CDATA[
 
 import dialogue.SimpleDialogue;
 import mx.managers.PopUpManager
 import mx.containers.TitleWindow;
 
 private var myPopUp:TitleWindow
 
 private function showPopUp():void
 
 myPopUp =
PopUpManager.createPopUp(this,dialogue.SimpleDialogue,true) as
TitleWindow;
 PopUpManager.centerPopUp(myPopUp)
 }
 ]]
 /mx:Script
 
 mx:Button label=Show Popup Dialogue click=showPopUp()/mx:Button
 /mx:Application

--
 
 And here's the code in the Component:
 -
 //SimpleDialogue Component
 
 ?xml version=1.0 encoding=utf-8?
 
 mx:Label id=message text= fontSize=24
 
 /mx:Label
 
 /mx:TitleWindow
 ---
 
 Hopefully, this makes sense. If not, I would be happy to clarify.
Thanks for any and all replies.
 
 SL





[flexcoders] Re: A common question with no answer yet - Flex Debugger

2007-09-13 Thread JWOpitz
Sorry about that.  I guess my email didn't show the whole message or I
didn't see the scroll buttons.  But yes you did answer my question I
this is a great help to me and my colleagues.  This is most helpful. 
Thanks again.  

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

  I eagerly await your response :)
 
 Sorry, I don't understand -- I think I answered your question.  The
 steps I gave in (b) will do what you want, I think, albeit with the
 ugliness of opening an extra browser window that you will have to
 manually close.  If you are asking How do I do it without opening the
 extra browser window, the answer is you can't.  But at least you can
 get your work done, because the debugging session will connect.
 
 - Mike
 
 
 --- In flexcoders@yahoogroups.com, JWOpitz jwopitz@ wrote:
 
  I am saying b).  I want to manually launch the browser and debug.swf
  then when the connect debugger dialog box opens, I can say localHost
  and have the Flex Builder Plug-in debugger connected to the manually
  launched swf.  
  
  I eagerly await your response :)
  
  --- In flexcoders@yahoogroups.com, Mike Morearty mike.morearty@
  wrote:
  
   Are you saying that (a) you want Flex Builder to launch the browser,
   but with a custom URL that you specify, or (b) you don't want Flex
   Builder to launch the browser at all -- just connec to an
   already-running browser that you launched?  Both are possible.
   
   (a) If you want Flex Builder to launch the browser, but with a
custom
   URL that you specify, just edit the launch configuration.  Easiest
   way to do that is described here:
  
 

http://www.morearty.com/blog/2006/05/23/flex-builder-ctrl-click-to-access-a-lanch-configs-properties/
   Then, just edit the URL shown in the Debug edit box.
   
   (b) If don't want Flex Builder to launch the browser at all, but
just
   connect to a browser you already launched manually: This is a hack,
   but it works: Go to the same launch configuration dialog mentioned
   above, and just set the URL to any old thing (e.g about:blank, or if
   that doesn't work, http://www.google.com).  When you click
Debug, Flex
   Builder will launch a browser at the bogus page; and now, for
the next
   two minutes, Flex Builder is listening on a socket, waiting for the
   Flash player to connect to it.  Just ignore the bogus browser,
and go
   over to the browser you wanted, and load your swf.  When the Flash
   Player starts, it will connect to the socket that Flex Builder is
   listening on.
   
   - Mike Morearty
 Adobe Flex Builder team
   
   
   --- In flexcoders@yahoogroups.com, JWOpitz jwopitz@ wrote:
   
Hi folks,

I have tried to find this topic posted in the group and the web in
general and tho I find plenty on related cases, I cannot seem to
 find
the right answer.  So I pose this question to you, my fellow
  colleagues.

I want to be able to connect the debugger to a swf that has
NOT been
launched by the Flex Builder plug-in.  For instance, I want
build a
debug version swf locally, deploy it to a server manually (by
 cp'ing
it there) and then connect the debugger to that swf.  

Used to back in the Flex 1.5 days I remember being able to just
 click
the 'localHost' button and it would work as expected.  However,
 I have
not been able to do this with Flex 2 as it just reopens the
 connection
box and eventually fails out.  

So is this possible?  I apologize if there is indeed a duplicate
 post
and I happened to miss it.  If so, please post a link.  

Thanks,
J
   
  
 





[flexcoders] A common question with no answer yet - Flex Debugger

2007-09-12 Thread JWOpitz
Hi folks,

I have tried to find this topic posted in the group and the web in
general and tho I find plenty on related cases, I cannot seem to find
the right answer.  So I pose this question to you, my fellow colleagues.

I want to be able to connect the debugger to a swf that has NOT been
launched by the Flex Builder plug-in.  For instance, I want build a
debug version swf locally, deploy it to a server manually (by cp'ing
it there) and then connect the debugger to that swf.  

Used to back in the Flex 1.5 days I remember being able to just click
the 'localHost' button and it would work as expected.  However, I have
not been able to do this with Flex 2 as it just reopens the connection
box and eventually fails out.  

So is this possible?  I apologize if there is indeed a duplicate post
and I happened to miss it.  If so, please post a link.  

Thanks,
J



[flexcoders] Re: A common question with no answer yet - Flex Debugger

2007-09-12 Thread JWOpitz
I am saying b).  I want to manually launch the browser and debug.swf
then when the connect debugger dialog box opens, I can say localHost
and have the Flex Builder Plug-in debugger connected to the manually
launched swf.  

I eagerly await your response :)

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

 Are you saying that (a) you want Flex Builder to launch the browser,
 but with a custom URL that you specify, or (b) you don't want Flex
 Builder to launch the browser at all -- just connec to an
 already-running browser that you launched?  Both are possible.
 
 (a) If you want Flex Builder to launch the browser, but with a custom
 URL that you specify, just edit the launch configuration.  Easiest
 way to do that is described here:

http://www.morearty.com/blog/2006/05/23/flex-builder-ctrl-click-to-access-a-lanch-configs-properties/
 Then, just edit the URL shown in the Debug edit box.
 
 (b) If don't want Flex Builder to launch the browser at all, but just
 connect to a browser you already launched manually: This is a hack,
 but it works: Go to the same launch configuration dialog mentioned
 above, and just set the URL to any old thing (e.g about:blank, or if
 that doesn't work, http://www.google.com).  When you click Debug, Flex
 Builder will launch a browser at the bogus page; and now, for the next
 two minutes, Flex Builder is listening on a socket, waiting for the
 Flash player to connect to it.  Just ignore the bogus browser, and go
 over to the browser you wanted, and load your swf.  When the Flash
 Player starts, it will connect to the socket that Flex Builder is
 listening on.
 
 - Mike Morearty
   Adobe Flex Builder team
 
 
 --- In flexcoders@yahoogroups.com, JWOpitz jwopitz@ wrote:
 
  Hi folks,
  
  I have tried to find this topic posted in the group and the web in
  general and tho I find plenty on related cases, I cannot seem to find
  the right answer.  So I pose this question to you, my fellow
colleagues.
  
  I want to be able to connect the debugger to a swf that has NOT been
  launched by the Flex Builder plug-in.  For instance, I want build a
  debug version swf locally, deploy it to a server manually (by cp'ing
  it there) and then connect the debugger to that swf.  
  
  Used to back in the Flex 1.5 days I remember being able to just click
  the 'localHost' button and it would work as expected.  However, I have
  not been able to do this with Flex 2 as it just reopens the connection
  box and eventually fails out.  
  
  So is this possible?  I apologize if there is indeed a duplicate post
  and I happened to miss it.  If so, please post a link.  
  
  Thanks,
  J
 





[flexcoders] Re: unable to bind to property on class....

2007-04-10 Thread JWOpitz
Have you looked into using the metatags on the setter/getter?  Making
the class itself bindable?  I wrote a post about this a while back,
maybe you can get some info off of it:

http://jwopitz.wordpress.com/2007/03/29/a-common-binding-issue-and-a-work-around/

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

 
 Thanks, that did it, I initialized the value of userDisplayName via 
 my setter (which I didn't have before), instead of just through the 
 private _userDisplayName variable, bindings worked!
 
 I still get this message though:
 warning: unable to bind to property 'current' on class 'com::session' 
 (class is not an IEventDispatcher), and my session class does extend 
 the EventDispatcher class...
 
 I don't like it, but everything now works as expected... that is good.
 
 Thanks for your help, it's always something simple i'm missing... 
 this group has been a ton of help!!
 
 -Scott
 
 
 --- In flexcoders@yahoogroups.com, Paul DeCoursey paul@ wrote:
 
  do you have a setter on the property?  I don't see one in the code 
 you
  posted.  You need a setter for it to bind. Or at least you must 
 fire a
  PropertyChangeEvent when the property changes.
  
  Paul
  
  
  --- In flexcoders@yahoogroups.com, scott_flex skrause@ wrote:
  
   
   Actully, and i should have noted that in first post, i did try 
 that, 
   but same warnings and same effect, no errors, but my property did 
 not 
   bind to my label's text.
   
   Would it or could it have anything to do with the fact it's a 
   singleton object??... I wouldn't think so.
   
   Not shown in the example, but i also exposed some public 
   ArrayCollectin lists of value objects and was able to bind 
   successfully to those, just not my public string properties.  So 
 why 
   somethings bind ok, and others don't?
   
   thanks for your response.
   
   --Scott
   
   
   --- In flexcoders@yahoogroups.com, Paul DeCoursey paul@ wrote:
   
Binding depends on the object being able to dispatch events to 
   notify
the bind target that the property changed. To get around this 
 you
simply extend EventDispatcher.

ie.
public class session extends EventDispatcher {

that will fix the warnings and bind your properties.

Paul


--- In flexcoders@yahoogroups.com, scott_flex skrause@ 
 wrote:

 
 I'm not the first person to run into this and after searching 
   some 
 previous threads i don't see any good explanations.  Any help 
 is 
 appreciated.
 
 When i build my app, i get these warning messages and not 
 sure 
   how to 
 fix them.  I don't get any errors when i bind a label's text 
   property 
 like this {com.session.current.userDisplayName}, it just 
 doesn't 
   bind 
 when I run the code.
 
 warning: unable to bind to property 'current' on 
   class 'com::session' 
 (class is not an IEventDispatcher)
 warning: unable to bind to property 'userDisplayName' on 
 class 'com::session'
 
 Here's a code snippet of my session class, which is a 
 singleton 
   class.
  
 package com
 {
   [Bindable]
   public class session
   {
   
   // -
   // SINGLETON STUFF
   // -
   private static var _current:com.session = null;
   public static function get current():com.session
   {
   if (_current == null) _current = new 
 com.session();
   return _current;
   }   
 
   // -
   // CONSTRUCTOR
   // -
   public function session()
   {
   if (_current != null)
   {
   throw new Error(Only one instance of 
 the 
 session should be instantiated);
   }
   }
   
   private var _userDisplayName:String 
   = User's 
 Fullname Goes here;
   public function get userDisplayName():String {return 
 _userDisplayName;}
   
   }
 }

   
  
 





[flexcoders] Re: event creation

2007-03-27 Thread JWOpitz
Also you need to override the clone method.

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

 Define a new class that extends flash.events.Event and call
 dispatchEvent.  Other code calls addEventListener to listen to it.
 Check out the docs
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of rikencpatel_2005
 Sent: Tuesday, March 27, 2007 5:22 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] event creation
 
 
 
 how can i create my own event and assign a handler function for that 
 event?





[flexcoders] Re: Simple design question

2007-03-16 Thread JWOpitz
If you use the Cairngorm Microtecture then you do use a 'faceless'
MXML based component everytimee: your subclasses of the
FrontController.  The same thing applies to things like validators
which are not view-type classes.  You instantiate them via mxml
oftimes but they are not included in the displayList of the housing
container. 


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

 Implement IMXMLObject
 
 
 
 
 
 --- In flexcoders@yahoogroups.com, Andr� Rodrigues Pena
 andre.ufrj@ wrote:
 
  Hi all,
  
  I know how to create visual components as MXML files. My question is,
  can I create a non-visual component using MXML files? Let's put an
  example: I want to create a non-visual component to wrap my
  web-services and handlers. I know I could do it with AS3. But can I do
  it with MXML?
  
  thanks
  
  -- 
  Andr� Rodrigues Pena
  
  LOCUS
  www.locus.com.br
  
  Blog
  www.techbreak.org
 





[flexcoders] Re: Simple design question

2007-03-16 Thread JWOpitz
I forgot to add that things like validators do implement IMXMLObject.
 However FrontController in Cairngorm 2.1 does not and still works fine.  

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

 If you use the Cairngorm Microtecture then you do use a 'faceless'
 MXML based component everytimee: your subclasses of the
 FrontController.  The same thing applies to things like validators
 which are not view-type classes.  You instantiate them via mxml
 oftimes but they are not included in the displayList of the housing
 container. 
 
 
 --- In flexcoders@yahoogroups.com, Paul DeCoursey paul@ wrote:
 
  Implement IMXMLObject
  
  
  
  
  
  --- In flexcoders@yahoogroups.com, Andr� Rodrigues Pena
  andre.ufrj@ wrote:
  
   Hi all,
   
   I know how to create visual components as MXML files. My
question is,
   can I create a non-visual component using MXML files? Let's put an
   example: I want to create a non-visual component to wrap my
   web-services and handlers. I know I could do it with AS3. But
can I do
   it with MXML?
   
   thanks
   
   -- 
   Andr� Rodrigues Pena
   
   LOCUS
   www.locus.com.br
   
   Blog
   www.techbreak.org
  
 





[flexcoders] Re: cairngorm strategy question

2007-03-06 Thread JWOpitz
Oooh good call.  I forgot about these little helpful tools.  

But Hank, I think you nailed it on the head.  There are no wrong
answers.  Given the fact that you have thought about this as
thoroughly as you have, I am sure that you will find the best solution
for you and your app no matter what direction you take.  

Here is one more bit about Cairngorm.  Like Scott said, it might be a
bit overkill to use this micro-tecture if you have a very simple
application.  Now if you have already implemented it for other
purposes, you will incur very little if any overhead for adding
another command.  But if this is the one and only place that you will
using this in this app, then it might be a bit overkill.  

Anyway, good luck and be sure to link us up to see your progress.  

Take care,
jwopitz


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

 Actually, SoundManager doesn't seem to fit MVC. You have no view and
no user
 input, correct? Why not just use a Command (or whatever patterns fit)
 structure without worrying too much about Cairngorm..? Cairngorm's
great and
 all, but it is intended to manage large applications with many
views, in the
 end.
 
 Looking back at your orig. post, looks like Command/Event structure
may be
 just fine, but that also doesn't mean you need to use the
CairngormCommand
 (if such exists). maybe what you really want is a state machine that
fires
 some events (probably). That state machine could very well sit in
your model
 and fire events. Or not!
 
 You might want to take a look at the concept of CRC's (

http://en.wikipedia.org/wiki/Class-Responsibility-Collaboration_card) as a
 starting point. In the end, KISS works!
 
 -Scott
 
 On 05 Mar 2007 19:15:18 -0800, hank williams [EMAIL PROTECTED] wrote:
 
Thanks guys,
 
  I still dont know what I am going to do, but it is very helpful to
  hear the arguments. Sometimes it is really helpful just to get other
  peoples views. Obviously this is a bit of a gray area and there is no
  *wrong* answer here, which is why nuance and opinion are quite
  helpful.
 
  Regards,
  Hank
 
 
  On 3/5/07, JWOpitz [EMAIL PROTECTED] jwopitz%40gmail.com wrote:
   I should probably clarify a few things. If you have MVC, and I
had to
   qualify a SoundManager class as one of those, I would probably
see it
   first as a command class. Manager type classes generally are of this
   nature anyway. But that can easily be argued to say Sound is also a
   view type nature too and there is enough supporting information
to be
   so. Maybe this is more about personal preference as I can see both
   sides.
  
   As to why I don't like the Model doing command-ish like things
is that
   again it is not its responsibility. Now that is not too say that it
   can't dispatch events. In fact when you have a [Bindable] class, it
   automatically dispatches propertyChange events. So that is perfectly
   acceptable in my book. In fact if you look in the flex2 reference
   material and search metadata, it explains how this works internally
   and how you can do it manually. I do not, however, like methods in
   the Model aside from getters/setters.
  
   Many of the developers on my team, however do like to stick methods
   (not getters/setters) in the model. I don't like it and advocate
   against it. For instance we have a customizable dataGrid where users
   can add various column types with specific data. I suggested
having a
   command-type class build columns for it. However, my teammates
wanted
   to have a method in the model. For what reasons I do not now. All I
   know is that although I love democracy in terms of politics, I
cannot
   stand it in application development. Sorry for that. Just a rant and
   rave for a sec. Back to the point though, to maintain consistency
   with the MVC framework, some sort of ColumnManager would be
   appropriate and would be in the command family.
  
   I am not any kind of MVC purist and occasionaly bend the rules or do
   something questionable with regards to what we have been discussing.
   But when developers start deviating dramatically from the core
   purposes of what a model is, what a command is, what a view is,
then I
   will raise an eyebrow and possibly a stink.
  
   Again my 2 cents. Hope it helps in your decision making.
  
   --- In flexcoders@yahoogroups.com
flexcoders%40yahoogroups.com, Troy
  Gilbert troy.gilbert@
   wrote:
   
Coming from a game development background, I always consider
sound to
  be
apart of the view. Generally, I consider anything directly
consumed
   by the
user to be view while internal state that has meaning
independent
   of the
view is the model.
   
So, while your sound player does maintain state (the currently
playing
sound, the current position in the sound being played), you
need to
   answer
for yourself whether that state is on par with (to use a trivial
   example)
the contacts in an address book or the position of a scroll

[flexcoders] Re: How to Copy object with same base class

2007-03-05 Thread JWOpitz
Check into mx.utils.ObjectUtils.getClassInfo(value:Object):Object 


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

 Hi,
 
 Does anyone know the way how to copy two objects of differet class say 
 D1 and D2, that derived from the same B1 base class?
 Is that i need to copy all the attribute from B1 one by one in D1 to D2 
 explicity
 
 The reason i want to do it is because the DTO from the server side is 
 quite different from what a datagrid or other client side component 
 expected, so what i trying to do is to flatten some of the attribute of 
 those DTO first ( a type conversion ). and the B1 is some how some 
 version keeping information which i don't want to touch with.
 
 Any people has any idea? Thx for any opinion.
 
 Daniel





[flexcoders] Re: cairngorm strategy question

2007-03-05 Thread JWOpitz
I am sure there will be plenty of suggestions, but it sounds like you
need some sort of static point of access for your sounds.  There are
few approaches that I would try:

Make a SoundManager Singleton class that extends the EventDispatcher.
 That way if you make use of the basic Flex events, you can then have
the soundManager instance assign its event handlers.

As for using the Cairngorm class, I think that could also be a good
idea.  I have written a little blog on it here:
http://jwopitz.wordpress.com/2007/03/01/

I would not start having the model do any command-ish activities since
that is not its responsibility.  And I would not make it a view-type
since, well, its not a view, its a sound.  

Hope that helps.

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

 I have a class that is basically a sound server. It both generates
 events - like sound #1234 is finished and receives commands like
 start playing sound #4567.
 
 My problem is that I am not sure where to put this in the cairngorm
universe.
 
 If I were to put it in the model, thats kinda wierd since it generates
 events, and models dont ususally generate cairngorm events. One
 thought I had was not to have it generate events, but to use binding
 to get information out of the object, but events really are better
 since it may be playing multiple sounds and events allow me to specify
 that multiple things are happening. Binding would be less clean
 because my binding subscribers would have to bind to an array since
 any number of sounds may be in play at one time.
 
 If I were to make the class a view, thats wierd because views dont
 generally get modified by cairngorm events.
 
 Of course the third way is just to use standard AS3 events - which is
 the way it currently works - but the architecture of commands in
 cairngorm is so clean with a class for each command that it makes it
 really easy to read the code.  So if I can, I would like to use the
 cairngorm command structure for this piece if I can make it work.
 
 Any thoughts greatly appreciated.
 
 Hank





[flexcoders] Re: cairngorm strategy question

2007-03-05 Thread JWOpitz
I should probably clarify a few things.  If you have MVC, and I had to
qualify a SoundManager class as one of those, I would probably see it
first as a command class.  Manager type classes generally are of this
nature anyway.  But that can easily be argued to say Sound is also a
view type nature too and there is enough supporting information to be
so.  Maybe this is more about personal preference as I can see both
sides.  

As to why I don't like the Model doing command-ish like things is that
 again it is not its responsibility.  Now that is not too say that it
can't dispatch events.  In fact when you have a [Bindable] class, it
automatically dispatches propertyChange events.  So that is perfectly
acceptable in my book.  In fact if you look in the flex2 reference
material and search metadata, it explains how this works internally
and how you can do it manually.  I do not, however, like methods in
the Model aside from getters/setters.  

Many of the developers on my team, however do like to stick methods
(not getters/setters) in the model.  I don't like it and advocate
against it.  For instance we have a customizable dataGrid where users
can add various column types with specific data.  I suggested having a
command-type class build columns for it.  However, my teammates wanted
to have a method in the model.  For what reasons I do not now.  All I
know is that although I love democracy in terms of politics, I cannot
stand it in application development. Sorry for that.  Just a rant and
rave for a sec.  Back to the point though, to maintain consistency
with the MVC framework, some sort of ColumnManager would be
appropriate and would be in the command family.  

I am not any kind of MVC purist and occasionaly bend the rules or do
something questionable with regards to what we have been discussing. 
But when developers start deviating dramatically from the core
purposes of what a model is, what a command is, what a view is, then I
will raise an eyebrow and possibly a stink.  

Again my 2 cents.  Hope it helps in your decision making.

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

 Coming from a game development background, I always consider sound to be
 apart of the view. Generally, I consider anything directly consumed
by the
 user to be view while internal state that has meaning independent
of the
 view is the model.
 
 So, while your sound player does maintain state (the currently playing
 sound, the current position in the sound being played), you need to
answer
 for yourself whether that state is on par with (to use a trivial
example)
 the contacts in an address book or the position of a scroll bar on a
text
 box. If the sounds are used to convey information about state, then it
 sounds to me they're more like scrollbars. If the sounds *are* your
state
 that you're concerned with (like an audio editing application), then
they
 should be in the model.
 
 Another way to judge it: if you were going to persist the current
state of
 your application to disk, would you worry about persisting the state
related
 to sound? Or to put it another way: if I was forced to manipulate
the data
 in your application through an API instead of a UI, do I care about the
 sounds or are they only there for the pleasure of the human audience?
 
 Troy.
 
 
 On 3/5/07, hank williams [EMAIL PROTECTED] wrote:
 
Thanks,
 
   Make a SoundManager Singleton class that extends the
EventDispatcher.
   That way if you make use of the basic Flex events, you can then have
   the soundManager instance assign its event handlers.
  
  This is the way the code currently works.
 
   As for using the Cairngorm class, I think that could also be a good
   idea. I have written a little blog on it here:
   http://jwopitz.wordpress.com/2007/03/01/
  
 
  I read your blog, and it seems to finish right where I am beginning. I
  agree with your premise that commands can and should be used for
  internal app communication and not just for remote access. In fact
  that is why I posted my question. The issue is where in the cairngorm
  architecture a singleton type class of this type should sit. In
  cairngorm you have events, commands, delegates, views and model. As I
  have spent time thinking about this today, I have started to think
  that it is indeed closest to being an element of the model. It retains
  state and can be queried as any element of the model can. The only
  weird thing is that it can broadcast events. But it makes sense to me
  that certain types of model information perhaps should be able to
  generate events.
 
  Currently models generate events surreptitiously via the binding
  architecture. They really do generate events, just not in the
  cairngorm way. So why not allow model elements to generate cairngorm
  events?
 
   I would not start having the model do any command-ish activities
since
   that is not its responsibility.
 
  Why not?
 
  If a model contains data that changes, why is it 

Re: [flexcoders] Save a BitmapData as a local file

2007-03-01 Thread jwopitz

I don't quite understand the question here.  Are you asking can you save
some var myPic:BitmapData to your localSharedObject?

That's how I understand it.  I have never tried but I assume that you
could.  We have been able to save some very complex object type to our LSOs
without any issue.

On 2/28/07, ecpmaz [EMAIL PROTECTED] wrote:


  ... and that without passing by the server :S

I don't know if my question is stupid.. but all I've been able to do
till now was to send as a POST var my bytes to my server to assemble
them, and send them back to the user as a JPEG...

It seems not to be an optimal solution, do you have any solution ?

{Maz}

 





--
justin w. opitz
617.771.6639
jwopitz(at)gmail.com


Re: [flexcoders] Finding out when an arraycollection in my model is set

2007-03-01 Thread jwopitz

Even though you have a solution to your problem, I would strongly suggest
looking at how the listBase sets its dataProvider.

After it has gone through the process of setting its protected collection
property, it creates a new CollectionEvent with the kind set to
CollectionEventKind.RESET.  It then passes the event to its internal
collectionChange_eventHandler method and also dispatches it as well.

So if all the other suggestions above don't seem to work, then maybe this
can provide some insight.  Hope that helps someone.



On 2/28/07, Webdevotion [EMAIL PROTECTED] wrote:


  Found your question also in another thread.
Can you post the answer to this thread please ?
If you find it eventually that is   : )

 





--
justin w. opitz
617.771.6639
jwopitz(at)gmail.com


Re: [flexcoders] Re: how do you call the super's super?

2007-03-01 Thread jwopitz

Though this will probably cause some gasps and 'shame on you' responses from
the OOP hardcores, you might try copying the parent class from the SDK, make
it local to your class structure, and then modifying it as your new class,
basically porting over your new features into the parent class.  That way
then you can have access to the grandparent class's methods, you retain the
parents methods, and you can override whatever you wish.

I had a similar issue, and believe it or not, this was recommended to me by
an Adobe support person.  Of course my issue was a very minor.  It dealt
with the fact that alot of their methods were tagged as private rather than
protected, leaving alot of headaches for those wanted to extend their
controls.

On 3/1/07, Kalani Bright [EMAIL PROTECTED] wrote:


   Yes you can for each class you can just have to create a method which
call's its super and call that method from the grandchild.


 





--
justin w. opitz
617.771.6639
jwopitz(at)gmail.com


Re: [flexcoders] Save a BitmapData as a local file

2007-03-01 Thread jwopitz

ahhh. well that makes sense now.  Thanks for the education on the subject.
I have only used LSO's to store XML data with simple types.

Thanks guys.

On 3/1/07, Merrill, Jason [EMAIL PROTECTED] wrote:


   Even if you could, you'd run into SharedObject size restrictions for
most users as per their player default settings.


Jason Merrill
Bank of America
Global Technology  Operations, Learning  Leadership Development
eTools  Multimedia Team



 --
*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
Behalf Of *Jim Cheng
*Sent:* Thursday, March 01, 2007 3:22 PM
*To:* flexcoders@yahoogroups.com
*Subject:* Re: [flexcoders] Save a BitmapData as a local file

 jwopitz wrote:

 I don't quite understand the question here. Are you asking can you save
 some var myPic:BitmapData to your localSharedObject?

 That's how I understand it. I have never tried but I assume that you
 could. We have been able to save some very complex object type to our
LSOs
 without any issue.

Unfortunately, there's a few non-primitive data types that can't be
saved to shared objects owing to an apparent lack of serialization
support in the native code. Among these are BitmapData and ByteArray.

To persist these data into shared objects, they must first serialized
into primitives before they can be persisted into shared objects, for
instance, as Base64-encoded string or a packed array of 8-byte Numbers.

Jim Cheng
effectiveUI

 





--
justin w. opitz
617.771.6639
jwopitz(at)gmail.com


Re: [flexcoders] Re: how do you call the super's super?

2007-03-01 Thread jwopitz

Paul,

I am not sure to which posting you are asking, 'why?' but I can give you a
specific case in which there have been needs to extend a particular class
and then at some point wish you could call super.super.someMethod().

My client needed some specialized autoComplete features that Adobe's
autoComplete did not support (from here on referred to as AC).  Those needed
features where:

  1. to be able to submit a string, add a comma, and then search for the
  next string following the last comma (ie. searching for multiple symbols,
  and then submitting all at once, rather than one by one)
  2. constantly update the dataProvider based on the current typedText
  (again that being the one after the last comma)

Adobe's AC had all the features needed except for a few event handler
methods that were preventing me from implementing the key features needed
for my own AC.  However, the grandparent class (ComboBox) did have the
original methods that I could override.  So let's presume for a moment that
you COULD do super.super.someMethod (); And now here are your choices:

  1. extend the Adobe AC, override needed methods by bypassing super's
  methods and instead targeting the functionality needed in
  super.super.someMethod() OR
  2. extend comboBox, copy all the Adobe AC needed code, modifying the
  needed code and scrapping the rest, thus duplicating some of your codeBase,
  OR
  3. copy the Adobe AC file, and make the necessary changes internally
  in that class.

I don't know about you, but if it were a choice, I would go with #1, then #3
and lastly #2.  But alas, it is not an option.  So Paul, not to sound curt,
but that's why.

jwopitz


On 3/1/07, Paul DeCoursey [EMAIL PROTECTED] wrote:


  Why? I can't think of a single reason to want to do that. If you
really wanted to do that then you should be extending the grandparent
class. Also are you sure that the parent class is not calling super?
generally you do that unless you don't want that functionality.

Paul

--- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Anthony
Lee [EMAIL PROTECTED]
wrote:

 Hi,

 Sorry for the lame AS questions, but can anyone tell me how to call
 the super method of the class I'm extending? ie. the grandparent and
 not the parent.

 Thanks,

 tonio


 





--
justin w. opitz
617.771.6639
jwopitz(at)gmail.com


Re: [flexcoders] Re: Just curious, A big development team or individual developers

2007-02-26 Thread jwopitz

Team, and too big of a team if I may say.  It was initially just 4 of us,
then they another 4 people.  There are as many analogies as there are
developers on my team.  Here are my favorites:

  1. too many cooks in the kitchen
  2. too many chiefs, not enough injuns
  3. too many hands in the cookie jar


Now we have 'too many cooks in the kitchen' or another way of saying it is
'too many chiefs, not enough indians'

On 2/23/07, simonjpalmer [EMAIL PROTECTED] wrote:


  huh, what an interesting question.

INDIVIDUAL

However, have budget for large team...

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

 I wonder how many people are working on TEAM to develop their flex
applications (and how
 many are 1 or 2 men (whoops I mean PEOPLE) developers. Please
discount the Graphic
 artists, HTML coders. et. al. If you have 3 or more people working
on the same flex
 application, please answer as a TEAM. 2 or 1, INDIVIDUAL.

 Thanks
 Bruce


 





--
justin w. opitz
617.771.6639
jwopitz(at)gmail.com


Re: [flexcoders] Re: Just curious, A big development team or individual developers

2007-02-26 Thread jwopitz

pardon the doubling of my response.

On 2/23/07, jwopitz [EMAIL PROTECTED] wrote:


Team, and too big of a team if I may say.  It was initially just 4 of us,
then they another 4 people.  There are as many analogies as there are
developers on my team.  Here are my favorites:

   1. too many cooks in the kitchen
   2. too many chiefs, not enough injuns
   3. too many hands in the cookie jar


Now we have 'too many cooks in the kitchen' or another way of saying it is
'too many chiefs, not enough indians'

On 2/23/07, simonjpalmer [EMAIL PROTECTED] wrote:

   huh, what an interesting question.

 INDIVIDUAL

 However, have budget for large team...

 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 boy_trike [EMAIL PROTECTED] wrote:
 
  I wonder how many people are working on TEAM to develop their flex
 applications (and how
  many are 1 or 2 men (whoops I mean PEOPLE) developers. Please
 discount the Graphic
  artists, HTML coders. et. al. If you have 3 or more people working
 on the same flex
  application, please answer as a TEAM. 2 or 1, INDIVIDUAL.
 
  Thanks
  Bruce
 

  





--
justin w. opitz
617.771.6639
jwopitz(at)gmail.com





--
justin w. opitz
617.771.6639
jwopitz(at)gmail.com


[flexcoders] defaults-css-url myTheme.css

2007-02-21 Thread jwopitz

Hi,

I made my own theme .swf and .css file based on the Aeon theme from Adobe.
Now I'd like to point the Flex compiler to use my theme.css rather than the
default.css found in the Flex SDK.  So from what I have read there are a few
ways to approach this:

  1. using some external compiler like ANT build (which I don't want to
  do at this point)
  2. in the .actionScriptProperties file, add defaults-css-url
  myTheme.css somewhere
  3. in the flex project properties inside the Flex Compiler window add
  defaults-css-url myTheme.css inside the additional compiler arguments

The thing is I am not sure where to start and in what syntax I would write
these new options.  Additionally I cannot find hardly any documentation on
how to do this, just references saying you can.

Does anybody have any links or examples they could share so that I can
tackles this?

For instance I tried using option 3 saying -defaults-css-url myTheme.css and
myTheme.css resides at the project level.  It threw some errors about null
references and the like.  Do I have to have a fully declared file location
for my css?

Thanks,
Justin

--
justin w. opitz
617.771.6639
jwopitz(at)gmail.com


Re: [flexcoders] Re: Getting notified when a user 'leaves/quits' the application

2007-02-16 Thread jwopitz

I started to suggest the same thing about using the javaScript method.  But
I haven't tested it yet and I am curious to know will that method in the swf
that is called by the js fire quickly enough before the actual session
closes?

Take for instance you want to save user preferences to a local shared object
onClose.  I am just guessing here, but I would think that the browser's
internal close mechanics would not wait around for the js, and subsequent
swf methods to do their business.

Has this been tested and confirmed by anyone?

On 2/16/07, Evan Bellinger [EMAIL PROTECTED] wrote:


Julien,

Not sure what you're really trying to do here.  A bit more of a
description would be useful.  I'll take a shot anyway.

I'm going to guess that you've got your application running in a
browser.  As such, you've got a couple options.

First, and most obviously, you could have a close button in your
application which logs you out or ends the chat or whatever.  Just
leech off of that event, and away you go.

Secondly, if you want to try to capture the closing of the browser
window, there's a javascript event that you'll want to capture and tie
it to a method in your application through the ExternalInterface.

Here's a quick snippet of something similar to what I use:

[Javascript]

window.onbeforeunload = browserClosing;

function browserClosing(event_)
{
   getSWF(MyTestApp).theBrowserIsClosing();
}

// Gets a reference to the specified SWF file by checking which browser is
// being used and using the appropriate JavaScript.
function getSWF(movieName)
{
   if (navigator.appName.indexOf(Microsoft) != -1)
  return window[movieName];
   else
  return document[movieName];
}

[/Javascript]

[MXML]

mx:Application ... creationComplete=load();
   Script![CDATA[
  private function load():void
  {
 if(ExternalInterface.available)
 {
try
{
   ExternalInterface.addCallback(theBrowserIsClosing,
theBrowserIsClosingHandler);
}
catch(e:Error){}
 }
  }

  private function theBrowserIsClosingHandler():String
  {
 //Do whatever needs to be done here.
  }
   ]]/Script
/mx:Application

[/MXML]

When your user hits the browser's close button, the onbeforeunload
event will fire calling the javascript method 'browserClose' which in
turn will call the 'theBrowserIsClosing' method in your application.

Hope that gets you pointed in the right direction.  If not, be a bit
more specific about what you're trying to do.

Evan

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

 Hi all,

 I was wondering if there was a way to be notified when the user
leaves or
 quits the application using AS3.

 Thanks.





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







--
justin w. opitz
617.771.6639
jwopitz(at)gmail.com


Re: [flexcoders] A cool TimeSelector component for you guys to downlod ...

2007-02-16 Thread jwopitz

You should also post a reference to flexcomponents@yahoogroups.com so as to
receive more feedback and visibility.  Pretty cool

On 2/16/07, helihobby [EMAIL PROTECTED] wrote:


I posted a cool easy to extend time selector as a thank you for the
support this group has given me.

You may download here:

http://www.adobe.com/cfusion/exchange/index.cfm?
view=sn101yourExID=uploads#loc=en_usview=sn611viewName=%
20authorid=77552239page=0scrollPos=0subcatid=0snid=sn611itemnumber
=0extid=1144469catid=0yourExID=uploads

Regards,

Sean - HeliHobby.com



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







--
justin w. opitz
617.771.6639
jwopitz(at)gmail.com


Re: [flexcoders] Re: A cool TimeSelector component for you guys to downlod ...

2007-02-16 Thread jwopitz

This is what I am talking about not the flex exchange:

http://tech.groups.yahoo.com/group/flexcomponents/

On 2/16/07, helihobby [EMAIL PROTECTED] wrote:


a href=http://www.adobe.com/cfusion/exchange/index.cfm?
view=sn610#loc=en_usview=sn611viewName=%
20authorid=0page=0scrollPos=0subcatid=0snid=sn611itemnumber=-
1extid=1144469catid=0Click here to download/a/b

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

 I posted a cool easy to extend time selector as a thank you for the
 support this group has given me.

 You may download here:

 http://www.adobe.com/cfusion/exchange/index.cfm?
 view=sn101yourExID=uploads#loc=en_usview=sn611viewName=%

20authorid=77552239page=0scrollPos=0subcatid=0snid=sn611itemnumber
 =0extid=1144469catid=0yourExID=uploads

 Regards,

 Sean - HeliHobby.com





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







--
justin w. opitz
617.771.6639
jwopitz(at)gmail.com


[flexcoders] Re: super.super?

2007-01-22 Thread JWOpitz
Hi Chris,

I am currently trying to extend the AutoComplete component that Adobe
released recently.  AutoComplete extends ComboBox and it overrides a
few methods such as keyDownHandler and UpdateDisplayList.  In my
subclass of AutoComplete I want to access the originally defined
keyDownHandler and updateDisplayList in ComboBox, essentially
bypassing the methods overridden in AutoComplete.  

I tried super.super.someMethod and it is not possible.  The bulk of
AutoComplete, I want to use, but those two methods are displaying
undesirable results which need to be changed.

Thanks,
j

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

 If you are in a method of say class C which extends class B, then
 calling super.someMethodName works. If class B extends class A and B
 doesn't redefine a method of A, say, called methodOfA, then in class C
 you can call super.methodOfA. This is because, through inheritance,
 all unredefined methods of A are automatically available to B. Super
 only works one level up.





[flexcoders] Re: super.super?

2007-01-22 Thread JWOpitz
Hi Gordon, just curious to know if super.super.someMethod() is
supported in AS3.  Or was that a typo below?

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

 super.super isn't supported in AS2. Can you describe your situation?
Why do
 you need to inherit from a class higher up the inheritance chain,
instead of
 from your superclass?
  
 - Gordon
  
 -Original Message-
 From: Simon Fifield [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, March 29, 2005 2:47 PM
 To: [EMAIL PROTECTED] Com
 Subject: [flexcoders] super.super?
 
 
 
 Hi Flexcoders,
  
 Is it possible to make a call like:
 super.super.layoutChildren();
 The compiler says There is no such method with the name 'super'.
  
 Is there another way around?
  
  
  
 Kind Regards,
  
 Simon Fifield
 
 Yahoo! Groups Sponsor 
 
 ADVERTISEMENT
  

http://us.ard.yahoo.com/SIG=129hv6udk/M=298184.6018725.7038619.3001176/D=gr

oups/S=1705007207:HM/EXP=1112223771/A=2593423/R=0/SIG=11el9gslf/*http://www.
 netflix.com/Default?mqso=60190075 click here 
  

http://us.adserver.yahoo.com/l?M=298184.6018725.7038619.3001176/D=groups/S=
 :HM/A=2593423/rand=309547265 
 
 
   _  
 
 Yahoo! Groups Links
 
 
 * To visit your group on the web, go to:
 http://groups.yahoo.com/group/flexcoders/
 http://groups.yahoo.com/group/flexcoders/ 
   
 
 * To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] 
   
 
 * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
 http://docs.yahoo.com/info/terms/ .





[flexcoders] Re: Set combobox selection to data

2006-12-01 Thread JWOpitz
I just extended mx:ComboBox with similar functionality:
http://jwopitz.pastebin.ca/263641

You will also need the ArrayCollectionUtil:
http://jwopitz.pastebin.ca/263645

There is still work to be done in both of these but feel free to copy
them.


--- In flexcoders@yahoogroups.com, Yi�it Boyar [EMAIL PROTECTED] wrote:

 i dont know whether there is a better way or not but i've used the
fallowing way.
 assume needed_val is the variable which is equal to the  data of the
one which should be selected (number in the example)
 mx:ComboBox labelField='name'
dataProvider={blaReq.lastResult.valS.val}
selectedIndex={findMyVal(me,needed_val)} id='me'
 
 
 and in the findMyVal function:
 private function findMyVal(obj:ComboBox , wanted:Number):Number{
 for (var i:Number=0 ; i  obj.dataProvider.length;i++){
 if(wanted = = obj.dataProvider[i].id ) //i assumed that the
data label is id of the dataProvider
 return i;
 }
 return 0;
 }
 
 whenever the dataProvider is refreshed, the function will
automatically be called and set the right selected index...
 by the way, i did not copy and paste a code so it may include some
typing errors, but the logic is this...
 
 i wish it helps, if this does not work, send a reply and  i can send
a copy paste code that surely works.
 
 Yigit Boyar
 Middle East Technical University Dept of Computer Science / sophomore
 - Original Message 
 From: Wally Randall [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com
 Sent: Friday, December 1, 2006 2:51:13 PM
 Subject: [flexcoders] Set combobox selection to data
 
 
 
 
 
 
 
 
 
   
 
 
 
 How do I set the selected value of a combobox to that of
the data 
 
 returned from the database record?
 
 
 
 
 
 
   
 
 
 
 
 
 
 
 !--
 
 #ygrp-mlmsg
{font-size:13px;font-family:arial,helvetica,clean,sans-serif;}
 #ygrp-mlmsg table {font-size:inherit;font:100%;}
 #ygrp-mlmsg select, input, textarea {font:99%
arial,helvetica,clean,sans-serif;}
 #ygrp-mlmsg pre, code {font:115% monospace;}
 #ygrp-mlmsg * {line-height:1.22em;}
 #ygrp-text{
 font-family:Georgia;
 }
 #ygrp-text p{
 margin:0 0 1em 0;
 }
 #ygrp-tpmsgs{
 font-family:Arial;
 clear:both;
 }
 #ygrp-vitnav{
 padding-top:10px;
 font-family:Verdana;
 font-size:77%;
 margin:0;
 }
 #ygrp-vitnav a{
 padding:0 1px;
 }
 #ygrp-actbar{
 clear:both;
 margin:25px 0;
 white-space:nowrap;
 color:#666;
 text-align:right;
 }
 #ygrp-actbar .left{
 float:left;
 white-space:nowrap;
 }
 .bld{font-weight:bold;}
 #ygrp-grft{
 font-family:Verdana;
 font-size:77%;
 padding:15px 0;
 }
 #ygrp-ft{
 font-family:verdana;
 font-size:77%;
 border-top:1px solid #666;
 padding:5px 0;
 }
 #ygrp-mlmsg #logo{
 padding-bottom:10px;
 }
 
 #ygrp-vital{
 background-color:#e0ecee;
 margin-bottom:20px;
 padding:2px 0 8px 8px;
 }
 #ygrp-vital #vithd{
 font-size:77%;
 font-family:Verdana;
 font-weight:bold;
 color:#333;
 text-transform:uppercase;
 }
 #ygrp-vital ul{
 padding:0;
 margin:2px 0;
 }
 #ygrp-vital ul li{
 list-style-type:none;
 clear:both;
 border:1px solid #e0ecee;
 }
 #ygrp-vital ul li .ct{
 font-weight:bold;
 color:#ff7900;
 float:right;
 width:2em;
 text-align:right;
 padding-right:.5em;
 }
 #ygrp-vital ul li .cat{
 font-weight:bold;
 }
 #ygrp-vital a {
 text-decoration:none;
 }
 
 #ygrp-vital a:hover{
 text-decoration:underline;
 }
 
 #ygrp-sponsor #hd{
 color:#999;
 font-size:77%;
 }
 #ygrp-sponsor #ov{
 padding:6px 13px;
 background-color:#e0ecee;
 margin-bottom:20px;
 }
 #ygrp-sponsor #ov ul{
 padding:0 0 0 8px;
 margin:0;
 }
 #ygrp-sponsor #ov li{
 list-style-type:square;
 padding:6px 0;
 font-size:77%;
 }
 #ygrp-sponsor #ov li a{
 text-decoration:none;
 font-size:130%;
 }
 #ygrp-sponsor #nc {
 background-color:#eee;
 margin-bottom:20px;
 padding:0 8px;
 }
 #ygrp-sponsor .ad{
 padding:8px 0;
 }
 #ygrp-sponsor .ad #hd1{
 font-family:Arial;
 font-weight:bold;
 color:#628c2a;
 font-size:100%;
 line-height:122%;
 }
 #ygrp-sponsor .ad a{
 text-decoration:none;
 }
 #ygrp-sponsor .ad a:hover{
 text-decoration:underline;
 }
 #ygrp-sponsor .ad p{
 margin:0;
 }
 o {font-size:0;}
 .MsoNormal {
 margin:0 0 0 0;
 }
 #ygrp-text tt{
 font-size:120%;
 }
 blockquote{margin:0 0 0 4px;}
 .replbq {margin:4;}
 --
 
 
 
 
 
 
 
 
  


 Do you Yahoo!?
 Everyone is raving about the all-new Yahoo! Mail beta.
 http://new.mail.yahoo.com





[flexcoders] Re: Set combobox selection to data

2006-12-01 Thread JWOpitz
I just extended the ComboBox and created a property that can bind to
an object, then internally it will updated the selectedItem:

ComboBox
http://jwopitz.pastebin.ca/263763
Needed Utility
http://jwopitz.pastebin.ca/263764

Let me know if you have any questions on its usage.  It still needs
some work but the functionality you are looking for is there.

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

 How do I set the selected value of a combobox to that of the data 
 returned from the database record?





[flexcoders] XML not taking class vars: Flex 2 / AS3.0

2006-08-22 Thread JWOpitz



I have a Command Class:public class GetHelpTextCommand implements Command, IResponder { // public var sectionID:String = "AccountManagementSection"; public var helpID:String = "H001"; // public function execute (evt:CairngormEvent):void {  trace ("command executing: " + evt.type, evt.data.helpID, evt.data.section);  var delegate:ClientDelegate = new ClientDelegate (this, MainController.EVENT_GET_HELP_TEXT);  helpID = evt.data.helpID;  sectionID = evt.data.section;  trace ("checking: " + this.sectionID, this.helpID); } // public function result (data:Object):void {  trace ("command result: " + data.type);  var xml:XML = data.result;  //here lies the problem//
  var sID:String = someValue;   /*  if sID = the class property above (sectionID) it doesnt work;  if sID = a string declared here it works.  if I plug a string directly into the code below it works but not if I target sectionID or any class property  */ trace ("XML: " + xml.section.(@name == sID));  //--//  trace ("result: " + data.data.helpID, data.data.section); } // public function fault (info:Object):void {  trace ("command fault: " + info.type); }}So does the use of xml.section.(@name == someValue) utilize some different syntax that I am not aware of? How can I just plug a property in there and have it work as any other code would normally?Thanks,Justin Opitz

__._,_.___





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








   






  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___