[flexcoders] Re: Is it possible to do a right-click ContextMenu for a TabNavigator tab?

2009-04-16 Thread e_baggg
Thanks Tracy. I was using the SuperTabNavigator Doug McCune had posted. Our 
project is due in 2 weeks so I didn't have time to build a custom component 
will all this functionality. Man...looks like I'm SOL. 

--- In flexcoders@yahoogroups.com, Tracy Spratt tspr...@... wrote:

 Consider TabBar and Viewstack, it is more flexible than TabNavigator.
 
  
 
 Tracy Spratt,
 
 Lariat Services, development services available
 
   _  
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of e_baggg
 Sent: Wednesday, April 15, 2009 2:43 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Is it possible to do a right-click ContextMenu for a
 TabNavigator tab?
 
  
 
 
 
 
 
 
 I have a requirement where a user can right-click any one of the tabs and
 have options to delete, duplicate, disable, etc. 
 
 The tabs (children) of the mx:TabNavigator are VBoxs, and the tab name is
 pulled from the label attribute of the VBox. I can't put the ContextMenu
 against the VBox otherwise the entire area of the opened tab has the
 right-click menu. In fact, the ContextMenu only shows for the display area
 below the tab (not including the tab).
 
 Any ideas? thanks in advance for your help.





[flexcoders] Is it possible to do a right-click ContextMenu for a TabNavigator tab?

2009-04-15 Thread e_baggg
I have a requirement where a user can right-click any one of the tabs and have 
options to delete, duplicate, disable, etc. 

The tabs (children) of the mx:TabNavigator are VBoxs, and the tab name is 
pulled from the label attribute of the VBox. I can't put the ContextMenu 
against the VBox otherwise the entire area of the opened tab has the 
right-click menu. In fact, the ContextMenu only shows for the display area 
below the tab (not including the tab).

Any ideas? thanks in advance for your help.





[flexcoders] Re: Memory issues ... garbage collection only running in IE (not FF or Safari)

2008-10-29 Thread e_baggg
My original mxml was a bad example I guess. In my application, which 
is a Flex app that has its own windowing (exactly like Windows)...when 
I add and create Windows and close them, the browser CPU memory always 
increments (except for IE when I minimize the browswer window and 
memory is restored). When using System.totalMemory, I see some memory 
gets cleaned up but not all of it and if I open and close the same 
window multiple times, it is inconsistent to how much memory is given 
back to the Player, but either way it continually increments. I use 
weakReferences everywhere and call removeAllChildren() on the toplevel 
containers and set the viewComponent to null when removing the 
Mediator from the Facade (PureMvc). But yeah, when using Profiler, 
which forces a gc(), all memory is correctly restored back the player. 
Just not in runtime. The hunt continues...

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

 i've tried your example and didn't notice any memory leakage. 
 anyway, why do you need to create components and remove them, and
 create again the same components? It looks like you made up an
 artificial problem for yourself :)
 
 
 --- In flexcoders@yahoogroups.com, e_baggg e_baggg@ wrote:
 
  So I have an app in production which after 10 minutes of usage 
began 
  to perform EXTREMELY slow, and users had to restart the app. (Flex 
3) 
  Windows and Mac...all browsers. I  did some Profiling and did not 
get 
  far. Whenever I take a Memory Snapshot, gc() is forced and all my 
  objects are correctly removed from memory. So why are they not 
gc()'d 
  in normal runtime?? I know gc() only runs when new memory is 
requested 
  and nothing is being drawn/rendered. Both seem to be OK on my 
side.
  
  I have read extensively all the blogs and Adobe docs regarding 
this  
  issue, including the event listener for ENTER_FRAME which calls 
  System.gc() twice. (http://www.craftymind.com/2008/04/09/kick-
  starting-the-garbage-collector-in-actionscript-3-with-air/). This 
  unfortunately did not work for me. 
  
  To simplify, I created a simple app that adds and removes RichText 
  fields. if I create 50 of them, then remove them all, then Add one 
  back, that *should* force a gc() but it does not. The FF memory 
always 
  stays high. I noticed in IE, minimizing the browser window causes 
a 
  gc() and my memory drops to a much lower #.
  
  
  Has anyone seen or come across this? B/c of this issue, we're 
pretty 
  much going to lose our customers and try to wing a html/ajax app 
  ASAP..so I'm scrambling to resolve this. 
  
  Thanks in advance for any help.  
  
  ?xml version=1.0 encoding=utf-8?
  mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
  creationComplete=init() layout=vertical 
  mx:Script
  ![CDATA[
  import mx.controls.RichTextEditor;
  
  private function removeit():void
  {
  this.removeChildAt(2);
  }
  
  private function doit():void
  {
  var rte : RichTextEditor = new 
  RichTextEditor();
  rte.width=300;
  rte.height=150;
  this.addChild(rte);
  }
  ]]
  /mx:Script
  mx:Button click=doit() label=Add/
  mx:Button click=removeit() label=Remove/
  /mx:Application
 






[flexcoders] Memory issues ... garbage collection only running in IE (not FF or Safari)

2008-10-28 Thread e_baggg
So I have an app in production which after 10 minutes of usage began 
to perform EXTREMELY slow, and users had to restart the app. (Flex 3) 
Windows and Mac...all browsers. I  did some Profiling and did not get 
far. Whenever I take a Memory Snapshot, gc() is forced and all my 
objects are correctly removed from memory. So why are they not gc()'d 
in normal runtime?? I know gc() only runs when new memory is requested 
and nothing is being drawn/rendered. Both seem to be OK on my side.

I have read extensively all the blogs and Adobe docs regarding this  
issue, including the event listener for ENTER_FRAME which calls 
System.gc() twice. (http://www.craftymind.com/2008/04/09/kick-
starting-the-garbage-collector-in-actionscript-3-with-air/). This 
unfortunately did not work for me. 

To simplify, I created a simple app that adds and removes RichText 
fields. if I create 50 of them, then remove them all, then Add one 
back, that *should* force a gc() but it does not. The FF memory always 
stays high. I noticed in IE, minimizing the browser window causes a 
gc() and my memory drops to a much lower #.


Has anyone seen or come across this? B/c of this issue, we're pretty 
much going to lose our customers and try to wing a html/ajax app 
ASAP..so I'm scrambling to resolve this. 

Thanks in advance for any help.  

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
creationComplete=init() layout=vertical 
mx:Script
![CDATA[
import mx.controls.RichTextEditor;

private function removeit():void
{
this.removeChildAt(2);
}

private function doit():void
{
var rte : RichTextEditor = new 
RichTextEditor();
rte.width=300;
rte.height=150;
this.addChild(rte);
}
]]
/mx:Script
mx:Button click=doit() label=Add/
mx:Button click=removeit() label=Remove/
/mx:Application




[flexcoders] Re: Memory issues ... garbage collection only running in IE (not FF or Safari)

2008-10-28 Thread e_baggg
Thanks for the great advice so far...so what is the best way of 
freeing Images for gc()? I have a DataGrid that has an itemRenderer 
with a mx:Image/...if I have a dataProvider ArrayCollection (where 
each records has a URL that the Image uses)...does simply setting the 
dataProvider to null take care of marking the image for GC? And 
anything I have a Bitmap for? Simply setting to null.

Thanks again. 

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

 If your app creates lots of stuff, you'll create a high-water mark 
and GC won't run until you get back up near that high-water mark.  
Images are known to easy ways to set that high-water mark pretty high.
 
 In general, the answer is to re-use instead of re-create, and only 
create what you need when you need it.
 
 -Alex
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
On Behalf Of Blake Barrett
 Sent: Tuesday, October 28, 2008 3:09 PM
 To: flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] Memory issues ... garbage collection only 
running in IE (not FF or Safari)
 
 e_baggg,
 You're not the only one. We're experiencing very similar 
problems. Our app just keeps gobbling memory until the browser 
crashes. We've had to resort to calling dispose() explicitly on every 
mx:Image and bitmap we ever instantiate, and explicitly calling 
removeAllChildren() on every contaniner before navigating away from 
anything. Helps a little. I'm going to look in to the link you 
mentioned. Maybe that will help us a little more than it has for you 
(fingers crossed).
 
 Let us all know if you find anything else out.
 
 Blake
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
On Behalf Of e_baggg
 Sent: Tuesday, October 28, 2008 2:51 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Memory issues ... garbage collection only 
running in IE (not FF or Safari)
 
 So I have an app in production which after 10 minutes of usage began
 to perform EXTREMELY slow, and users had to restart the app. (Flex 
3)
 Windows and Mac...all browsers. I did some Profiling and did not get
 far. Whenever I take a Memory Snapshot, gc() is forced and all my
 objects are correctly removed from memory. So why are they not 
gc()'d
 in normal runtime?? I know gc() only runs when new memory is 
requested
 and nothing is being drawn/rendered. Both seem to be OK on my side.
 
 I have read extensively all the blogs and Adobe docs regarding this
 issue, including the event listener for ENTER_FRAME which calls
 System.gc() twice. (http://www.craftymind.com/2008/04/09/kick-
 starting-the-garbage-collector-in-actionscript-3-with-air/). This
 unfortunately did not work for me.
 
 To simplify, I created a simple app that adds and removes RichText
 fields. if I create 50 of them, then remove them all, then Add one
 back, that *should* force a gc() but it does not. The FF memory 
always
 stays high. I noticed in IE, minimizing the browser window causes a
 gc() and my memory drops to a much lower #.
 
 Has anyone seen or come across this? B/c of this issue, we're pretty
 much going to lose our customers and try to wing a html/ajax app
 ASAP..so I'm scrambling to resolve this.
 
 Thanks in advance for any help.
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 creationComplete=init() layout=vertical 
 mx:Script
 ![CDATA[
 import mx.controls.RichTextEditor;
 
 private function removeit():void
 {
 this.removeChildAt(2);
 }
 
 private function doit():void
 {
 var rte : RichTextEditor = new
 RichTextEditor();
 rte.width=300;
 rte.height=150;
 this.addChild(rte);
 }
 ]]
 /mx:Script
 mx:Button click=doit() label=Add/
 mx:Button click=removeit() label=Remove/
 /mx:Application






[flexcoders] Re: Socket HTTP/1.1 connection not closed even after Response is sent

