[flexcoders] Trouble with Combobox within a dynamically loaded swf

2009-07-19 Thread Dave Kong
When I load a swf dynamically within another swf, there is a combobox near the 
bottom edge of the inner swf. When I click on it, the dropdown extends downward 
beyond the border of the inner swf, and is therefore mostly obscured. How can I 
make it so that the dropdown will extend upward?

In a normal swf, if a combobox is near the bottom, the dropdown list will 
detect the stage border and extend upward instead. It seems like the combobox 
is not able to detect the loader's border. Is there a workaround if this is the 
case?

Thanks!



[flexcoders] Tree does not show scrollbar after inserting items

2009-05-13 Thread Dave Kong
After some googling, this seems to be an existing issue with Tree refreshes and 
I haven't been able to find a good workaround.

The issue can be repro'ed at one of Adobe's quickstart demo page: 
http://www.adobe.com/devnet/flex/quickstart/working_with_tree/

Go to the last example, and expand all nodes in the tree on the left. Height 
doesn't exceed the container, so no scrollbar. Now drag elements from the right 
to the tree to insert them. When the height of tree extends beyond the 
container, no v-scrollbar is shown.  But a scrollbar is shown after you 
collapse/expand the tree.

Invalidating the tree's list/properties/displaylist didn't seem to cause a 
refresh. The underlying collection still returns old length when Tree processes 
configureScrollBars().

Can anyone suggest a good workaround? (aside from reassigning dataProvider, 
since that's too expensive for me.)

A couple of old flexcoder threads also talks about this problem:
http://tech.groups.yahoo.com/group/flexcoders/message/46541
http://tech.groups.yahoo.com/group/flexcoders/message/37627

Thanks!



Re: [flexcoders] Tree does not show scrollbar after inserting items

2009-05-13 Thread Dave Kong
Thanks for the feedback guys!

We are still on SDK 3.0 (that's what our project is currently based on and
probably not going to change for this release in fear of other regression).
But it's certainly good to know that this issue has been addressed in newer
Flex.

I will also give refresh collection a try.

On Wed, May 13, 2009 at 1:24 PM, Yves Riel r...@cae.com wrote:



  Funny, the example doesn't work on the adobe server but if you copy the
 code and recompile it, it works and I get the scroll bar. Maybe it's an SDK
 issue; I'm using the official 3.2 SDK release.

 Also, if you are using an array collection as data provider, maybe you can
 force a refresh of the collection instead of reassigning the provider?

  --
 *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
 Behalf Of *Dave Kong
 *Sent:* Wednesday, May 13, 2009 1:01 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Tree does not show scrollbar after inserting items

  After some googling, this seems to be an existing issue with Tree
 refreshes and I haven't been able to find a good workaround.

 The issue can be repro'ed at one of Adobe's quickstart demo page:
 http://www.adobe.com/devnet/flex/quickstart/working_with_tree/

 Go to the last example, and expand all nodes in the tree on the left.
 Height doesn't exceed the container, so no scrollbar. Now drag elements from
 the right to the tree to insert them. When the height of tree extends beyond
 the container, no v-scrollbar is shown. But a scrollbar is shown after you
 collapse/expand the tree.

 Invalidating the tree's list/properties/displaylist didn't seem to cause a
 refresh. The underlying collection still returns old length when Tree
 processes configureScrollBars().

 Can anyone suggest a good workaround? (aside from reassigning dataProvider,
 since that's too expensive for me.)

 A couple of old flexcoder threads also talks about this problem:
 http://tech.groups.yahoo.com/group/flexcoders/message/46541
 http://tech.groups.yahoo.com/group/flexcoders/message/37627

 Thanks!

  



[flexcoders] Debugging in Flex Builder crashes IE, Firefox, Safari...

2009-05-12 Thread Dave Kong
Hi,

Just about 2 weeks ago, I suddenly started getting a lot of crashes when trying 
to debug our app under Flex Builder (standalone). The crashes happen as soon as 
our app is loaded and it crashes IE7, FF3, Safari w/o any prior warning or 
exception.  The crash is only happens when I try to run debug, never release. 
But about 1 in 3 debug sessions succeed without crash (with no code change in 
between whatsoever)...

Thought it was caused by Flash 10 debug player, but installing v9 debug player 
didn't help.

Googling reveals that OutofMem crashes Flash 10 player w/o warning, but this 
doesn't seem to be a Mem issue for me.

Is anyone else experiencing this?

-dave



Re: [flexcoders] Re: Is it possible to query Flash Player attributes e.g. allowFullScreen?

2009-03-23 Thread Dave Kong
Thanks Carlos,

That's not what I need though. I need to know if fullscreen is enabled via
html tag (a security safeguard) before I show the button to go into
fullscreen.

-dave

On Sat, Mar 21, 2009 at 8:46 PM, carloscarvalhar
carloscarval...@ig.com.brwrote:

   about full screen:
 switch (Application.application.stage.displayState) {
 case StageDisplayState.FULL_SCREEN:
 /* If already in full screen mode, switch to normal mode. */
 Application.application.stage.displayState = StageDisplayState.NORMAL;
 break;
 default:
 /* If not in full screen mode, switch to full screen mode. */
 Application.application.stage.displayState = StageDisplayState.FULL_SCREEN;
 }

  



[flexcoders] Is it possible to query Flash Player attributes e.g. allowFullScreen?

2009-03-21 Thread Dave Kong
I couldn't find a way to check if allowFullScreen is set to true from within 
my Flex app. Is this possible at all?

And to generalize, is it possible to query the other Flash settings that are 
set via object or embed tag in the html, such as wmode, etc?



[flexcoders] Re: Is there a way to detect mouse button state without tracking events?

2009-03-10 Thread Dave Kong
Thanks, Alex

There are a few bugs, this seems to be a core one: 
https://bugs.adobe.com/jira/browse/FP-289

--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 Quite frankly, I'm not sure there is a solution to these kinds of problems 
 with wmode.  I'll bet there's already a bug filed, but if not, please file 
 one.
 
 Alex Harui
 Flex SDK Developer
 Adobe Systems Inc.http://www.adobe.com/
 Blog: http://blogs.adobe.com/aharui
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On 
 Behalf Of Dave Kong
 Sent: Monday, March 09, 2009 2:08 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Is there a way to detect mouse button state without 
 tracking events?
 
 
 Thanks for the suggestion.
 
 The problem is that when wmode=transparent on FF, if mouse button is already 
 down (dragging scrollbar), and I exit the stage, MOUSE_LEAVE is not fired (or 
 was eaten by a framework handler somewhere). But if mouse button is UP, then 
 I do see a MOUSE_LEAVE event, but that doesn't help me.
 
 Problem is that the mouseUP is never processed when I'm outside the stage, so 
 on re-entry, buttonDown is always true when it shouldn't be...
 
 --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
 sunild99 sunilbdave@ wrote:
 
  Hi,
 
  You can use Event.MOUSE_LEAVE to detect when mouse has left the stage.
 
  You can listen for MouseEvent.MOUSE_MOVE if you need to know when the mouse 
  is back.
 
  Can you listen for MOUSE_LEAVE and dispatch your own MOUSE_UP event to stop 
  the list from scrolling?
 
  Sunil
 
 
  --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
  Dave Kong davekong@ wrote:
  
   This is a very urgent issue for us. =( Any help is deeply appreciated!
  
   On Thu, Mar 5, 2009 at 5:14 PM, Dave Kong davekong@ wrote:
  
I need to find out at this particular moment, if the mouse button is up
or down.
   
Trying to work around the issue with wmode=transparent in FF. If I 
scroll a
list, and drags cursor outside of the player and then releases the 
button.
That mouseUp event is never captured by Flash Player, so when I move 
mouse
cursor back, buttonDown is always true for all mouse events. So I need a
workaround on moues re-entry to detect if button is truly down, if not, 
call
the scrollThumb's releaseButton function so it won't keep on scrolling.
   
Thanks!
   
   
   
  
 





[flexcoders] Re: Is there a way to detect mouse button state without tracking events?

2009-03-09 Thread Dave Kong
Thanks for the suggestion.

The problem is that when wmode=transparent on FF, if mouse button is already 
down (dragging scrollbar), and I exit the stage, MOUSE_LEAVE is not fired (or 
was eaten by a framework handler somewhere). But if mouse button is UP, then I 
do see a MOUSE_LEAVE event, but that doesn't help me.

Problem is that the mouseUP is never processed when I'm outside the stage, so 
on re-entry, buttonDown is always true when it shouldn't be...

--- In flexcoders@yahoogroups.com, sunild99 sunilbd...@... wrote:

 Hi,
 
 You can use Event.MOUSE_LEAVE to detect when mouse has left the stage.
 
 You can listen for MouseEvent.MOUSE_MOVE if you need to know when the mouse 
 is back.
 
 Can you listen for MOUSE_LEAVE and dispatch your own MOUSE_UP event to stop 
 the list from scrolling?
 
 Sunil
 
 
 --- In flexcoders@yahoogroups.com, Dave Kong davekong@ wrote:
 
  This is a very urgent issue for us. =( Any help is deeply appreciated!
  
  On Thu, Mar 5, 2009 at 5:14 PM, Dave Kong davekong@ wrote:
  
 I need to find out at this particular moment, if the mouse button is up
   or down.
  
   Trying to work around the issue with wmode=transparent in FF. If I scroll 
   a
   list, and drags cursor outside of the player and then releases the button.
   That mouseUp event is never captured by Flash Player, so when I move mouse
   cursor back, buttonDown is always true for all mouse events. So I need a
   workaround on moues re-entry to detect if button is truly down, if not, 
   call
   the scrollThumb's releaseButton function so it won't keep on scrolling.
  
   Thanks!
  

  
 





Re: [flexcoders] Is there a way to detect mouse button state without tracking events?

2009-03-07 Thread Dave Kong
This is a very urgent issue for us. =( Any help is deeply appreciated!

On Thu, Mar 5, 2009 at 5:14 PM, Dave Kong davek...@gmail.com wrote:

   I need to find out at this particular moment, if the mouse button is up
 or down.

 Trying to work around the issue with wmode=transparent in FF. If I scroll a
 list, and drags cursor outside of the player and then releases the button.
 That mouseUp event is never captured by Flash Player, so when I move mouse
 cursor back, buttonDown is always true for all mouse events. So I need a
 workaround on moues re-entry to detect if button is truly down, if not, call
 the scrollThumb's releaseButton function so it won't keep on scrolling.

 Thanks!

  



[flexcoders] Is there a way to detect mouse button state without tracking events?

2009-03-05 Thread Dave Kong
I need to find out at this particular moment, if the mouse button is up or down.

Trying to work around the issue with wmode=transparent in FF. If I scroll a 
list, and drags cursor outside of the player and then releases the button. That 
mouseUp event is never captured by Flash Player, so when I move mouse cursor 
back, buttonDown is always true for all mouse events.  So I need a workaround 
on moues re-entry to detect if button is truly down, if not, call the 
scrollThumb's releaseButton function so it won't keep on scrolling.

Thanks!



[flexcoders] Does the [SWF] meta tag really support widthPercect and heightPercent attribute?

2009-02-13 Thread Dave Kong
link here http://www.actionscript.org/forums/showthread.php3?p=834470
seems to suggest that in addition to pixel width, I can specify
percent value (similar to how I do it in html flash wrapper). But I
can't get it to work.  Is it really supported?

[SWF(widthPercent=100, heightPercent=100)]

Background:

The reason I need it is to force a nested swf's size to match its
parent container (loader?) width/height, so that the preloader is
shown centered with respect to the parent application.

Right now, while loading, the nested swf seems to be at a size of
500x325 (not sure where that value came from). And it is not center
aligned wrt the parent. And I end up with a preloader that is off center.

Any suggestions?



[flexcoders] Scrollbar in nested swf losing mouse event.

2009-02-08 Thread Dave Kong
Hi every!

Would really appreciate some help on this issue. It has been driving
me nuts.

So I have a nested swf loaded via the loader. In contains a List. When
I mouseDown on the scrollbar inside that list, I can drag it as usual.
But when I hold down the mouse key and move the pointer outside of the
nested swf, but still inside the parent Flex app, the scrollbar no
longer responds to any mouse movement. (The parent app does get mouse
events.)  Now, if I continue to hold the mouse button and move it out
side of the entire browser, the scrollbar in nested swf once again
gets the mouse drag events.  If I release the mouse button while
inside the parent app, and move the mouse pointer back into the nested
swf, scrollbar will now respond to moues movement, as if the button is
still in DOWN state.

I'm guessing all mouse events are captured and eaten by the parent
app while the pointer is outside of the nested swf, but still inside
the browser.

Is there any way I can continue to pass the mouse events into the
nested swf even if I'm in the parent app?  (just like how nested swf
continue to get the moues event when I'm completely outside the browser).

Once again, any help will be greatly appreciated!  Thanks!

-dave



Re: [flexcoders] Does Flex builder 3.0.2 eclipse plug-in work in Eclipse 3.4?

2008-12-16 Thread Dave Kong
Thanks guys.

I can't find the 3.0.2 plugin download. Seems like the only way is to update
from 3.0.1, is that correct?

On Fri, Dec 12, 2008 at 4:40 PM, Andriy Panas a.pa...@gmail.com wrote:

   Hi Dave,

 I aslo Flex Builder 3.0.2 as Flex Builder Plug-in with Eclipse 3.4 on
 Windows XP - no problems noticed.

 --
 Med venlig hilsen / Best regards
 Andriy Panas
 a.pa...@gmail.com a.panas%40gmail.com
  



[flexcoders] Does Flex builder 3.0.2 eclipse plug-in work in Eclipse 3.4?

2008-12-12 Thread Dave Kong
From here:
http://www.adobe.com/support/documentation/en/flex/3/releasenotes_flex3_fb.html#install_plugin_win
Install Flex Builder Plug-in on Windows

*NOTE*: Flex Builder is only supported on Eclipse 3.2.2 or Eclipse 3.3.

where as:

*Install Flex Builder Plug-in on Mac OS X*

*NOTE*: Builder is only supported on Eclipse 3.2.2, Eclipse 3.3 and Eclipse
3.4.

So, the plugin supports 3.4 on Mac ONLY? Is this a doc error?


Re: [flexcoders] Looking for what this[iscalled]

2008-12-01 Thread Dave Kong
If you define lung as a public field of the class Whale, then it is no
longer a dynamic property, it is declared with a strong type.  I don't
believe those objects created at runtime via abc.xyz or abc[xyz] has any
type associated with them, assuming xyz is not already declared as a field
of abc.

On Sun, Nov 30, 2008 at 2:01 PM, gabriel montagné [EMAIL PROTECTED]wrote:

   Hi.


 On Sun, Nov 30, 2008 at 10:11 AM, Dave Kong [EMAIL 
 PROTECTED]davekong%40gmail.com
 wrote:
  Isn't height the dynamic property of another dynamic property
  this[something] (which is equivalent to this.something)?

 I wouldn't exactly say it like that. Dynamically accessing a property of an
 object using the [] operator (as opposed to using the dot syntax) has some
 special implications, the most important being type checking, both at
 compile-time and at run-time.

 If you have something like,
 package
 {
 public class Whale
 {
 public var lung:Lung;
 }
 }

 the compiler will rightfully choke if you tried to do something like

 var humpback:Whale = new Whale();
 humpback.lung = new Gill();

 But it wouldn't be able to notice if you did it like this:
 humpback[lung] = new Gill();

 or
 humpback[leg] = new HairyLeg();

 There, you'd get your type coercion and property errors only until runtime.

 It does have its rightful uses, of course, and you might want to check
 about
 dynamic classes, etc. but you should be mindful about them.

 gabriel.

 --
 gabriel montagné láscaris comneno
 http://rojored.com
 t/506.8367.6794
  



[flexcoders] Re: Is there a simple Flex/Flash component for making PayPal buy buttons and carts?

2008-12-01 Thread Dave Kong
--- In flexcoders@yahoogroups.com, obrian_tom [EMAIL PROTECTED] wrote:

 Ideally, free.


I have a sample for paypal button here:
http://www.rividian.com/samples/paypal/button/paypal.html

no shopping cart tho.



Re: [flexcoders] Looking for what this[iscalled]

2008-11-30 Thread Dave Kong
Isn't height the dynamic property of another dynamic property
this[something] (which is equivalent to this.something)?

the fact that you use [] syntax to access the property this.something is
just a syntactical shorthand and sometimes a workaround: you can't define
this.return (since return is a keyword), but you can do this[return].

On Fri, Nov 28, 2008 at 5:08 AM, ibnu saud [EMAIL PROTECTED] wrote:

   its an String Array the notation itself describes its an array [].


 On Fri, Nov 28, 2008 at 2:00 PM, Jake Churchill [EMAIL PROTECTED]wrote:

I call it array notation but I'm not sure if that's technically
 correct


 Nate Pearson wrote:

  What's it called when I call something by using a string?

 Like when I do this[someObject].height = 10

 someObject is a string.

 Thanks!

 -Nate


  



Re: [flexcoders] Re: How to get an object to delete itself?

2008-11-30 Thread Dave Kong
Why bother manually removing the reference to the timer's listeners?

Assmuing only the timer has reference to those listeners, once the timer is
deemed to be GC'ed (which will happen when its containing uic gets GC'ed
after it's removed from parent), the listeners will also be GC'ed (since
they can no longer be traversed from the root reference.)

If the timer is not the sole reference to those listeners, then you dont
want to GC them anyway.

On Sat, Nov 29, 2008 at 10:17 AM, Paul Andrews [EMAIL PROTECTED] wrote:

LOL, yes, I did copy and paste but forgot to edit.

 Paul

 - Original Message -
 *From:* Fotis Chatzinikos [EMAIL PROTECTED]
 *To:* flexcoders@yahoogroups.com
 *Sent:* Saturday, November 29, 2008 2:10 PM
 *Subject:* Re: [flexcoders] Re: How to get an object to delete itself?

 99% he meant :

 this.owner.removeChild(this);

 synonymous to:

 this.parent.removeChild(this);

 On Sat, Nov 29, 2008 at 4:04 PM, Amy [EMAIL PROTECTED] wrote:

--- In flexcoders@yahoogroups.com, Paul Andrews [EMAIL PROTECTED] 
 wrote:
 
  this.parent.removeChild(this);
 
  and
 
  this.parent.removeChild(this);
 
  are synonomous (except for popups, where you need to use
 this.parent.removeChild(this) ).

 Anyone else confused by this? I'm seeing the exact same statement
 (this.parent.removeChild(this)) three times, so it seems to me that of
 COURSE the first two are synonymous, as they are identical, and the
 third shouldn't actually be an exception, since it's the same as the
 first two. Am I missing something?




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

  



Re: [flexcoders] Nulls in data binding chains

2008-11-30 Thread Dave Kong
I dont know any docs, but I think it happened to me a couple of times and
the result is that the databinding simply does not fire for any changes
after the null in the chain.

Do a simple test app and try it out. it will be faster than you looking for
the doc.

On Fri, Nov 28, 2008 at 12:01 PM, Michael Prescott 
[EMAIL PROTECTED] wrote:

   Is there any reference material that describes how Flex behaves when it
 encounters a null part way along a data binding chain?

 Michael
  



[flexcoders] Re: Overriding a rest parameter

2008-06-19 Thread Dave Kong
Cool, this answers one of my questions as well.

Now, taking this a step further, how do I override something like the
logger.info which has the signature info(message:String, ... rest)?

info.apply(this, rest) obviously won't work. Do I need to insert the
message param to the head of the rest array?

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

 Alex, you are the king of everything that is awesome, thank you very
much!
 
 I keep forgetting that functions are objects just like virtually
 everything else in AS3, and now that you've pointed apply() out, I see
 where its mentioned in the docs. Thanks for reminding me of that as
well.
 
 --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote:
 
  Something like:
  
   
  
  override function foo(... rest):void
  
  {
  
  rest[1] = bar'
  
  super.foo.apply(this, rest)
  
  }
  
   
  
  
  
  From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
  Behalf Of caffeinewabbit
  Sent: Thursday, April 03, 2008 8:06 AM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Overriding a rest parameter
  
   
  
  I have a method in a parent class that I need to override in a child,
  but the parent's version of the method uses a rest (...) parameter as
  its only argument.
  
  Since the argument arrives in the overridden class as an array, how do
  I then pass that data on to the original method (i.e.
  super.function())? Is there any way to indicate that an array should
  be treated like a rest parameter?
  
  I've since solved my application specific issue using a different
  approach, but I wasn't able to find anything that addressed the
  problem above in the Docs, through Google, or here on Flexcoders.
 





[flexcoders] Re: Overriding a rest parameter

2008-06-19 Thread Dave Kong
Nevermind. I'm an idiot. This does it:

override function info(... rest):void
{
  logger.info.apply(this, rest);
}

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

 Cool, this answers one of my questions as well.
 
 Now, taking this a step further, how do I override something like the
 logger.info which has the signature info(message:String, ... rest)?
 
 info.apply(this, rest) obviously won't work. Do I need to insert the
 message param to the head of the rest array?
 
 --- In flexcoders@yahoogroups.com, caffeinewabbit
 caffeinewabbit@ wrote:
 
  Alex, you are the king of everything that is awesome, thank you very
 much!
  
  I keep forgetting that functions are objects just like virtually
  everything else in AS3, and now that you've pointed apply() out, I see
  where its mentioned in the docs. Thanks for reminding me of that as
 well.
  
  --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote:
  
   Something like:
   

   
   override function foo(... rest):void
   
   {
   
   rest[1] = bar'
   
   super.foo.apply(this, rest)
   
   }
   

   
   
   
   From: flexcoders@yahoogroups.com
 [mailto:[EMAIL PROTECTED] On
   Behalf Of caffeinewabbit
   Sent: Thursday, April 03, 2008 8:06 AM
   To: flexcoders@yahoogroups.com
   Subject: [flexcoders] Overriding a rest parameter
   

   
   I have a method in a parent class that I need to override in a
child,
   but the parent's version of the method uses a rest (...)
parameter as
   its only argument.
   
   Since the argument arrives in the overridden class as an array,
how do
   I then pass that data on to the original method (i.e.
   super.function())? Is there any way to indicate that an array should
   be treated like a rest parameter?
   
   I've since solved my application specific issue using a different
   approach, but I wasn't able to find anything that addressed the
   problem above in the Docs, through Google, or here on Flexcoders.
  
 





[flexcoders] Re: How to convert an e4x XML object into an AS object?

2008-06-04 Thread Dave Kong
Thank you, tracy.

I'm already doing the manual conversion which you've outlined. Glad to
confirm that I'm not doing it the naive way. I'm loading the xml file
locally, so no auto-conversion in lastResult there.

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

 If you leave the resultFormat as the default object, then Flex will
 convert the xml into a nested object tree automatically.  But this is
 not a very good way to do this.



 If you are sure you do not want to work directly with XML and
 XMLListCollection (there are pros and cons), then your best bet will
be
 to:

 1) Define a class with strongly typed public properties to hold your
 item data (VO)

 2) Set resultFormat=e4x to prevent Flex from converting your data.

 3) In the handler, convert event.result to xml:var myXML:XML =
 XML(event.result);

 3) Using an e4x expression on the xmlResult, get your items in an
 XMLList.

 4) for-loop over the XMLList, instanitating a new VO, and assigning
the
 values from the XMLnode to the appropriate VO property

 5) Push that onto a temporary array

 6) Create a new ArrayCollection() from the temporary array.



 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
 Behalf Of Dave Kong
 Sent: Tuesday, June 03, 2008 10:20 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] How to convert an e4x XML object into an AS
 object?



 I know SimpleXMLDecoder can decode a legacy XMLNode to an object and
 make good guesses at basic types such as string vs. int. But if I have
 the new e4x XML object, how do I easily convert that to objects? Or
 convert from E4X to XMLNode?