2008-06-12 Thread e_baggg
After thoroughly reading the Adobe socket policy docs, it looks like
I'm going to have to open up port 843 and serve the new
crossdomain.xml that way.  Even though I have it on my root and call
Security.loadPolicy() on it (and I see in the logger that it accepts
it), it still calls 843, hangs, (b/c it doesn't exist there), than the
Flash player throws a security error. Rather frustrating. So it goes.
I'm on the debug FP version: WIN 9,0,124,0

This crossdomain below is on my root webserver and my app is on port
9080. Even if I move my html and swf to the main root (port 80)..it
still fails.

?xml version=1.0?
!DOCTYPE cross-domain-policy SYSTEM
http://www.adobe.com/xml/dtds/cross-domain-policy.dtd;
cross-domain-policy
site-control permitted-cross-domain-policies=master-only/
allow-access-from domain=* to-ports=8080-9080/
/cross-domain-policy


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

 You can set any headers you like so long as they're specified in your
 crossdomain.xml, and they're not on the banned list.
 
 Details:
 

http://www.adobe.com/devnet/flashplayer/articles/flash_player9_security_update.html#policy_file
 
 Baninanted headers:
 

http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403030sliceId=1
 
 AFAIK jsessionid is a cookie and the browser should be putting it in
to any
 request made from Flex via HttpService. You may have the one Flash
Player
 version (apparently 9.0.115.0) that blocks Authorization header info.
 
 -Josh
 
 On Thu, Jun 12, 2008 at 2:20 PM, e_baggg [EMAIL PROTECTED] wrote:
 
I am doing hand-rolled GETs because Flex (HttpService) cannot pass
  headers (ie jessionid). Thus, I need to open my own flash.net.Socket
  and write/read the request/response manually. It works great with
  Digest authorization except for this policy issue. I suppose I can get
  around this making the login page a JSP and make the redirect go to
  the swf html page...and from there use HttpServicebut still I hate
  hacks. Such a shame this policy stuff is such a nightmare. I followed
  the Adobe docs exactly and I still have issues. I'll work on this more
  and report back anything I find.
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
Josh
  McDonald dznuts@ wrote:
  
   Also, maybe we should look at the root of the problem - what is it
  you're
   actually trying to do via sockets and hand-rolled GETs that you
can't do
   with httpService?
   -Josh
  
   On Thu, Jun 12, 2008 at 9:51 AM, Josh McDonald josh@ wrote:
  
You'll have to use something like Charles to listen to what Flash
  player is
doing behind your back for the policy file to be sure, but if you
  try and
open a socket to somedomain.com:9080, I believe Flash is going to
  look for
somedomain.com:80/crossdomain.xml - Flash doesn't know that
the socket
you're connecting to is a http server, so it only knows to
look in the
default location, and it's not going to get your crossdomain file
  if it's on
the server listening on 9080.
Like I said, check with Charles to be sure, but it would make
  sense to me
at least.
   
-Josh
   
   
On Thu, Jun 12, 2008 at 8:35 AM, e_baggg e_baggg@ wrote:
   
I spoke too soon. The 3 second delay still exists and when I
set up
the Swf policy file debugger for Windows...the Flash player
outputs
this. My concern is that first warning. According to the docs,
  calling
Security.loadPolicyFile() to the domain and port (which line
2 says
happened ok) should fix everything. I just updated my Windows XP,
which I read somewhere upgrades the flash player. I still
have the
debug version though. This is all a mess to me.
   
OK: Root-level SWF loaded:
http://my.domain.com:9080/xms-app/xms.swf
OK: Policy file accepted:
http://my.domain.com:9080/crossdomain.xml
Warning: Timeout on xmlsocket://my.domain.com:843 (at 3 seconds)
  while
waiting for socket policy file. This should not cause any
problems,
but see http://www.adobe.com/go/strict_policy_files for an
  explanation.
Warning: [strict] Requesting socket policy file from
xmlsocket://my.domain.com:9080 due to socket connection
request from
SWF at http://my.domain.com:9080/xms-app/xms.swf. See
http://www.adobe.com/go/strict_policy_files if this causes
problems.
Warning: Timeout on xmlsocket://my.domain.com:9080 (at 3 seconds)
while waiting for socket policy file. This should not cause any
problems, but see http://www.adobe.com/go/strict_policy_files
for an
explanation.
Warning: SWF from http://my.domain.com:9080/xms-app/xms.swf
will be
permitted to connect to a socket in its own domain without a
policy
file. This configuration is deprecated. See
http://www.adobe.com/go/strict_policy_files to fix this problem.
Warning: SWF from http://my.domain.com:9080/xms-app/xms.swf
will be
permitted to connect to a socket in its own domain without

[flexcoders] Re: Socket HTTP/1.1 connection not closed even after Response is sent

2008-06-12 Thread e_baggg
I finally got it working. No matter what, the Flash player makes a
request to port 843 asking for the cross-domain...even if you call
Security.loadPolicyFile(). I found a source example where a Java
socket (which I kicked off in a shell script) listens on port 843 and
returns the policy file. So, I therefore never need to call
Security.loadPolicy(). Here's the link to that library. You need to
make sure this port is open on your firewall which is easily testable
with a telnet call. This port 843 method is actually the recommended
way to do it according to Adobe.

http://www.flash-resources.net/

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

 Let us know how it works. It's really a painful process really,
there's got
 to be a better way to secure the player against attacks without
requiring
 funky custom sockets needing being opened :(
 
 -Josh
 
 On Fri, Jun 13, 2008 at 3:08 AM, e_baggg [EMAIL PROTECTED] wrote:
 
After thoroughly reading the Adobe socket policy docs, it looks like
  I'm going to have to open up port 843 and serve the new
  crossdomain.xml that way. Even though I have it on my root and call
  Security.loadPolicy() on it (and I see in the logger that it accepts
  it), it still calls 843, hangs, (b/c it doesn't exist there), than the
  Flash player throws a security error. Rather frustrating. So it goes.
  I'm on the debug FP version: WIN 9,0,124,0
 
  This crossdomain below is on my root webserver and my app is on port
  9080. Even if I move my html and swf to the main root (port 80)..it
  still fails.
 
  ?xml version=1.0?
  !DOCTYPE cross-domain-policy SYSTEM
  http://www.adobe.com/xml/dtds/cross-domain-policy.dtd;
  cross-domain-policy
  site-control permitted-cross-domain-policies=master-only/
  allow-access-from domain=* to-ports=8080-9080/
  /cross-domain-policy
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
Josh
  McDonald dznuts@ wrote:
  
   You can set any headers you like so long as they're specified in
your
   crossdomain.xml, and they're not on the banned list.
  
   Details:
  
  
 
 
http://www.adobe.com/devnet/flashplayer/articles/flash_player9_security_update.html#policy_file
  
   Baninanted headers:
  
  
 
 
http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403030sliceId=1
  
   AFAIK jsessionid is a cookie and the browser should be putting it in
  to any
   request made from Flex via HttpService. You may have the one Flash
  Player
   version (apparently 9.0.115.0) that blocks Authorization header
info.
  
   -Josh
  
   On Thu, Jun 12, 2008 at 2:20 PM, e_baggg e_baggg@ wrote:
  
I am doing hand-rolled GETs because Flex (HttpService) cannot pass
headers (ie jessionid). Thus, I need to open my own
flash.net.Socket
and write/read the request/response manually. It works great with
Digest authorization except for this policy issue. I suppose I
can get
around this making the login page a JSP and make the redirect
go to
the swf html page...and from there use HttpServicebut
still I hate
hacks. Such a shame this policy stuff is such a nightmare. I
followed
the Adobe docs exactly and I still have issues. I'll work on
this more
and report back anything I find.
   
   
--- In flexcoders@yahoogroups.com
flexcoders%40yahoogroups.comflexcoders%
  40yahoogroups.com,
 
  Josh
McDonald dznuts@ wrote:

 Also, maybe we should look at the root of the problem - what
is it
you're
 actually trying to do via sockets and hand-rolled GETs that you
  can't do
 with httpService?
 -Josh

 On Thu, Jun 12, 2008 at 9:51 AM, Josh McDonald josh@ wrote:

  You'll have to use something like Charles to listen to
what Flash
player is
  doing behind your back for the policy file to be sure, but
if you
try and
  open a socket to somedomain.com:9080, I believe Flash is
going to
look for
  somedomain.com:80/crossdomain.xml - Flash doesn't know that
  the socket
  you're connecting to is a http server, so it only knows to
  look in the
  default location, and it's not going to get your
crossdomain file
if it's on
  the server listening on 9080.
  Like I said, check with Charles to be sure, but it would make
sense to me
  at least.
 
  -Josh
 
 
  On Thu, Jun 12, 2008 at 8:35 AM, e_baggg e_baggg@ wrote:
 
  I spoke too soon. The 3 second delay still exists and when I
  set up
  the Swf policy file debugger for Windows...the Flash player
  outputs
  this. My concern is that first warning. According to the
docs,
calling
  Security.loadPolicyFile() to the domain and port (which line
  2 says
  happened ok) should fix everything. I just updated my
Windows XP,
  which I read somewhere upgrades the flash player. I still
  have the
  debug version though. This is all a mess to me.
 
  OK: Root-level SWF loaded:
  http://my.domain.com:9080/xms-app/xms.swf

[flexcoders] Re: Socket HTTP/1.1 connection not closed even after Response is sent

2008-06-11 Thread e_baggg
Thanks for your response...I have a full access cross domain on my
server and loading it via Security.loadPolicyFile() does nothing as
well. Hmm...

cross-domain-policy
allow-access-from domain=*/
/cross-domain-policy

--- In flexcoders@yahoogroups.com, å`¨æŒ¯å®‡ [EMAIL PROTECTED] wrote:

 When you use a socket or xmlsocket in a remote swf file,
 flashplayer would send a policy-request to the server.
 Check 

http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_04.html
 
 When you run it locally, flashplayer won't do this.
 
 I'm not sure if this is the reason.
 Maybe you should call Security.loadPolicyFile() yourself and let the 
 server give it a correct respond.
 
 
 Josh McDonald wrote:
 
  It sounds to me like your server is simply holding the connection for 
  a few seconds in order to prevent brute-force password attacks.
 
  -Josh
 
  On Wed, Jun 11, 2008 at 6:23 AM, e_baggg [EMAIL PROTECTED] 
  mailto:[EMAIL PROTECTED] wrote:
 
  This is baffling me. For authentication reasons, I am doing all my
  HTTP traffic via a custom flash.net.Socket where I create and
parse
  the HTTP request/response myself (using Digest authorization).
  Everything works fine when I run the generated html/swf files
locally,
  but once I deploy them to the unprotected part of a webserver, the
  response connection is not dropped by the server for several
seconds.
  I do a GET and receive the 401 immediately...send the same GET
request
  again with the Digest info. I receive the correct response
from the
  server immediately but the socket is not closed for 4 seconds
by the
  server. Has anyone seen this?
 
  I have Connection: close in my request but the socket is
still kept
  open. If I access this URI via browser URL bar, the delay is not
  there. I sniffed the packets and even if I mimic the request
String
  exactly, the socket still hangs for 4 seconds. I suspect I am not
  closing the socket request, though '\r\n\r\n' seems to be the
standard
  (and it works when it runs locally). Any ideas???
 
  Here is my exact request that hangs though the 200 response is
  received immediately:
 
  GET /myapp/mydata.xml HTTP/1.1\r\n
  Host: www.mydomain.com http://www.mydomain.com\r\n
  Content-Type: application/x-www-form-urlencoded\r\n
  Keep-Alive: 1\r\n
  Connection: close\r\n
  Cookie: JSESSIONID=8CCB32BBEDB875F082709FE17AA93679;\r\n
  Authorization: Digest username=user1, realm=MYAPP,
 
nonce=MTIxMzEyODYwOTE0MDo1Njg5NTllYTUxMDYyN2VmNGNmMjViMTA4MDFiMDRjMA==,
  uri=/myapp/mydata.xml,
response=1175bbe7d5840a0d94fb5de3ef16a2a3,
  qop=auth, nc=1, cnonce=0a4f113b\r\n\r\n
 
 
 
 
  -- 
  Therefore, send not to know For whom the bell tolls. It tolls for
thee.
 
  :: Josh 'G-Funk' McDonald
  :: 0437 221 380 :: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 





[flexcoders] Re: Socket HTTP/1.1 connection not closed even after Response is sent

2008-06-11 Thread e_baggg
Actually, I stand corrected. Once I added in my port # to the
cross-domain...it worked. Thanks again gang! Big help!


cross-domain-policy
  allow-access-from domain=* to-ports=9080,8080/
/cross-domain-policy



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

 Thanks for your response...I have a full access cross domain on my
 server and loading it via Security.loadPolicyFile() does nothing as
 well. Hmm...
 
 cross-domain-policy
 allow-access-from domain=*/
 /cross-domain-policy
 
 --- In flexcoders@yahoogroups.com, å`¨æŒ¯å®‡ zhenyu.zhou@ wrote:
 
  When you use a socket or xmlsocket in a remote swf file,
  flashplayer would send a policy-request to the server.
  Check 
 

http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_04.html
  
  When you run it locally, flashplayer won't do this.
  
  I'm not sure if this is the reason.
  Maybe you should call Security.loadPolicyFile() yourself and let the 
  server give it a correct respond.
  
  
  Josh McDonald wrote:
  
   It sounds to me like your server is simply holding the
connection for 
   a few seconds in order to prevent brute-force password attacks.
  
   -Josh
  
   On Wed, Jun 11, 2008 at 6:23 AM, e_baggg e_baggg@ 
   mailto:e_baggg@ wrote:
  
   This is baffling me. For authentication reasons, I am doing
all my
   HTTP traffic via a custom flash.net.Socket where I create and
 parse
   the HTTP request/response myself (using Digest authorization).
   Everything works fine when I run the generated html/swf files
 locally,
   but once I deploy them to the unprotected part of a
webserver, the
   response connection is not dropped by the server for several
 seconds.
   I do a GET and receive the 401 immediately...send the same GET
 request
   again with the Digest info. I receive the correct response
 from the
   server immediately but the socket is not closed for 4 seconds
 by the
   server. Has anyone seen this?
  
   I have Connection: close in my request but the socket is
 still kept
   open. If I access this URI via browser URL bar, the delay is not
   there. I sniffed the packets and even if I mimic the request
 String
   exactly, the socket still hangs for 4 seconds. I suspect I
am not
   closing the socket request, though '\r\n\r\n' seems to be the
 standard
   (and it works when it runs locally). Any ideas???
  
   Here is my exact request that hangs though the 200 response is
   received immediately:
  
   GET /myapp/mydata.xml HTTP/1.1\r\n
   Host: www.mydomain.com http://www.mydomain.com\r\n
   Content-Type: application/x-www-form-urlencoded\r\n
   Keep-Alive: 1\r\n
   Connection: close\r\n
   Cookie: JSESSIONID=8CCB32BBEDB875F082709FE17AA93679;\r\n
   Authorization: Digest username=user1, realm=MYAPP,
  

nonce=MTIxMzEyODYwOTE0MDo1Njg5NTllYTUxMDYyN2VmNGNmMjViMTA4MDFiMDRjMA==,
   uri=/myapp/mydata.xml,
 response=1175bbe7d5840a0d94fb5de3ef16a2a3,
   qop=auth, nc=1, cnonce=0a4f113b\r\n\r\n
  
  
  
  
   -- 
   Therefore, send not to know For whom the bell tolls. It tolls for
 thee.
  
   :: Josh 'G-Funk' McDonald
   :: 0437 221 380 :: josh@ mailto:josh@
  
 





[flexcoders] Re: Socket HTTP/1.1 connection not closed even after Response is sent

2008-06-11 Thread e_baggg
I spoke too soon. The 3 second delay still exists and when I set up
the Swf policy file debugger for Windows...the Flash player outputs
this. My concern is that first warning. According to the docs, calling
Security.loadPolicyFile() to the domain and port (which line 2 says
happened ok) should fix everything. I just updated my Windows XP,
which I read somewhere upgrades the flash player. I still have the
debug version though. This is all a mess to me.

OK: Root-level SWF loaded: http://my.domain.com:9080/xms-app/xms.swf
OK: Policy file accepted: http://my.domain.com:9080/crossdomain.xml
Warning: Timeout on xmlsocket://my.domain.com:843 (at 3 seconds) while
waiting for socket policy file.  This should not cause any problems,
but see http://www.adobe.com/go/strict_policy_files for an explanation.
Warning: [strict] Requesting socket policy file from
xmlsocket://my.domain.com:9080 due to socket connection request from
SWF at http://my.domain.com:9080/xms-app/xms.swf.  See
http://www.adobe.com/go/strict_policy_files if this causes problems.
Warning: Timeout on xmlsocket://my.domain.com:9080 (at 3 seconds)
while waiting for socket policy file.  This should not cause any
problems, but see http://www.adobe.com/go/strict_policy_files for an
explanation.
Warning: SWF from http://my.domain.com:9080/xms-app/xms.swf will be
permitted to connect to a socket in its own domain without a policy
file.  This configuration is deprecated.  See
http://www.adobe.com/go/strict_policy_files to fix this problem.
Warning: SWF from http://my.domain.com:9080/xms-app/xms.swf will be
permitted to connect to a socket in its own domain without a policy
file.  This configuration is deprecated.  See
http://www.adobe.com/go/strict_policy_files to fix this problem.
--- In flexcoders@yahoogroups.com, e_baggg [EMAIL PROTECTED] wrote:

 Actually, I stand corrected. Once I added in my port # to the
 cross-domain...it worked. Thanks again gang! Big help!
 
 
 cross-domain-policy
   allow-access-from domain=* to-ports=9080,8080/
 /cross-domain-policy
 
 
 
 --- In flexcoders@yahoogroups.com, e_baggg e_baggg@ wrote:
 
  Thanks for your response...I have a full access cross domain on my
  server and loading it via Security.loadPolicyFile() does nothing as
  well. Hmm...
  
  cross-domain-policy
  allow-access-from domain=*/
  /cross-domain-policy
  
  --- In flexcoders@yahoogroups.com, å`¨æŒ¯å®‡ zhenyu.zhou@ wrote:
  
   When you use a socket or xmlsocket in a remote swf file,
   flashplayer would send a policy-request to the server.
   Check 
  
 

http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_04.html
   
   When you run it locally, flashplayer won't do this.
   
   I'm not sure if this is the reason.
   Maybe you should call Security.loadPolicyFile() yourself and let
the 
   server give it a correct respond.
   
   
   Josh McDonald wrote:
   
It sounds to me like your server is simply holding the
 connection for 
a few seconds in order to prevent brute-force password attacks.
   
-Josh
   
On Wed, Jun 11, 2008 at 6:23 AM, e_baggg e_baggg@ 
mailto:e_baggg@ wrote:
   
This is baffling me. For authentication reasons, I am doing
 all my
HTTP traffic via a custom flash.net.Socket where I create and
  parse
the HTTP request/response myself (using Digest authorization).
Everything works fine when I run the generated html/swf files
  locally,
but once I deploy them to the unprotected part of a
 webserver, the
response connection is not dropped by the server for several
  seconds.
I do a GET and receive the 401 immediately...send the same GET
  request
again with the Digest info. I receive the correct response
  from the
server immediately but the socket is not closed for 4 seconds
  by the
server. Has anyone seen this?
   
I have Connection: close in my request but the socket is
  still kept
open. If I access this URI via browser URL bar, the delay
is not
there. I sniffed the packets and even if I mimic the request
  String
exactly, the socket still hangs for 4 seconds. I suspect I
 am not
closing the socket request, though '\r\n\r\n' seems to be the
  standard
(and it works when it runs locally). Any ideas???
   
Here is my exact request that hangs though the 200 response is
received immediately:
   
GET /myapp/mydata.xml HTTP/1.1\r\n
Host: www.mydomain.com http://www.mydomain.com\r\n
Content-Type: application/x-www-form-urlencoded\r\n
Keep-Alive: 1\r\n
Connection: close\r\n
Cookie: JSESSIONID=8CCB32BBEDB875F082709FE17AA93679;\r\n
Authorization: Digest username=user1, realm=MYAPP,
   
 

nonce=MTIxMzEyODYwOTE0MDo1Njg5NTllYTUxMDYyN2VmNGNmMjViMTA4MDFiMDRjMA==,
uri=/myapp/mydata.xml,
  response=1175bbe7d5840a0d94fb5de3ef16a2a3,
qop=auth, nc=1, cnonce=0a4f113b\r\n\r\n

[flexcoders] Re: Socket HTTP/1.1 connection not closed even after Response is sent

2008-06-11 Thread e_baggg
I am doing hand-rolled GETs because Flex (HttpService) cannot pass 
headers (ie jessionid). Thus, I need to open my own flash.net.Socket
and write/read the request/response manually. It works great with
Digest authorization except for this policy issue. I suppose I can get
around this making the login page a JSP and make the redirect go to
the swf html page...and from there use HttpServicebut still I hate
hacks. Such a shame this policy stuff is such a nightmare. I followed
the Adobe docs exactly and I still have issues. I'll work on this more
and report back anything I find.

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

 Also, maybe we should look at the root of the problem - what is it
you're
 actually trying to do via sockets and hand-rolled GETs that you can't do
 with httpService?
 -Josh
 
 On Thu, Jun 12, 2008 at 9:51 AM, Josh McDonald [EMAIL PROTECTED] wrote:
 
  You'll have to use something like Charles to listen to what Flash
player is
  doing behind your back for the policy file to be sure, but if you
try and
  open a socket to somedomain.com:9080, I believe Flash is going to
look for
  somedomain.com:80/crossdomain.xml - Flash doesn't know that the socket
  you're connecting to is a http server, so it only knows to look in the
  default location, and it's not going to get your crossdomain file
if it's on
  the server listening on 9080.
  Like I said, check with Charles to be sure, but it would make
sense to me
  at least.
 
  -Josh
 
 
  On Thu, Jun 12, 2008 at 8:35 AM, e_baggg [EMAIL PROTECTED] wrote:
 
I spoke too soon. The 3 second delay still exists and when I set up
  the Swf policy file debugger for Windows...the Flash player outputs
  this. My concern is that first warning. According to the docs,
calling
  Security.loadPolicyFile() to the domain and port (which line 2 says
  happened ok) should fix everything. I just updated my Windows XP,
  which I read somewhere upgrades the flash player. I still have the
  debug version though. This is all a mess to me.
 
  OK: Root-level SWF loaded: http://my.domain.com:9080/xms-app/xms.swf
  OK: Policy file accepted: http://my.domain.com:9080/crossdomain.xml
  Warning: Timeout on xmlsocket://my.domain.com:843 (at 3 seconds)
while
  waiting for socket policy file. This should not cause any problems,
  but see http://www.adobe.com/go/strict_policy_files for an
explanation.
  Warning: [strict] Requesting socket policy file from
  xmlsocket://my.domain.com:9080 due to socket connection request from
  SWF at http://my.domain.com:9080/xms-app/xms.swf. See
  http://www.adobe.com/go/strict_policy_files if this causes problems.
  Warning: Timeout on xmlsocket://my.domain.com:9080 (at 3 seconds)
  while waiting for socket policy file. This should not cause any
  problems, but see http://www.adobe.com/go/strict_policy_files for an
  explanation.
  Warning: SWF from http://my.domain.com:9080/xms-app/xms.swf will be
  permitted to connect to a socket in its own domain without a policy
  file. This configuration is deprecated. See
  http://www.adobe.com/go/strict_policy_files to fix this problem.
  Warning: SWF from http://my.domain.com:9080/xms-app/xms.swf will be
  permitted to connect to a socket in its own domain without a policy
  file. This configuration is deprecated. See
  http://www.adobe.com/go/strict_policy_files to fix this problem.
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
  e_baggg e_baggg@ wrote:
  
   Actually, I stand corrected. Once I added in my port # to the
   cross-domain...it worked. Thanks again gang! Big help!
  
  
   cross-domain-policy
   allow-access-from domain=* to-ports=9080,8080/
   /cross-domain-policy
  
  
  
   --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
  e_baggg e_baggg@ wrote:
   
Thanks for your response...I have a full access cross domain
on my
server and loading it via Security.loadPolicyFile() does
nothing as
well. Hmm...
   
cross-domain-policy
allow-access-from domain=*/
/cross-domain-policy
   
--- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
  å`¨æŒ¯å(R)‡ zhenyu.zhou@ wrote:

 When you use a socket or xmlsocket in a remote swf file,
 flashplayer would send a policy-request to the server.
 Check

   
  
 
http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_04.html

 When you run it locally, flashplayer won't do this.

 I'm not sure if this is the reason.
 Maybe you should call Security.loadPolicyFile() yourself
and let
  the
 server give it a correct respond.


 Josh McDonald wrote:
 
  It sounds to me like your server is simply holding the
   connection for
  a few seconds in order to prevent brute-force password
attacks.
 
  -Josh
 
  On Wed, Jun 11, 2008 at 6:23 AM, e_baggg e_baggg@
  mailto:e_baggg@ wrote:
 
  This is baffling me. For authentication reasons, I am doing
   all my

[flexcoders] Socket HTTP/1.1 connection not closed even after Response is sent

2008-06-10 Thread e_baggg
This is baffling me. For authentication reasons, I am doing all my
HTTP traffic via a custom flash.net.Socket where I create and parse
the HTTP request/response myself (using Digest authorization).
Everything works fine when I run the generated html/swf files locally,
but once I deploy them to the unprotected part of a webserver, the
response connection is not dropped by the server for several seconds.
I do a GET and receive the 401 immediately...send the same GET request
again with the Digest info. I receive the correct response from the
server immediately but the socket is not closed for 4 seconds by the
server. Has anyone seen this? 

I have Connection: close in my request but the socket is still kept
open. If I access this URI via browser URL bar, the delay is not
there. I sniffed the packets and even if I mimic the request String
exactly, the socket still hangs for 4 seconds. I suspect I am not
closing the socket request, though '\r\n\r\n' seems to be the standard
 (and it works when it runs locally). Any ideas???

Here is my exact request that hangs though the 200 response is
received immediately:

GET /myapp/mydata.xml HTTP/1.1\r\n
Host: www.mydomain.com\r\n
Content-Type: application/x-www-form-urlencoded\r\n
Keep-Alive: 1\r\n
Connection: close\r\n
Cookie: JSESSIONID=8CCB32BBEDB875F082709FE17AA93679;\r\n
Authorization: Digest username=user1, realm=MYAPP,
nonce=MTIxMzEyODYwOTE0MDo1Njg5NTllYTUxMDYyN2VmNGNmMjViMTA4MDFiMDRjMA==,
uri=/myapp/mydata.xml, response=1175bbe7d5840a0d94fb5de3ef16a2a3,
qop=auth, nc=1, cnonce=0a4f113b\r\n\r\n



[flexcoders] Parsing FLV meta data

2008-04-21 Thread e_baggg
Hello all. I am writing a Java library to parse out the metadata of a
FLV. It is working OK for a specific .flv, but the problem is the meta
data can be rather random of where it appears after the onMetaData
header. The FLV usually has a onMetaData and 0-n onTransition
headers. Usually there is a Decimal 2 byte (Start of text) followed by
a 0 (Null) byte to signify the end. However, sometimes this occurs at
the end of eahc 'videodatarate' and 'audiodatarate' data lines (which
is still part of the onMetaData tag)...so I am not sure which byte or
byte sequence signifies the end of the meta data bytes. Does anyone know?

Thanks in advance. 



[flexcoders] Re: Unable to send HTTP parameters via Socket Digest Auhtorization

2008-04-07 Thread e_baggg
I am not sure why but I am using HTTP/1.1 and sending the request
string with '/r/n/r/n' at the end sends the request and I receive the
response...but the TCP socket is not closed. Thus the request just
hangs for 5 seconds until finally the socket is killed on one end. Any
ideas why the socket is not properly closed when I receive the response? 

GET /app/myaction.action HTTP/1.1
Host: www.mydomain.com
Authorization:Basic ZGV2MTpwYXNzd29yZA==

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

 
 On 3 Apr 2008, at 22:11, e_baggg wrote:
  anyone see anything wrong with this?:
 
  POST /xmsv2/api/usermgmt/createUser.cmd HTTP/1.0
  Host: www.example.com
 
 I don't think HTTP/1.0 supports the Host header. Can you try with HTTP/ 
 1.1
 
 
 
  Authorization: Digest username=dev, realm=myapp,
  nonce=e0cc32f1f78566187e90a49547ec07f8, uri=/admin/createUser.cmd,
  qop=auth, nc=2, cnonce=0a4f113b,
  response=aecf8d679c507f1d194db5463b0c1695,
  opaque=217361470610c797d3e04ab317280cc5
  Content-Type: text/plain
  username=aaafirstName=alastName=aapassword=aemailAddress=aaa
 
  After each line is \r\n and the last line has \r\n\r\n
 
 
 When you say the last line has \r\n\r\n, do you mean after the Content- 
 Type header? If not, that's where it should go.
 
 You don't have a Content-Length header. I think this is required in  
 requests from the client.
 
 Cheers
 Dave





[flexcoders] Unable to send HTTP parameters via Socket Digest Auhtorization

2008-04-03 Thread e_baggg
I am using flash.net.Socket to write HTTP requests and receive HTTP
responses. I'm using Tomcat Digest Authorization and everything works
fine for logging in and retrieving data. However, any request that
requires parameters does not work. I am using Ethereal to sniff a
valid requests and trying to get mine to match, however it just does
not work. Perhaps because I am sending plain text whereas a normal
HTTP request encodes the paramsanyone see anything wrong with this?:

POST /xmsv2/api/usermgmt/createUser.cmd HTTP/1.0
Host: www.example.com
Authorization: Digest username=dev, realm=myapp,
nonce=e0cc32f1f78566187e90a49547ec07f8, uri=/admin/createUser.cmd,
qop=auth, nc=2, cnonce=0a4f113b,
response=aecf8d679c507f1d194db5463b0c1695,
opaque=217361470610c797d3e04ab317280cc5
Content-Type: text/plain
username=aaafirstName=alastName=aapassword=aemailAddress=aaa

After each line is \r\n and the last line has \r\n\r\n

This request above actually hangs and the server never receives it. If
I move the Authorization: Digest ... header BELOW the last line of
parameters, then the request goes through, but the server never
receives any of the data. 

In a normal HTTP POST, the parameters are in Line-based text data as
application/x-www-form-urlencoded with the values set as I have them
above. But I don't know how to send it to what the server expects.

Any help is greatly appreciated.



[flexcoders] Problem authenticating Flex to Tomcat with HTTPService

2008-03-05 Thread e_baggg
I'm trying to authenticate against a Java-based application server
(Tomcat) from my Flex app.  I'm unable to set the HTTP Authorization
header to pass to the server to authenticate.  I'm also not able to
read the cookie header that the server sends back after successful
authentication.  Authenticating to the server with an HTML login page
prior to getting to the Flex app is not an option.  How have you
solved authentication from Flex?



[flexcoders] Re: Problem authenticating Flex to Tomcat with HTTPService

2008-03-05 Thread e_baggg
Danny-
  Thanks. I just went ahead with the Socket implementation fix that
Ted Patrick blogged about way back.

http://www.abdulqabiz.com/blog/archives/flash_and_actionscript/http_authentica.php

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

 I believe the only solution to authenticate without a login page is to
 configure TomCat to use Basic Auth and you will get  the standard
 browser user/pass popup whenever accessing the secure realm.
 --- In flexcoders@yahoogroups.com, e_baggg e_baggg@ wrote:
 
  I'm trying to authenticate against a Java-based application server
  (Tomcat) from my Flex app.  I'm unable to set the HTTP Authorization
  header to pass to the server to authenticate.  I'm also not able to
  read the cookie header that the server sends back after successful
  authentication.  Authenticating to the server with an HTML login page
  prior to getting to the Flex app is not an option.  How have you
  solved authentication from Flex?
 





[flexcoders] FileReference woes....

2008-02-22 Thread e_baggg
I am rather experienced with the FileReference class but have come
across a major problem. Basically, the file uploading just stopped
working. It works for me in IE (though I still receive the Error 203
File I/O Error which on the server is a 403 'not authenticated). It
does not work at all in Firefox for me (same error). So it is clear
Tomcat is not receiving the jsessionID header (which I validated with
a packet sniffer). IE is receiving it which is why that works though
I'm confused as to why I get the error if the upload took.

I am using Tomcat to handle my uploads. Basically, we use a JSP for
the  user to login (which adds the jsessionID header) and then
redirect the user to Flex app (.html and .swf) upon valid login. From
there, any upload should (and did) pass that header. But that stopped
working and now the errors. 

Using a packet sniffer, I see the jsessionID is not getting included
in the FF POST request. I have seen blogs to tack it on the parameter
request but that will not work for me (it has to be a header). This
had worked in the past so I am not sure what went wrong. I was on the
prerelease version of FB3 (pointing to 2.0.1 hotfix 3)...so i thought
it might be my Flash player. I reinstalled the Flash Players for IE
and FF from the main Adobe site and no luck. I tried building the swf
from FlexBuilder 2...no dice. Really at a loss here. Any thoughts from
anyone?

Cheers,
Kevin



[flexcoders] Re: FileReference woes....

2008-02-22 Thread e_baggg
Jon, thanks for your help! We ended up just removing authentication
for the upload directory so the upload would work. It's an internal
app so that will work for now. The jessionid trick (append to
UrlReqest.url) does work, but only if I catch the IOError. That error
still gets thrown for me. Not sure if I want to catch that as a
solution so I'm going to test more but I am out of options. The bug
mentioned below is 'https' which I am not on. 

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

 
 On Feb 22, 2008, at 12:56 PM, e_baggg wrote:
 
  Using a packet sniffer, I see the jsessionID is not getting included
  in the FF POST request. I have seen blogs to tack it on the parameter
  request but that will not work for me (it has to be a header). This
  had worked in the past so I am not sure what went wrong. I was on the
  prerelease version of FB3 (pointing to 2.0.1 hotfix 3)...so i thought
  it might be my Flash player. I reinstalled the Flash Players for IE
  and FF from the main Adobe site and no luck. I tried building the swf
  from FlexBuilder 2...no dice. Really at a loss here. Any thoughts from
  anyone?
 
 
 Man... what I'd be really interested in knowing is how in the world  
 it worked in the first place. AFAIK, file uploads with session  
 required have always been broken in FF - I don't know of any instance  
 where it worked without passing the session details back to the server.
 
 Was there a change in your upload code in JSP to require  
 authentication? I found the error when our server was setup for  
 authentication but the code accepting the file upload ignored the  
 session details.
 
 Open Bug (there may be others)
 
 http://bugs.adobe.com/jira/browse/SDK-13196
 
 good luck with it..
 
 - j





[flexcoders] Re: Cannot multiple select rows after deleting row from a List

2007-09-28 Thread e_baggg
Great, thanks. I have submitted the bug to Adobe.

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

 That's a bug.  A simpler reproduction case is this:
  
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
 mx:Script
 ![CDATA[
  private function workaround():void
  {
   var i:int = list.selectedIndex;
   list.selectedIndex = -1;
   list.selectedIndex = i;
  }
 ]]
 /mx:Script
 mx:List id=list dataProvider=['a', 'b', 'c', 'd', 'e', 'f', 'g',
 'h', 'i'] allowMultipleSelection=true 
 /mx:List
 mx:Button label=delete row 'c'
 click=list.dataProvider.removeItemAt(2) /
 mx:Text text=Select 'd', hit button, try to shift select 'e'.  Should
 select both 'd' and 'e' /
 mx:Button label=workaround click=workaround() /
 /mx:Application
 
 and the workaround is to set selectedIndex to -1.  Please use the
 simpler test case when filing the bug.  Thanks.
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of e_baggg
 Sent: Thursday, September 27, 2007 4:34 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Cannot multiple select rows after deleting row
 from a List
 
 
 
 I was able to recreate this issue in a very simple example included
 below. If I select a row, delete it (which auto selects the next
 row)...if I then Shift-click another row...the highlighted row is not
 included in the selected group. Any future shift-clicks from this
 point work as expected. has anyone encountered this? I included a
 sample Flex 2 mxml app with steps. Thanks in advance for your help:
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml
 http://www.adobe.com/2006/mxml 
 layout=vertical
 mx:Script
 ![CDATA[
 import mx.collections.ArrayCollection;
 
 [Bindable]
 private var dataAll : ArrayCollection = new
 ArrayCollection([aa,bb,cc,dd,ee,ff,gg,hh,ii,]);
 
 private function deleteRow() : void
 {
 var selectedIndices : Array = dg.selectedIndices;
 var highestIndex : int = getEmailWithHighestIndex(selectedIndices);
 trace(highestIndex= + highestIndex);
 trace(pre delete= + selectedIndices);
 highestIndex++;
 dg.selectedIndex = highestIndex;
 trace(after set= + dg.selectedIndex);
 for each(var k:int in selectedIndices)
 {
 dataAll.removeItemAt(k);
 }
 dg.selectedIndex = dg.selectedIndex;
 trace(post delete (indices)= + dg.selectedIndices);
 trace(post delete (index)= + dg.selectedIndex);
 }
 private function mouseDownHandler() : void
 {
 trace('mouseDOWN (indices)=' + dg.selectedIndices);
 trace('mouseDOWN (index)=' + dg.selectedIndex);
 trace('--');
 }
 private function getEmailWithHighestIndex(selectedIndices : Array) : int
 {
 var highestEmailIndex : int = 0;
 for(var g:int=0 ; g  selectedIndices.length; g++)
 {
 var currEmailIndex : int = int(selectedIndices[g]);
 if(currEmailIndex  highestEmailIndex)
 {
 highestEmailIndex = currEmailIndex;
 } 
 }
 return highestEmailIndex;
 } 
 ]]
 /mx:Script
 mx:HBox width=100% height=75%
 mx:TextArea width=100% height=100% htmlText=1.) Select 'cc'
 lt;brgt;2.) Hold down 'Shift' and select 'dd' (notice how both rows
 are selected). 
 lt;brgt;3.) Select 'cc' so it is the only row that is selected is
 'cc'.lt;brgt;4.)Click delete ('dd' is now selected)lt;brgt;5.) Now
 Shift-click 'ee'. This should select both rows but it does not. Why???
 /
 mx:VBox width=100%
 mx:List id=dg dataProvider={dataAll} width=200 height=179
 allowMultipleSelection=true mouseDown={mouseDownHandler()}/
 mx:Button label=delete click={deleteRow()}/
 /mx:VBox
 /mx:HBox
 /mx:Application