[flexcoders] How to convert an e4x XML object into an AS object?

2008-06-03 Thread Dave Kong
I know SimpleXMLDecoder can decode a legacy XMLNode to an object and
make good guesses at basic types such as string vs. int. But if I have
the new e4x XML object, how do I easily convert that to objects? Or
convert from E4X to XMLNode?



[flexcoders] Two difficult problems regarding synchronization of RPC in Flash

2008-06-02 Thread Dave Kong
Problem 1: How can I make sure multiple asynch remote method calls do
not end up canceling each other?

Consider this pseudo code:

onButtonClick()
{
  doStuff();
  requestSoapData.addEventListener(..., handleSoapResult);
  requestSoapData.send();
}

handleSoapResult()
{
  doMoreStuff();
  requestSoapData.removeEventListener(..., handleSoapResult); 
  // remove handler so this handler doesn't get called again when some
other control fires requestSoapData.
}

I add the listener before the call and remove after processing the
result, so that there will be no side-effect if another function calls
the same remote method. This was a pattern suggested to me previously
which I find is better than registering listeners permanently.

Now the problem is that since remote calls are asynchronous in nature,
how can I prevent the first result from coming back and removing the
listener BEFORE the second (or any subsequent) calls from invoking the
correct listener? Or am I somehow guaranteed that listeners will not
be removed until a pending remote call returns?

If this is not the correct pattern, then can anyone suggest a better
way of making sure each call to the *same* remote method invokes the
correct listener upon return w/o any side-effects from each other?

The single threaded nature of Flash Player that forces the asynch I/O
pattern leads me to my 2nd problem.

Problem 2: Is there an easy way to synchronize a string of network
calls at all?

I'm attempting to write a test script to test both my Flash frontend
and server backend. However, in order to run a series of tests, I need
to wait for the result from each previous remote call to come back
before invoking the next one.

One proven, but tedious way, is to have a string of listeners that
registers the next listener, then kicks off the next remote call. But
this just doesn't seem like good programming. The ugliness is next to
using nested if statements where a switch would do.

Can anyone suggest a better way of synchronizing remote calls for
testing purposes? Or is this just impossible due to Flash architecture?

Thanks!



[flexcoders] Re: How to add SOAP header to Flex generated webservice code?

2008-03-04 Thread Dave Kong
Thanks Mykola!

I was looking at the generated code as well and tried it as you
described. Adding headers manually did indeed work, but the downside
being that everytime I regenerate the code it will be gone.

After some tinkering, I figured out a way to have Flex's generator
honor the headers for me! Here's how to do it:

1) You must have the WS side of your app include the header info
directly in its WSDL, such as:

wsdl:operation name=ListUsers
soap:operation soapAction=http://xyz.com/ListUsers; style=document/
  wsdl:input
soap:body use=literal/
soap:header message=tns:ListUsersSessionHeader
part=SessionHeader use=literal/
  /wsdl:input
  wsdl:output
soap:body use=literal/
  /wsdl:output
/wsdl:operation

2) When you re-generate the code in Flex, it will then honor the
soap:header tag (along with the type definition for SessionHeader
at the beginning of the WSDL).

You will see new method generated on the XYZService class, such as
addYOURWSMETHODNAME_header(header:YOURHEADERTYPE). You call this
method to add the header you defined to the corresponding method, so
that every subsequent call will include the header.

(Note that the generated BaseService class actually includes header as
part of the WS call signature, but the generated top-level Service
class does not require header to be passed in the actual WS method
call each time. I think that's a good approach, since usually you use
headers for stuff like Session key which doesn't change often)

3) So how do you include the soap:header tag in WSDL? That depends
on your Back End. I'm currently using .Net, so I needed to add a
[SoapHeader] Attribute to the [WebMethods] that I want to include a
header. See MSDN doc here:
http://msdn2.microsoft.com/en-us/library/system.web.services.protocols.soapheader.aspx

Hope this helps!

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

 Hi Dave,
 
 Here is how I did that. I am using Flex Builder 3. I generated code
 from WSDL and updated my operation in the BaseXYZ class. It is just 1
 line change:
 
 public function hello():AsyncToken
 {
   // Instead of a new Array, am using the headers from the base class.
   var headerArray:Array = headers; // - my change. It was new
 Array() here
 var out:Object = new Object();
 currentOperation =

BaseAddNumbersServiceService.getPort(BaseAddNumbersServicePort).binding.portType.getOperation(hello);
 var pc:PendingCall = new PendingCall(out,headerArray);
 call(currentOperation,out,pc.token,pc.headers);
 return pc.token;
 }
 
 Now, set the headers and call the service operation:
 
 // create the service
   var ws:AddNumbersService = new AddNumbersService();
 
 // create the headers
   var q1:QName=new QName(http://soapinterop.org/xsd;, Header1);
   var header1:SOAPHeader = new SOAPHeader(q1,
 {string:bologna,int:123});
 
   ws.getWebService().addSimpleHeader(Header1,
 http://soapinterop.org/xsd;, testName, testValue);
   ws.getWebService().addHeader(header1);
 
 // set the result and error handlers
   ws.addhelloEventListener(helloResulHandler);
   ws.addAddNumbersServiceFaultEventListener(faultHandler);
 
 // call the service
   ws.hello_send();
 
 Here is what I see in tcpdump:
 
 Referer: file://localhost/Users/mykola/Documents/Flex Builder
 3/SampleClient1/bin-debug/SampleClient1.swf
 Content-type: text/xml; charset=utf-8
 SOAPAction: urn:hello
 Content-length: 606
 
 SOAP-ENV:Envelope
 xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;
 xmlns:xsd=http://www.w3.org/2001/XMLSchema;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   SOAP-ENV:Header
 ns0:Header1 xmlns:ns0=http://soapinterop.org/xsd;
   ns0:testNametestValue/ns0:testName
 /ns0:Header1
 ns0:Header1 xmlns:ns0=http://soapinterop.org/xsd;
   ns0:int123/ns0:int
   ns0:stringbologna/ns0:string
 /ns0:Header1
   /SOAP-ENV:Header
   SOAP-ENV:Body
 ns10:hello xmlns:ns10=http://service.jaxws.mdzyuba.com//
   /SOAP-ENV:Body
 /SOAP-ENV:Envelope
 
 Both headers are sent successfully. I hope it will work for you.
 
 - Mykola
 Web: http://mdzyuba.googlepages.com
 
 
 --- In flexcoders@yahoogroups.com, Dave Kong davekong@ wrote:
 
  I have used the code generator in Flex and it was fairly smooth. All
  the web methods from the WSDL were corrected generated and call/result
  pairs come in bug-free.
  
  However, I can't figure out how to add some SOAP headers to the
  service so that every call can contain my headers. Does anyone have
  experience with this? I really do like the generator and do not want
  to manually write my service code. (There are too many web methods).
  
  I see a BaseXYZService which extends from AbstractWebService, however,
  calling its addHeader method succeeds, but no headers were included in
  the actual SOAP message.  I noticed that the generated code uses
  WSDLOperation and other WSDLxxx objects, which probably does not honor

[flexcoders] How to add SOAP header to Flex generated webservice code?

2008-03-02 Thread Dave Kong
I have used the code generator in Flex and it was fairly smooth. All
the web methods from the WSDL were corrected generated and call/result
pairs come in bug-free.

However, I can't figure out how to add some SOAP headers to the
service so that every call can contain my headers. Does anyone have
experience with this? I really do like the generator and do not want
to manually write my service code. (There are too many web methods).

I see a BaseXYZService which extends from AbstractWebService, however,
calling its addHeader method succeeds, but no headers were included in
the actual SOAP message.  I noticed that the generated code uses
WSDLOperation and other WSDLxxx objects, which probably does not honor
AbstractWebService.headers array. (I assume those WSDLxxx are used by
Apache Axis 2, can anyone point me to the source?)

Any help to add headers to the Flex generated webservice code is
GREATLY APPRECIATED!



[flexcoders] Generated Webservice code does not respect custom headers

2008-02-12 Thread Dave Kong
I used Flex Builder to import webservice from a .net backup. The
generated code contained a _BaseGaiaService class that extends the
AbstractWebService and implements most of the actual operations. I can
get to that from the facade class GaiaService.getWebService() method.

I then wrote some test code to add headers like so:

var svc:BaseGaiaService = App.service.getWebService();
var q1:QName = new QName(http://abcd.com;, Header1);
var header1:SOAPHeader = new SOAPHeader(q1, {string:bologna,int:123});
var header2:SOAPHeader = new SOAPHeader(q1, {string:salami,int:321});

svc.addHeader(header1);
svc.addHeader(header2);
svc.addSimpleHeader(Header3, http://abcd.org;, sausage, 222); 

However, none of the subsequent calls contain any of these headers in
the SOAP envelope.

I've used this on my custom webservice class and headers can be added
successfully, so I suspect I'm not using the generated classes correctly. 

Can anyone please help? Many thanks from a troubled Flex newbie.



[flexcoders] Re: Flex Feedback for the Future

2008-02-12 Thread Dave Kong
I also *strongly* second the request for better printing capability on
the client side. It's highly discouraging that after building an
awesome Flex application, one finds out that you can't make decent
printouts/reports and use them in a presentation.

When people ask hey, that is an awesome RIA/web app! I can proudly
say it's Flex and it's awesome. Can't say the same when they see my
printout...


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

 I expect it'll come up more now there's AIR.
 
 Maybe it will come up FOR Air.   ;)
 
 Jason Merrill
 Bank of America  
 GTO LLD Solutions Design  Development 
 eTools  Multimedia 
 
 Bank of America Flash Platform Developer Community





[flexcoders] Re: What are the available WSDL - AS3/Flex code generators out there?

2008-02-06 Thread Dave Kong
Thank you, Sam!
That is exactly what I need and I'm such an idiot for not finding it.

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


 Flex Builder 3 has a tool to generate strongly typed classes from WSDL
(as
 of Beta 2), Import Web Service (WSDL).

 HTH,

 Sam


 ---
 We're Hiring! Seeking a passionate developer to join our team building
Flex
 based products. Position is in the Washington D.C. metro area. If
interested
 contact [EMAIL PROTECTED]

 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
 Behalf Of Dave Kong
 Sent: Monday, February 04, 2008 8:40 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] What are the available WSDL - AS3/Flex code
 generators out there?

 Hi,

 I've found Flextense to be a fairly good (free) tool translating my
 .net web service into as3 code that simplifies the tedious work of
 making up WebService result types on the Flex front end.

 There were 2 drawbacks:
 1) it's not open source, so I can't tweak the code it generates to my
 liking.
 2) it deleted my entire project folder in an attempt to generate code.
 (sure, it could be a user error from me for specifying my project
 folder  as code output directory, but it should at least NOT nuke the
 output folder when encountering errors.)

 So, can anyone recommend other code generators out there? I know about
 WebOrb, but it's for direct remoting which I do not need at this
 point. I prefer to have my back end loosely coupled.

 Thanks!