[flexcoders] Cannot multiple select rows after deleting row from a List

2007-09-27 Thread e_baggg
I was able to recreate this issue in a very simple example included
below. If I select a row, delete it (which auto selects the next
row)...if I then Shift-click another row...the highlighted row is not
included in the selected group. Any future shift-clicks from this
point work as expected. has anyone encountered this? I included a
sample Flex 2 mxml app with steps. Thanks in advance for your help:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=vertical
mx:Script
![CDATA[
import mx.collections.ArrayCollection;

[Bindable]
private var dataAll : ArrayCollection = new
ArrayCollection([aa,bb,cc,dd,ee,ff,gg,hh,ii,]);

private function deleteRow() : void
{
var selectedIndices : Array = dg.selectedIndices;
var highestIndex : int = getEmailWithHighestIndex(selectedIndices);
trace(highestIndex= + highestIndex);
trace(pre delete= + selectedIndices);
highestIndex++;
dg.selectedIndex = highestIndex;
trace(after set= + dg.selectedIndex);
for each(var k:int in selectedIndices)
{
dataAll.removeItemAt(k);
}
dg.selectedIndex = dg.selectedIndex;
trace(post delete (indices)= + dg.selectedIndices);
trace(post delete (index)= + dg.selectedIndex);
}
private function mouseDownHandler() : void
{
trace('mouseDOWN (indices)=' + dg.selectedIndices);
trace('mouseDOWN (index)=' + dg.selectedIndex);
trace('--');
}
private function getEmailWithHighestIndex(selectedIndices : Array) : int
{
var highestEmailIndex : int = 0;
for(var g:int=0 ; g  selectedIndices.length; g++)
{
var currEmailIndex : int = int(selectedIndices[g]);
if(currEmailIndex  highestEmailIndex)
{
highestEmailIndex = currEmailIndex;
}   
}
return highestEmailIndex;
} 
]]
/mx:Script
mx:HBox width=100% height=75%
mx:TextArea width=100% height=100% htmlText=1.) Select 'cc'
lt;brgt;2.) Hold down 'Shift' and select 'dd' (notice how both rows
are selected). 
lt;brgt;3.) Select 'cc' so it is the only row that is 
selected is
'cc'.lt;brgt;4.)Click delete ('dd' is now selected)lt;brgt;5.) Now
Shift-click 'ee'. This should select both rows but it does not. Why??? /
mx:VBox width=100%
mx:List id=dg dataProvider={dataAll} width=200 
height=179
allowMultipleSelection=true mouseDown={mouseDownHandler()}/
mx:Button label=delete click={deleteRow()}/
/mx:VBox
/mx:HBox
/mx:Application