[flexcoders] Re: What are the available WSDL - AS3/Flex code generators out there?

2008-02-06 Thread Dave Kong
Hm.. hit a problem with collection results.

The [0] element always seem to be an ArrayCollection and the real
results start at element[1].

resultgenerated.webservices.ArrayOfUser (@7983241)
 [inherited]
 [0]mx.collections.ArrayCollection (@7983f41)
 [1]generated.webservices.User (@7acb549)
 [2]generated.webservices.User (@7a69d99)
 [3]generated.webservices.User (@7a896d1)
 [4]generated.webservices.User (@7acbba1)
 [5]generated.webservices.User (@7acbaf9)

Is this a bug or is there something wrong with my WS? (I checked my WS
and the raw stream does not contain extraneous data.

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

 Thank you, Sam!
 That is exactly what I need and I'm such an idiot for not finding it.

 --- In flexcoders@yahoogroups.com, Samuel R. Neff srneff.lists@
 wrote:
 
 
  Flex Builder 3 has a tool to generate strongly typed classes from
WSDL
 (as
  of Beta 2), Import Web Service (WSDL).
 
  HTH,
 
  Sam
 
 
  ---
  We're Hiring! Seeking a passionate developer to join our team
building
 Flex
  based products. Position is in the Washington D.C. metro area. If
 interested
  contact careers@
 
  -Original Message-
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
 On
  Behalf Of Dave Kong
  Sent: Monday, February 04, 2008 8:40 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] What are the available WSDL - AS3/Flex code
  generators out there?
 
  Hi,
 
  I've found Flextense to be a fairly good (free) tool translating my
  .net web service into as3 code that simplifies the tedious work of
  making up WebService result types on the Flex front end.
 
  There were 2 drawbacks:
  1) it's not open source, so I can't tweak the code it generates to
my
  liking.
  2) it deleted my entire project folder in an attempt to generate
code.
  (sure, it could be a user error from me for specifying my project
  folder  as code output directory, but it should at least NOT nuke
the
  output folder when encountering errors.)
 
  So, can anyone recommend other code generators out there? I know
about
  WebOrb, but it's for direct remoting which I do not need at this
  point. I prefer to have my back end loosely coupled.
 
  Thanks!
 





[flexcoders] What are the available WSDL - AS3/Flex code generators out there?

2008-02-05 Thread Dave Kong
Hi,

I've found Flextense to be a fairly good (free) tool translating my
.net web service into as3 code that simplifies the tedious work of
making up WebService result types on the Flex front end.

There were 2 drawbacks:
1) it's not open source, so I can't tweak the code it generates to my
liking.
2) it deleted my entire project folder in an attempt to generate code.
(sure, it could be a user error from me for specifying my project
folder  as code output directory, but it should at least NOT nuke the
output folder when encountering errors.)

So, can anyone recommend other code generators out there? I know about
WebOrb, but it's for direct remoting which I do not need at this
point. I prefer to have my back end loosely coupled.

Thanks!