[flexcoders] AS3 method exist returning the # of bytes a String is?

2007-06-08 Thread e_baggg
I am implementing a spell checker and am hitting some issues because
for non-Ascii characters such as ò...this is actually two bytes
where a normal character is 1 byte...which throws off the start and
end index of the text in the textArea.

Do any Flash/AS3 methods exist that return the number of bytes a given
String is? Or do I need to create my own loop counting each character
and if the charCode is = 128...then it is 2 bytes?

Thanks in advance.



[flexcoders] DataGrid HeaderRenderer Recreates every click

2007-05-31 Thread e_baggg
I have a server-side sort on my DataGrid which means I had to
implement my own headerRenderer to handle the click event, sort, and
server calls. 

I am trying to create the asc/desc arrow now but I realized that any
click event on the DataGrid instantiates a new Object of the
headerRenderer (all of them actually). In other words, my
headerRenderer mxml implementation, the creationComplete event gets
called any time ANYTHING is clicked in the grid, including a row.

This is a problem for many reasons, but the most significant one being
that I cannot store the state if the column is ascending/descending
based on the user's click. I could store this externally in the model
but that is very bad b/c then I'd also have to store which column was
clicked and then the other columns have to check if it is itself and
remove the arrow if they have one. Does anyone know why the
headerRenderer is re-creating an instance of itself every time or
faced this issue?

Thanks in advance.



[flexcoders] Re: DataGrid HeaderRenderer Recreates every click

2007-05-31 Thread e_baggg
Alex-
  Thanks. The issue is when a user clicks a column header, all the
column headers are re-created and now there is no way to know what
just happened since any state of that click event is lost. So I guess
I am forced to save it outside the headerRenderer. 

I suppose I can store the column index of what was clicked, then each
column when it redraws itself can get that int (if it's not -1), look
that value up in the 'columns' array and see if itself is it. If so,
then display the appropriate up/down arrow. 

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

 People do some really tricky things in customized DGs like having
 headers grow and shrink or other rows grow and shrink based on rollover
 states and selection and what not.  Right now the DG aggressively
 redraws to make sure we don't make assumptions about what can change.
 
  
 
 In theory, your custom header renderers should derive their state from
 some description of the sort.  That's a good model/view design and the
 cost should be insignificant.  Maybe the way you're checking is
 non-optimal.
 
  
 
 -Alex
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of e_baggg
 Sent: Thursday, May 31, 2007 10:18 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] DataGrid HeaderRenderer Recreates every click
 
  
 
 I have a server-side sort on my DataGrid which means I had to
 implement my own headerRenderer to handle the click event, sort, and
 server calls. 
 
 I am trying to create the asc/desc arrow now but I realized that any
 click event on the DataGrid instantiates a new Object of the
 headerRenderer (all of them actually). In other words, my
 headerRenderer mxml implementation, the creationComplete event gets
 called any time ANYTHING is clicked in the grid, including a row.
 
 This is a problem for many reasons, but the most significant one being
 that I cannot store the state if the column is ascending/descending
 based on the user's click. I could store this externally in the model
 but that is very bad b/c then I'd also have to store which column was
 clicked and then the other columns have to check if it is itself and
 remove the arrow if they have one. Does anyone know why the
 headerRenderer is re-creating an instance of itself every time or
 faced this issue?
 
 Thanks in advance.





[flexcoders] Cairngorm ServiceLocator error - duplicate instantiation

2007-04-19 Thread e_baggg
I am using Cairngorm (Flex 2.0.1)...and if I put the cursor inside the
text area and (holding down the Ctrl key) hit Enter really fast, I
get this error below where the main application is trying to call the
ServiceLocator constructor again. Any idea why? I can replicate it w/
a simple app.

## code ###
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute xmlns:business=com.communify.business.*
business:Services id=communifyServices /
mx:TextArea width=400 height=400/
/mx:Application

Note: I commented out my code in my service locator Implementation so
I know it is nothing on my side.

Error: Only one ServiceLocator instance should be instantiated
at
org.nevis.cairngorm.business::ServiceLocator$iinit()[C:\kevin\pronto\communify-flex\org\nevis\cairngorm\business\ServiceLocator.as:111]
at
com.communify.business::Services$iinit()[C:\kevin\pronto\communify-flex\com\communify\business\Services.mxml:0]
at
mx.core::Container/createComponentFromDescriptor()[C:\dev\flex_201_ja\sdk\frameworks\mx\core\Container.as:3619]
at
mx.core::Container/createComponentsFromDescriptors()[C:\dev\flex_201_ja\sdk\frameworks\mx\core\Container.as:3533]
at
mx.core::Container/mx.core:Container::createChildren()[C:\dev\flex_201_ja\sdk\frameworks\mx\core\Container.as:2618]
at
mx.core::UIComponent/initialize()[C:\dev\flex_201_ja\sdk\frameworks\mx\core\UIComponent.as:4938]
at
mx.core::Container/initialize()[C:\dev\flex_201_ja\sdk\frameworks\mx\core\Container.as:2555]
at
mx.core::Application/initialize()[C:\dev\flex_201_ja\sdk\frameworks\mx\core\Application.as:829]
at pronto/initialize()[C:\kevin\pronto\communify-flex\pronto.mxml:0]
at
mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_ja\sdk\frameworks\mx\managers\SystemManager.as:1553]
at
mx.managers::SystemManager/mx.managers:SystemManager::initializeTopLevelWindow()[C:\dev\flex_201_ja\sdk\frameworks\mx\managers\SystemManager.as:2330]
at
mx.managers::SystemManager/mx.managers:SystemManager::docFrameHandler()[C:\dev\flex_201_ja\sdk\frameworks\mx\managers\SystemManager.as:2214]
 



[flexcoders] Re: Compile CSS to SWF problem

2007-04-10 Thread e_baggg
The images are accessible to the compiler. I have another css in the
same directory that has these exact same styles declared and it
compiles fine. The only difference being the style sheet that does not
compile has 'Compile CSS to SWF' selected.

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

 The images you embed need to be accessible by the compiler. Is the
images
 folder in the same directory as the CSS? Have you tried changing the
path to
 the image?
 
 
 Tim
 
 On 06 Apr 2007 09:51:37 -0700, e_baggg [EMAIL PROTECTED] wrote:
 
I have a .css file which compiles to a swf and I can load in via
  runtime without problem (using StyleManager.loadStyleDeclarations()).
 
  However, I receive compiler errors once I have Embed code in my css
  like below. I presume it is because the swf that the css gets compiled
  to does not have access to these images. Am I missing an easy work
  around so that my external style swf can have skinning?
 
  Thanks.
 
  .myButton{
  upSkin:Embed(/images/buttonup.png, scaleGridTop='3',
  scaleGridBottom='20', scaleGridLeft='3', scaleGridRight='60');
  overSkin: Embed(/images/buttonover.png, scaleGridTop='3',
  scaleGridBottom='20', scaleGridLeft='3', scaleGridRight='60');
  downSkin: Embed(/images/buttondown.png, scaleGridTop='3',
  scaleGridBottom='20', scaleGridLeft='3', scaleGridRight='60');
 
 
   
 
 
 
 
 -- 
 Tim
 timwalling.com





[flexcoders] Compile CSS to SWF problem

2007-04-06 Thread e_baggg
I have a .css file which compiles to a swf and I can load in via
runtime without problem (using StyleManager.loadStyleDeclarations()). 

However, I receive compiler errors once I have Embed code in my css
like below. I presume it is because the swf that the css gets compiled
to does not have access to these images. Am I missing an easy work
around so that my external style swf can have skinning?

Thanks.


.myButton{
upSkin:Embed(/images/buttonup.png, scaleGridTop='3',
scaleGridBottom='20', scaleGridLeft='3', scaleGridRight='60');
overSkin: Embed(/images/buttonover.png, scaleGridTop='3',
scaleGridBottom='20', scaleGridLeft='3', scaleGridRight='60');
downSkin: Embed(/images/buttondown.png, scaleGridTop='3',
scaleGridBottom='20', scaleGridLeft='3', scaleGridRight='60');




[flexcoders] Re: setFocus - help needed

2007-02-27 Thread e_baggg
Change the line of code in your goTo() method to be:

focusManager.setFocus(one);

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

 Three text input controls. Tab enabled, tab index 1,2,3. On the 
 focus out of text control three I run a function to set focus back 
 to text control 1. Text control 1 gets the focus(blue outline) but 
 the cursor is not displayed until I click on the box. What do I have 
 to do to have the cursor appear in the text control.
 
 Thanks, Dave
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
 layout=absolute
 mx:Script
   ![CDATA[
   import mx.core.*;
   
   private function goto():void{
   one.setFocus()
   }
   ]]
   /mx:Script
   mx:TextInput x=137 y=77 id=one tabIndex=1 
 tabEnabled=true/
   mx:TextInput x=137 y=147 id=two tabIndex=2 
 tabEnabled=true/
   mx:TextInput x=137 y=237 id=three tabIndex=3  
 focusOut=goto()  tabEnabled=true/
   
 /mx:Application





[flexcoders] Re: Need help seaching and comparing in an ArrayCollection

2007-02-27 Thread e_baggg
That is exactly what you need to do. Create a for loop and get a
handle on each object in the loop. 

Then, set up a method that returns a Boolean if it needs to be
flagged. This method will check the dates. if true, then inside your
For loop, flag the data object.

Note: You can do the conditionals inside the for loop, it's just
better for readability to extract that logic out to another method
within the same class.

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

 I'm at a bit of a loss right now how to do something.   I'm building 
 an app that shows current and future projects with deploy dates, 
 names, etc.  One thing they want this app to do is to flag projects 
 that are to be deployed within a week of any other project.  In other 
 words, if one is going out the door on March 1 and anther is going out 
 on March 3 or February 27, each gets a flag.
 
 I'm really at a loss on how to best go about searching my 
 ArrayCollection for these items.  Can someone please help with how I 
 can get started?  I guess I somehow need to pull out one item at a 
 time from the AC and compare it with all the rest in the AC?
 
 Thanks





[flexcoders] How to create navigateToURL http links with non ascii characters??

2007-02-14 Thread e_baggg
Hello.
  I have the situation where some of the URLs that I need to link to
have non-Ascii characters in them. 

So, for example...

if I have a directory structure like this (hopefully the A comes
through with the accent above it): non-ascii Á/test/

the URL that gets generated is:
http://mydomain.com/non-ascii%20%C1%2Ftest

I receive a 404 error on this URL. It looks like the URLs though are
encoded in Windows-1251, not UTF-8. How do I fix this to be UTF-8? 

Thanks.



[flexcoders] Re: How to create navigateToURL http links with non ascii characters??

2007-02-14 Thread e_baggg
Yep, thanks Doug. That did the trick.

- Kevin

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

 
 And take a look at the top-level encodeURI() function too.
 
 http://livedocs.macromedia.com/flex/2/langref/package.html#encodeURI
 http://livedocs.macromedia.com/flex/2/langref/package.html#encodeURI
 ()
 
 
 --- In flexcoders@yahoogroups.com, camlinaeizerous camlinae@
 wrote:
 
  http://www.w3schools.com/tags/ref_urlencode.asp
 
  If you follow that link it is a list of HTML encoding.
  replace Á with %c1 and hopefully it should work for you.
 
  --- In flexcoders@yahoogroups.com, e_baggg e_baggg@ wrote:
  
   Hello.
   I have the situation where some of the URLs that I need to link to
   have non-Ascii characters in them.
  
   So, for example...
  
   if I have a directory structure like this (hopefully the A comes
   through with the accent above it): non-ascii Á/test/
  
   the URL that gets generated is:
   http://mydomain.com/non-ascii%20%C1%2Ftest
  
   I receive a 404 error on this URL. It looks like the URLs though are
   encoded in Windows-1251, not UTF-8. How do I fix this to be UTF-8?
  
   Thanks.
  
 





[flexcoders] RegExp

2006-12-21 Thread e_baggg
I am trying to create a regular expression that essentially parses out
all the html of a text string. (i.e. - Remove all text between lt;
and gt;). I am not the seasoned regex pro, but my attempts have
failed based on research within the livedocs:

var pattern : RegExp = /\lt;[a-zA-Z0-9]*gt;/gi

Does anyone see what is wrong?

var stringToEdit : String = lt;!DOCTYPE html PUBLIC '-//W3C//DTD
HTML 4.01 Transitional//EN'gt;lt;htmlgt;lt;headgt;text I should
seelt;/headgt;lt;/htmlgt;;

var pattern : RegExp = /\lt;[a-zA-Z0-9]*gt;/gi
var newStr : String = stringToEdit.replace(pattern, );
trace(newStr);

//Desired Output:
text I should see

//Actual output :-( 
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01
Transitional//ENhtmlheadtext I should see/head/html



[flexcoders] Re: RegExp

2006-12-21 Thread e_baggg
Parker, 
  Thanks, but that did not do the trick. It still returned the full
HTML. yes, you are right though...that first back slash was not
needed. Hmm, back to the drawing board I guess. It stinks, I found a
regular expression that does what I need but it does not compile in
AS3. I'll keep hammering the books and tutorials to try and figure
this out. newbies to regex and deadlines don't mix well.

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

 a couple quick things.. I'm by no means an expert at regex... but...
 
 the first backslash is unnecessary isn't it?  is not a meta
 character, so the \ after the first / isn't needed. also, don't you
 want to remove ALL characters between the  and  ? so I'd change the
 inner [a-zA-Z0-9]* to   .*?  (the question mark makes it a lazy
 quantifier instead of an agressive quantifier)
 
 And one last thing, is you may need the multi-line flag also (if the
 XML has line breaks... so I'd give this a shot... haven't tried it
 myself though
 
  /lt;.*?gt;/gim
 
 good luck
 PW
 
 --- In flexcoders@yahoogroups.com, e_baggg e_baggg@ wrote:
 
  I am trying to create a regular expression that essentially parses out
  all the html of a text string. (i.e. - Remove all text between lt;
  and gt;). I am not the seasoned regex pro, but my attempts have
  failed based on research within the livedocs:
  
  var pattern : RegExp = /\lt;[a-zA-Z0-9]*gt;/gi
  
  Does anyone see what is wrong?
  
  var stringToEdit : String = lt;!DOCTYPE html PUBLIC '-//W3C//DTD
  HTML 4.01 Transitional//EN'gt;lt;htmlgt;lt;headgt;text I should
  seelt;/headgt;lt;/htmlgt;;
  
  var pattern : RegExp = /\lt;[a-zA-Z0-9]*gt;/gi
  var newStr : String = stringToEdit.replace(pattern, );
  trace(newStr);
  
  //Desired Output:
  text I should see
  
  //Actual output :-( 
  !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01
  Transitional//ENhtmlheadtext I should see/head/html
 





[flexcoders] Re: RegExp

2006-12-21 Thread e_baggg
Paul,
  Thank you! That worked great. 

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

 How about this:
 
 var pattern:RegExp = new RegExp((.*?)|(/.*?), g);
 text = text.replace(pattern, );
 
 Paul
 
 ---
 Paul Whitelock
 Denver, Colorado
 
 
   -Original Message-
   From: flexcoders@yahoogroups.com 
   [mailto:[EMAIL PROTECTED] On Behalf Of e_baggg
   Sent: Thursday, December 21, 2006 2:57 PM
   To: flexcoders@yahoogroups.com
   Subject: [flexcoders] Re: RegExp
   
   Parker,
   Thanks, but that did not do the trick. It still returned the 
   full HTML. yes, you are right though...that first back slash 
   was not needed. Hmm, back to the drawing board I guess. It 
   stinks, I found a regular expression that does what I need 
   but it does not compile in AS3. I'll keep hammering the books 
   and tutorials to try and figure this out. newbies to regex 
   and deadlines don't mix well.
   
   --- In flexcoders@yahoogroups.com 
   mailto:flexcoders%40yahoogroups.com , parkerwhirlow
   thunder.stumpges+yahoo@ wrote:
   
a couple quick things.. I'm by no means an expert at regex...
but...

the first backslash is unnecessary isn't it?  is not a meta 
character, so the \ after the first / isn't needed. also,
don't you 
want to remove ALL characters between the  and  ? so I'd 
   change the 
inner [a-zA-Z0-9]* to .*? (the question mark makes it a lazy 
quantifier instead of an agressive quantifier)

And one last thing, is you may need the multi-line flag 
   also (if the 
XML has line breaks... so I'd give this a shot... haven't
tried it 
myself though

/lt;.*?gt;/gim

good luck
PW

--- In flexcoders@yahoogroups.com 
   mailto:flexcoders%40yahoogroups.com , e_baggg e_baggg@ wrote:

 I am trying to create a regular expression that 
   essentially parses 
 out all the html of a text string. (i.e. - Remove all 
   text between lt;
 and gt;). I am not the seasoned regex pro, but my 
   attempts have 
 failed based on research within the livedocs:
 
 var pattern : RegExp = /\lt;[a-zA-Z0-9]*gt;/gi
 
 Does anyone see what is wrong?
 
 var stringToEdit : String = lt;!DOCTYPE html PUBLIC 
   '-//W3C//DTD 
 HTML 4.01 
   Transitional//EN'gt;lt;htmlgt;lt;headgt;text I should 
 seelt;/headgt;lt;/htmlgt;;
 
 var pattern : RegExp = /\lt;[a-zA-Z0-9]*gt;/gi var 
   newStr : String 
 = stringToEdit.replace(pattern, ); trace(newStr);
 
 //Desired Output:
 text I should see
 
 //Actual output :-(
 !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 
 Transitional//ENhtmlheadtext I should see/head/html

   
   
   
   

  
 





[flexcoders] Re: How do I parse this XML?

2006-12-11 Thread e_baggg
The namespaces is why you are having trouble using e4x. Please see the
livedocs on namespaces for more help.

http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=1912.html

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

 Hi,
 
 I have a xml file which looks like this:
 
 ?xml version=1.0 encoding=UTF-8?
 office:document-content
xmlns:office=http://openoffice.org/2000/office;
 xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:xlink=
 http://www.w3.org/1999/xlink; office:version=1.0
 office:class=presentation
 
 style:style style:name=dp1
style:family=drawing-pagestyle:properties
 presentation:transition-style=fade-from-left
 presentation:transition-speed=fast
presentation:background-visible=true
 presentation:background-objects-visible=true/
 /style:style
 
 style:style style:name=dp2 style:family=drawing-page
 style:properties/
 /style:style
 /office:document-content
 
 The XML loads normally and the whole XML can be traced. I tried to use
 e4xto parse this xml, but no luck.
 
 The problem arises when trying to access the nodes, child nodes or
 attributes. The regular e4x way to access the nodes and attributes
did not
 work with this xml.
 
 Can anyone help me with parsing this XML?
 
 Thanks in advance,
 
 P





[flexcoders] Re: socket question

2006-12-07 Thread e_baggg
David, 
  We are able to have some synchronous behavior to sockets. What we do
is assign a unique ID with each request the client sends, and when the
server is done, it passes that id back.

So to further illustrate your example:
Client sends this:
getServerData id=1 data=yourData/
The server would then send back:
yourData id=1blahblahblah/yourData
done id=1

Then, on your onData() method, you can check all done/ XML, get the
ID, and then use that ID to look up a callback function that you
registered with that ID.

Basically, all of our requests go through a Command which implements
the IResponder class, we register that class to a Singleton which
holds all the callback with the id...and when we see done/, we
check to see if a callback is there and if so it calls it's method.
This ensures that all the data is back we want. Even if your
getServerData request returns multiple socket messages:

getServerData id=1 data=yourData/
yourData id=1blahblahblah/yourData
yourData id=1blahblahblah2/yourData
yourData id=1blahblahblah33/yourData
done id=1

Hope this helps.
-Kevin

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

 Hi all -
 
 I am creating a server interface, one of whose implementations
 involves talking over a socket connection. I have a need for
 synchronous behavior - I call an API method, say
 getServerData(aParam), and I get back the result that I want. Not sure
 what a good way to do this with sockets would be since the receive
 data event makes them asynchronous in nature - can anyone point me
 to a good tutorial, or provide a hint?
 
 Consider a made up example :
 
 class SocketServer implements Server 
   private var _lastResult:String;
 
 // client calls this method and expects a result passed back
 public function getServerData(aParam:String): String {
   _socket.addEventListener(ProgressEvent.SOCKET_DATA, onData);  
   connectToSocket(someHost, somePort);
 
   _lastResult null;
   issueCommandViaSocket(aParam);
 
   // sit around until we get data
   while (_lastResult == null) ; 
   return _lastResult;
 }
 
 private function onData(e:ProgressEvent):void {
   _lastResult= socket.readUTFBytes(socket.bytesAvailable);
 }
 
 this works conceptually, except that the wait around part hangs the
 app.. if I remove that, then I can get the return value and log it in
 the onData method.. so, am I even on the right track here? Is there
 some way to have actionscript pause or wait until the desired event
 gets fired?
 
 thanks for any thoughts -
 
 david





[flexcoders] Re: Error #2038: File I/O Error.

2006-11-08 Thread e_baggg
If the error is on the server than you should ask this question to
forums that support whatever language your server code is written in
(Java, .NET, etc..).

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

 you seem to be right, thanks...
 but the problem on the server still continues...
 my application work in my localhost but not in my server (i get the
error 2038 File I/O)
 how can i fix it?
 thanks...
 
 yigit boyar
 middle east technical university / sophomore
 
 - Original Message 
 From: e_baggg [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com
 Sent: Tuesday, November 7, 2006 5:49:12 AM
 Subject: [flexcoders] Re: Error #2038: File I/O Error.
 
 
 
 
 
 
 
 
 
   
 
 
 
 It actually doesn't have anything to do with the
filename, it's
 
 actually the file size. FileReference can't upload files that are 0KB.
 
 Add some characters to 'new document.txt' and the upload will be fine.
 
 
 
 I added a try/catch to notify the user if this happens:
 
 
 
 try {
 
   file.upload( uploadUrl) ;
 
   } catch (error : Error)
 
   {
 
   Alert.show( ' + file.name + ' cannot be uploaded 
 because
 
 it is an empty + 
 
file. Files cannot be 0 KB in size., 
 Upload Error...);
 
   return;
 
   }
 
 
 
 --- In [EMAIL PROTECTED] ups.com, Yiðit Boyar yigitboyar@ ... wrote:
 
 
 
  when i'm working in my locahost and try to upload a file which has
 
 blank character(s) (e.g. new document.txt) ,
 
   i get the error: text=Error #2038: File I/O Error.
 
  also when i uploaded my flex application to my remote server; now i
 
 can not even upload files with names consisting no blank characters.
 
  
 
  what can be the reason for this?
 
  
 
  Note: my swf,php all run in the same server
 
 
 
 
 
 
 
 
   
 
 
 
 
 
 
 
 !--
 
 #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;}
 --






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

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

* Your email settings:
Individual Email | Traditional

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

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

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

* Your use

[flexcoders] Re: Error #2038: File I/O Error.

2006-11-06 Thread e_baggg
It actually doesn't have anything to do with the filename, it's
actually the file size. FileReference can't upload files that are 0KB.
Add some characters to 'new document.txt' and the upload will be fine.

I added a try/catch to notify the user if this happens:

try {
file.upload(uploadUrl);
} catch (error : Error)
{
Alert.show(' + file.name + ' cannot be uploaded 
because
it is an empty + 
 file. Files cannot be 0 KB in size., 
Upload Error...);
return;
}

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

 when i'm working in my locahost and try to upload a file which has
blank character(s) (e.g. new document.txt) ,
  i get the error: text=Error #2038: File I/O Error.
 also when i uploaded my flex application to my remote server; now i
can not even upload files with names consisting no blank characters.
 
 what can be the reason for this?
 
 Note: my swf,php all run in the same server






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

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

* Your email settings:
Individual Email | Traditional

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

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

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

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



[flexcoders] Re: Convert time string to minutes

2006-10-31 Thread e_baggg
It shouldn't be too difficlut to write this code yourself. I haven't
tested this but 'hours' is 0 based so that's why I added 1.

var date : Date = new Date();
var totalMinutes : Number = (date.hours+1) * 60;
totalMinutes += date.minutes;

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

 Does anyone have some AS3 code to convert a time string to minutes:
 
 '01:30' = 90 minutes into the day.






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

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

* Your email settings:
Individual Email | Traditional

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

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

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

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



[flexcoders] Re: Flex Tab order

2006-10-29 Thread e_baggg
In the last text box, add a function for the focusOut handler that
manually sets the focus back to the first box (or button).

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

 Hi,
 
 In flex i have vbox with 4 TextInputs. when we tab through them after 
 the last input the tab goes to InternetExplorer's  status bar, header 
 and then the address bar before coming back to the first textinput. Is 
 there a way that we can stop the tab from leaving the flex applicaiton 
 and going to IE. I tried tabIndex but this doesn't hold it on to the 
 component. Any help will be highly appreciated and if there is code 
 then more better.
 
 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

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

* Your email settings:
Individual Email | Traditional

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

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

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

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



[flexcoders] Socket woes - something simple I'm sure

2006-10-19 Thread e_baggg
Hello. I have a XMLSocket class that I am able to send/receive data to
no problem. 

I switched my implementation to use the flash.net.Socket class and now
I cannot receive data back.

I updated my sendMessage() to the following...this request should
trigger a response from the server but it doesn't...most likely b/c my
request is incorrect. What does the XMLSocket do for me that I am not
doing here? I thought maybe adding the \n to the String would work
but it did not. The sendMessage() method is called in my
connectHandler so I know the socket is connected. There are no errors
in my IO and security handlers.

import flash.net.Socket;
public class MySocket extends Socket 
{
...
public function sendMessage(xml : XML) : void 
{
try
{
var ss : String = xml.toXMLString();
 //ss = credentials user=me password=pass/
this.writeUTF(ss);
this.flush();
trace(Send--: + ss);
} catch (error : IOError){
trace(Error:  + error.message);
   }
}





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

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

* Your email settings:
Individual Email | Traditional

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

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

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

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



[flexcoders] Re: Socket woes - something simple I'm sure

2006-10-19 Thread e_baggg
## Try adding a null byte before flushing the flash.net.Socket.

Ted-
  Thanks for your response but I am still unable to get it working.
Partly b/c I can't find any help on how to add a null byte. I would
think this (or '\0') would accomplish it but it does not. Sorry,
couldn't find any help online.

//this is a connected flash.net.Socket
this.writeUTFBytes(xml.toXMLString() + null);
this.flush();


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

 There is no default delimiter in flash.net.Socket. XMLSocket uses a null
 byte delimiter to detect message completions to fire the 'data' and
 'xml' events. If you are using an XMLSocket Server supporting null
 bytes. Try adding a null byte before flushing the flash.net.Socket.
 
  
 
 That should work seamlessly.
 
  
 
 Also on the receiving side, you will need to read bytesAvailable into a
 buffer to detect the null byte to denote a message received.
 
  
 
 Ted :-)
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of e_baggg
 Sent: Thursday, October 19, 2006 8:44 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Socket woes - something simple I'm sure
 
  
 
 Hello. I have a XMLSocket class that I am able to send/receive data to
 no problem. 
 
 I switched my implementation to use the flash.net.Socket class and now
 I cannot receive data back.
 
 I updated my sendMessage() to the following...this request should
 trigger a response from the server but it doesn't...most likely b/c my
 request is incorrect. What does the XMLSocket do for me that I am not
 doing here? I thought maybe adding the \n to the String would work
 but it did not. The sendMessage() method is called in my
 connectHandler so I know the socket is connected. There are no errors
 in my IO and security handlers.
 
 import flash.net.Socket;
 public class MySocket extends Socket 
 {
 ...
 public function sendMessage(xml : XML) : void 
 {
 try
 {
 var ss : String = xml.toXMLString();
 //ss = credentials user=me password=pass/
 this.writeUTF(ss);
 this.flush();
 trace(Send--: + ss);
 } catch (error : IOError){
 trace(Error:  + error.message);
 }
 }






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

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

* Your email settings:
Individual Email | Traditional

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

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

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

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



[flexcoders] Re: Socket woes - something simple I'm sure

2006-10-19 Thread e_baggg
So adding a null byte like so didn't work either. Wish XMLSocket was
open source so I wouldn't have to ping the forum! :P

//doesn't work. 'this' is a flash.net.Socket
var bytes:ByteArray = new ByteArray();
bytes.writeUTFBytes(xml.toXMLString() + '\0' );
this.writeBytes(bytes);
this.flush();

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

 There is no default delimiter in flash.net.Socket. XMLSocket uses a null
 byte delimiter to detect message completions to fire the 'data' and
 'xml' events. If you are using an XMLSocket Server supporting null
 bytes. Try adding a null byte before flushing the flash.net.Socket.
 
  
 
 That should work seamlessly.
 
  
 
 Also on the receiving side, you will need to read bytesAvailable into a
 buffer to detect the null byte to denote a message received.
 
  
 
 Ted :-)
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of e_baggg
 Sent: Thursday, October 19, 2006 8:44 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Socket woes - something simple I'm sure
 
  
 
 Hello. I have a XMLSocket class that I am able to send/receive data to
 no problem. 
 
 I switched my implementation to use the flash.net.Socket class and now
 I cannot receive data back.
 
 I updated my sendMessage() to the following...this request should
 trigger a response from the server but it doesn't...most likely b/c my
 request is incorrect. What does the XMLSocket do for me that I am not
 doing here? I thought maybe adding the \n to the String would work
 but it did not. The sendMessage() method is called in my
 connectHandler so I know the socket is connected. There are no errors
 in my IO and security handlers.
 
 import flash.net.Socket;
 public class MySocket extends Socket 
 {
 ...
 public function sendMessage(xml : XML) : void 
 {
 try
 {
 var ss : String = xml.toXMLString();
 //ss = credentials user=me password=pass/
 this.writeUTF(ss);
 this.flush();
 trace(Send--: + ss);
 } catch (error : IOError){
 trace(Error:  + error.message);
 }
 }






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

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

* Your email settings:
Individual Email | Traditional

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

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

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

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



[flexcoders] Re: Socket woes - something simple I'm sure

2006-10-19 Thread e_baggg
  Thanks for your reply, I don't know why this is turning into such an
issue for me,  but according to the XMLSocket API, all it does is send
a XML message followed by a zero byte...so why doesn't this work for
me? It looks as if it is the same thing.  


//this is a connected flash.net.Socket
var bytes:ByteArray = new ByteArray();
bytes.writeUTFBytes(xml.toXMLString() );
this.writeBytes(bytes);
this.writeByte( 0x30 );
this.flush();

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

 To write a null byte to a Socket, just use the writeByte method:
 
 this.writeByte( 0x00 );
 this.flush();
 
 -d
 
 e_baggg wrote:
 
  ## Try adding a null byte before flushing the flash.net.Socket.
 
  Ted-
  Thanks for your response but I am still unable to get it working.
  Partly b/c I can't find any help on how to add a null byte. I would
  think this (or '\0') would accomplish it but it does not. Sorry,
  couldn't find any help online.
 
  //this is a connected flash.net.Socket
  this.writeUTFBytes(xml.toXMLString() + null);
  this.flush();
 






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

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

* Your email settings:
Individual Email | Traditional

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

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

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

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



[flexcoders] Unable to pull up API in FlexBuilder with Ctrl + Spacebar

2006-10-11 Thread e_baggg
This has to be the most frustrating thing I've come across in a long
time (more frustrating then when my computer got hosed trying to debug
Flex 1.5 apps accidentally with the Flash 8.5 beta plugin).

Anyway, I am no longer able to pull up the dynamic menu of class names
and variable attributes when typing code in FlexBuilder and hitting
Ctrl + Space bar.

Right now, I have to manually copy and paste full class names to
import a class, and ctrl + click around to get variable names. This
has dramatically slowed my performance. Not to mention having to go to
the docs to see the available functions. :-( 

If I type var s : S .. then the menu pops up and as I keep typing
String it narrows down to String...but for existing lines of code
like this:
var readyTimer:Timer = new Timer(100, 0);
readyTimer.addEventListener(TimerEvent.TIMER, timerHandler);

If I put the cursor after the readyTimer. and hit Ctrl +
Spacebar..I get nothing.

I've tried all of the following to no luck:
   
1.) Running Project -- Clean
2.) Restarting my PC
3.) (From the beta days), Removing the Flex Project, then deleting the
'bin', 'html-template', and '.settings' directories and the .project,
.flexProperties, and .actionScriptProperties files...then recreating
the Flex project.
4.) Uninstalled my Flex Builder, downloaded the latest FB2 from
adobe.com, and created the new project pointing to my files.

Any ideas? I do not have any Problems (errors) in my Project. This
problem exists for my AS files and MXML files. I know for a fact my
Ctrl  spacebar buttons work too b/c I can Ctrl Save. *sigh*






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

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

* Your email settings:
Individual Email | Traditional

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

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

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

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



[flexcoders] Re: How to load an Image dynamically as for icon (of type Class)??

2006-09-01 Thread e_baggg
Dirk-
  That worked fabulously. Thanks.

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

 Another option would be to write a custom ItemRenderer for the List and
 dynamically load the icon from within the ItemRenderer. E.g. the
 ItemRenderer  could be a simple HBox subclass:
  
 !-- IconRenderer.mxml --
 mx:HBox
   mx:Image source={data.icon}/
   mx:Label text={data.label}/
 /mx:HBox
  
 If you set the itemRenderer property of the List to IconRenderer then it
 should display the items and load the image (the above example assumes
 that every item in the List's dataProvider has an icon property and a
 label property)
  
 Dirk.
  
 
 
 
 
   From: flexcoders@yahoogroups.com
 [mailto:[EMAIL PROTECTED] On Behalf Of Frias, Roberto
   Sent: Friday, September 01, 2006 10:13 AM
   To: flexcoders@yahoogroups.com
   Subject: AW: [flexcoders] How to load an Image dynamically as
 for icon (of type Class)??
   
   
 
   Yes indeed, the only way to use this iconField is embeding an
 Image. There is a workaround using a normal image component and loading
 dynamically, but you will have to build your own popup window in some
 cases ( try setting the image component with a negative y ), otherwise
 its not to hard thought, you just have to start from a Canvas and design
 the layout of your popup.
 

 
   Best Regards
 

 
   Roberto Frias
 

 
   
 
 
 
   Von: flexcoders@yahoogroups.com
 [mailto:[EMAIL PROTECTED] Im Auftrag von e_baggg
   Gesendet: Donnerstag, 31. August 2006 22:53
   An: flexcoders@yahoogroups.com
   Betreff: [flexcoders] How to load an Image dynamically as for
 icon (of type Class)??
 

 
   I have an application that has a popup window that users will
 popup
   very rarely. This popup window has a mx:List with a dozen
 different
   icons for each row in the List.
   
   For this reason I do not want to embed the images, but rather,
 load
   them at runtime when the wndow is popped.
   
   I am having trouble displaying the icons because the iconField
 and
   funtions require an Object of type Class. Using the Loader()
 class,
   a DisplayObject is returned:
   
   var pictLdr:Loader = new Loader();
   var pictURL:String = banana.jpg
   var pictURLReq:URLRequest = new URLRequest(pictURL);
   pictLdr.load(pictURLReq);
   this.addChild(pictLdr);
   
   How do I load a image dynamically and assign it to an icon? 
   
   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

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

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

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




[flexcoders] Re: Cairngorm / Hibernate Best Practices

2006-08-31 Thread e_baggg
Flex can't access your Spring Beans directly. Similar to SpringWeb how
you set up Controllers which map to a URL pattern, your Facade
(JavaPojo) which have the methods which your AS delegate will call.

There is a good example with source code here:
http://weblogs.macromedia.com/auhlmann/archives/2006/07/cairngorm_2_for_1.cfm

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

 Thanks for the info, I've actually been using Spring predominantly for
 my standard J2EE web apps, but haven't used it with Flex. I know it's
 possible, and have been thinking of doing a Flex/Spring/Hibernate
 setup, but haven't yet. Is it difficult to use Spring with Flex, and
 where would I go to begin?
 
 Also, 4 years of a going to a Liberal Arts school forces archaic words
 like 'hitherto' into your vocabulary, haha.
 
 --- In flexcoders@yahoogroups.com, e baggg e_baggg@ wrote:
 
  Brennan,
I haven't seen the word Hithero used since I was forced to read
 Shakespeare back in high school. Way to bring it back! Anyway, Adobe
 has provided Hibernate support via the Hibernate Assembler:
  
 

http://livedocs.macromedia.com/flex/2/fds2javadoc/flex/data/assemblers/HibernateAssembler.html
  
  I actually created an app that is front-to-end using the
 RemoteObject. I have my Java pojos which are mapped to my hibernate
 mapping files and I also have the AS classes that correlate to them
 too, using the:
  [Managed]
   [RemoteClass(alias=com.project.MyClass)]
  
  I pass all my objects to a pojo facade class which in turns invokes
 my Sprign beans. Within the facade, all the hibernate and trasactions
 are taken care. My objects are pretty light, so to avoid lazy-loading
 issues on the client side, i set lazy=false at the class level for all
 my hibernate mappings. This works well for me and I have not faced any
 performance issues. 
  
  
  -
  Stay in the know. Pulse on the new Yahoo.com.  Check it out.
 








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

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

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

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





[flexcoders] How to load an Image dynamically as for icon (of type Class)??

2006-08-31 Thread e_baggg
I have an application that has a popup window that users will popup
very rarely. This popup window has a mx:List with a dozen different
icons for each row in the List.

For this reason I do not want to embed the images, but rather, load
them at runtime when the wndow is popped.

I am having trouble displaying the icons because the iconField and
funtions require an Object of type Class. Using the Loader() class,
a DisplayObject is returned:

var pictLdr:Loader = new Loader();
var pictURL:String = banana.jpg
var pictURLReq:URLRequest = new URLRequest(pictURL);
pictLdr.load(pictURLReq);
this.addChild(pictLdr);

How do I load a image dynamically and assign it to an icon? 

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

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

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

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





[flexcoders] Re: CairngormEvent Antipattern

2006-08-30 Thread e_baggg
Andi-
  Tom was referring to having a hierarchy of FrontControllers.

He happens to have a class called CoreController which all of his
Flex apps would use. Then, each Flex app will have it's own
FrontController that extends CoreController...this way each developer
has their own controller. This assumes of course there's 1 developer
working on a project. The CoreController would house the common
Commands such as Login, Logout, and similar things.

If you're in the situation where you have 1 large Flex app that has 1
large controller that all the developers are fighting for...I would
suggest that users update the Contoller and check in their empty
Command classes right away. Then begin development. That way if it
takes them 2 days to implement the logic for an event, they won't have
a lot of contacts. Another option is to make one developer the 'owner'
of the front controller and have other developers e-mail them the line
of code for the command.

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

 Tom Chiverton wrote:
 
 On Wednesday 30 August 2006 13:14, Andrea Varga wrote:
   
 
 (For example, on a large project, when there are many developers
 working, all of them has to edit the FrontController to add an event.)
 
 
 
 This isn't a problem with a decent RCS.
 
 As it is, we've got a CoreController and then indivdual projects
extend that 
 to make their application specific events.
 
   
 
 Could you please tell me where can I found more about this? I cannot 
 find anything. Thanks.
 
 Andi







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

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

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

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





[flexcoders] Re: specifying a percentage width in script?

2006-08-28 Thread e_baggg
You have to calculate that yourself. Add an event listener for
resize and which calls a function that calculates and resets the width.

private function resizeHandler () : void {
 //if parent is an HBox that is set to 100%
spacer.width = parent.width;
}

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

 How can I specify spacer.width = 100%??? It throws an error
because 100%
 is not an int.
 
 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

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

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

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




[flexcoders] Re: CairngormEvent Antipattern

2006-08-25 Thread e_baggg
Andi-
  Nothing changes with the FrontController and Commands. You would
still have 3 separate commands (1 each for add, update, delete).

Remember, the generic CairngormEvent classes calls:
super(commandName) 

so the dispatchEvent() for each call would like this:

 dispatchEvent(new WidgetEvent(WidgetFrontController.ADD_WIDGET,
widgetVO));
 dispatchEvent(new WidgetEvent(WidgetFrontController.UPDATE_WIDGET,
widgetVO));
 dispatchEvent(new WidgetEvent(WidgetFrontController.DELETE_WIDGET,
widgetVO));

and each Command will apropriately be called just like it was. The key
 is we're no longer hard-coding the WidgetFrontController.ADD_WIDGET
into each CairngormEvent sublcass.

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

 e_baggg wrote:
 
 Hello group-
   I hadn't seen a previous post regarding this explicity so I wrote a
 small blog about it. It helps reduce the #of classes that get created
 when using Cairngorm (a big issue with me since the client is VERY
 picky with their swf file sizes). This blog shows the code for usuing
 a reusable CairngormEvent versus creating separate classes for each
 dispatchable event.
 

http://ebaggg.blogspot.com/2006/08/cairngormevent-anti-pattern-we-all.html
 
 Thoughts?
 
 
 The ideea is good, but how do you handle them further?
 Will you have 3 different commands associated with the same event? And 
 each Command will start with an if statement, to see if that's the
event 
 he supposed to answer to? Doesn't seem right.
 
 Andi








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

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

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

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




[flexcoders] CairngormEvent Antipattern

2006-08-23 Thread e_baggg
Hello group-
  I hadn't seen a previous post regarding this explicity so I wrote a
small blog about it. It helps reduce the #of classes that get created
when using Cairngorm (a big issue with me since the client is VERY
picky with their swf file sizes). This blog shows the code for usuing
a reusable CairngormEvent versus creating separate classes for each
dispatchable event.

http://ebaggg.blogspot.com/2006/08/cairngormevent-anti-pattern-we-all.html

Thoughts?





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

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

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

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




[flexcoders] Re: Dynamic datagrid columns

2006-08-16 Thread e_baggg
Tom-
  The Datagrid component now has an attribute called columns. When you 
dynamically create columns, add them to an array and set 
datagrid.columns value to this array. 

To add or remove columns, just get a reference to that 'columns' 
attribute and call normal array methods.

I actually have a datagrid that has its columns change based on what 
value is selected in a tree. I set up my different columns as Arrays 
in the ModelLocator, and when a user clicks a tree, it switches the 
datagrid's columns value with the correct Array (creating them if they 
are not there already).

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

 The dynamic column methods for the datagrid seem to have disappeared 
 between 1.5  2.
 
 I've looked around for examples or descriptions of Flex 2 
replacements 
 for methods such as dataGrid.addColumn() and 
dataGric.removeAllColumns() 
 that were available in 1.5, but haven't come up with much. Anyone 
have 
 any pointers?
 
 - Tom








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

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

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

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




[flexcoders] Re: TileList item margins

2006-08-16 Thread e_baggg
Sergey,
  if you set the verticalGap=0 on the component's container, then 
that will do the trick. You will need to setup a separate mxml 
component and drop the mx:image within that container...then 
change your TileList to contain the attribute 
itemRenderer=com.myComponent

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

 Hi All!
 
 How to eliminate those 2 pixels at the top and the same at the 
bottom
 margins around each TileList item? I use this:
 
 mx:TileList columnCount=2 rowCount=3 borderStyle=none
 dataProvider={_dataProvider}
   mx:itemRenderer
   mx:Component
   mx:Image width=50 height=50 
source={data.image} /
   /mx:Component
   /mx:itemRenderer
 /mx:TileList
 
 And there are 2 pixels of free space above and below each image.
 
 Sergey.








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

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

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

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