[flexcoders] Glue - Beautiful Gooey MVC Framework for Flex

2009-04-14 Thread Sean Clark Hess
 link - http://code.seanhess.net/?p=195

[...] So, this isn’t an official release, but more of a call for feedback. I
just finished a first-draft of a new MVC framework for Flex that I’m calling
Glue.  I started out with several specific goals in mind. I’ve been
trying to think of how the perfect MVC framework ought to behave, and have
designed Glue accordingly. I’m directly responding to the wonderful Mate
framework and a few others I’ve used. [...]

Hi all, looking for feedback on this approach to MVC in flex. Thanks for
your help!
~sean


[flexcoders] Bifff - Behavior Injection Framework for Flex - v0.3 Released

2009-03-24 Thread Sean Clark Hess
I've just released the next version of Bifff, which provides a way to use
full css selectors to associate behaviors with flex components. For more
information, please read the following.
Release Notes - http://code.seanhess.net/?p=179

Documentation - http://wiki.github.com/seanhess/bifff

For this release, I've written a lot of documentation, have added support
for custom behaviors, and have added a component that can parse a
stylesheet, allowing you to have a much more robust css engine for Flex. For
example, you could use it to set the label of a button, all while using
Bifff's robust css selectors.

Don't forget to join the google group if you're interested in learning more
or trying it out.

~sean


Re: [flexcoders] jQuery for Flex - a Behavior Injection Framework

2009-03-04 Thread Sean Clark Hess
I just released Bifff 0.2a - Bifff stands for Behavior Injection Framework
for Flex.
http://code.seanhess.net/?p=171

See the link above for new features. I also created a google group at

http://groups.google.com/group/bifff

Enjoy!

On Tue, Mar 3, 2009 at 12:13 PM, Sean Clark Hess seanh...@gmail.com wrote:

 Just a quick note - the behavior tags in bifff (going to be the name) have
 nothing to do with Mate.  So... no docs yet, sorry.
 Check out the example apps if you want more info for now.

 ~sean


 On Tue, Mar 3, 2009 at 10:09 AM, Michael Wills mich...@mawills.comwrote:

 Heh yeah just a play on the names you mentioned in your blog, i.e.
 decaf, cola, bif(ff?), etc. I am only just getting started with
 Mate but have appreciated the injection concept. My first hands on dose
 of that was with PureMVC's ViewMediators. Mate and your framework is
 simpler for folks to understand though. The setup and usage is quite
 clear just looking at the code. I actually hadn't even seen or used the
 Contents or Swap tags before. I still have to go look those up in the
 related docs. :-)

 Michael

 Sean Clark Hess wrote:
 
  @Sam, Thanks for adding that link. Guess I shouldn't try to do fancy
  html emails for the first time when making important announcements :)
 
 
  @Michael - Thanks! I wouldn't say it would be a decaf *version* of
  anything :) It's supposed to play friendly with application frameworks.
 
 
 
  On Mon, Mar 2, 2009 at 3:00 PM, Michael Wills mich...@mawills.com
  mailto:mich...@mawills.com wrote:
 
  I like the possibility of using it with Mate/Cairngorm.
 
  So then it would be the decaf versions of mate/cairngorm? :-)
 
  Seriously though this is quite cool.
 
 
  Sam Lai wrote:
  I think you forgot the link (or my phone's playing tricks with me).
 
  http://code.seanhess.net/?p=156 http://code.seanhess.net/?p=156
 
  Nice work btw. I'm going to have to think about how it fits in with
  Flex and my current workflow, but I'll give it a shot in my new
  project :)
 
  On 3/3/09, Sean Clark Hess seanh...@gmail.com mailto:
 seanh...@gmail.com wrote:
 
  jQuery for Flex - a Behavior Injection
  Frameworkhttp://code.seanhess.net/?p=156 
 http://code.seanhess.net/?p=156
 
  [...] I’ve just finished my pre-alpha version of a Behavior
 Injection
  framework for Flex. It adds support for functionality similar to
 jQuery for
  flex, along with support for a more complete CSS syntax. The
 approach is
  slightly different than jQuery, and hopes to play along with
 Flex’s
  strengths as well. [...]
 
 
  
 
  --
  Flexcoders Mailing List
  FAQ:
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Alternative FAQ location:
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 
  Search Archives:
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo 
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
 Links
 
 
 
 
 
 
 


 

 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Alternative FAQ location:
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 Search Archives:
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
 Links







Re: [flexcoders] jQuery for Flex - a Behavior Injection Framework

2009-03-03 Thread Sean Clark Hess
Just a quick note - the behavior tags in bifff (going to be the name) have
nothing to do with Mate.  So... no docs yet, sorry.
Check out the example apps if you want more info for now.

~sean

On Tue, Mar 3, 2009 at 10:09 AM, Michael Wills mich...@mawills.com wrote:

 Heh yeah just a play on the names you mentioned in your blog, i.e.
 decaf, cola, bif(ff?), etc. I am only just getting started with
 Mate but have appreciated the injection concept. My first hands on dose
 of that was with PureMVC's ViewMediators. Mate and your framework is
 simpler for folks to understand though. The setup and usage is quite
 clear just looking at the code. I actually hadn't even seen or used the
 Contents or Swap tags before. I still have to go look those up in the
 related docs. :-)

 Michael

 Sean Clark Hess wrote:
 
  @Sam, Thanks for adding that link. Guess I shouldn't try to do fancy
  html emails for the first time when making important announcements :)
 
 
  @Michael - Thanks! I wouldn't say it would be a decaf *version* of
  anything :) It's supposed to play friendly with application frameworks.
 
 
 
  On Mon, Mar 2, 2009 at 3:00 PM, Michael Wills mich...@mawills.com
  mailto:mich...@mawills.com wrote:
 
  I like the possibility of using it with Mate/Cairngorm.
 
  So then it would be the decaf versions of mate/cairngorm? :-)
 
  Seriously though this is quite cool.
 
 
  Sam Lai wrote:
  I think you forgot the link (or my phone's playing tricks with me).
 
  http://code.seanhess.net/?p=156 http://code.seanhess.net/?p=156
 
  Nice work btw. I'm going to have to think about how it fits in with
  Flex and my current workflow, but I'll give it a shot in my new
  project :)
 
  On 3/3/09, Sean Clark Hess seanh...@gmail.com mailto:
 seanh...@gmail.com wrote:
 
  jQuery for Flex - a Behavior Injection
  Frameworkhttp://code.seanhess.net/?p=156 
 http://code.seanhess.net/?p=156
 
  [...] I’ve just finished my pre-alpha version of a Behavior
 Injection
  framework for Flex. It adds support for functionality similar to
 jQuery for
  flex, along with support for a more complete CSS syntax. The
 approach is
  slightly different than jQuery, and hopes to play along with Flex’s
  strengths as well. [...]
 
 
  
 
  --
  Flexcoders Mailing List
  FAQ:
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Alternative FAQ location:
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 
  Search Archives:
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo 
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
 Links
 
 
 
 
 
 
 


 

 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Alternative FAQ location:
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 Search Archives:
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
 Links






[flexcoders] jQuery for Flex - a Behavior Injection Framework

2009-03-02 Thread Sean Clark Hess
jQuery for Flex - a Behavior Injection
Frameworkhttp://code.seanhess.net/?p=156

[...] I’ve just finished my pre-alpha version of a Behavior Injection
framework for Flex. It adds support for functionality similar to jQuery for
flex, along with support for a more complete CSS syntax. The approach is
slightly different than jQuery, and hopes to play along with Flex’s
strengths as well. [...]


Re: [flexcoders] jQuery for Flex - a Behavior Injection Framework

2009-03-02 Thread Sean Clark Hess
@Sam, Thanks for adding that link. Guess I shouldn't try to do fancy html
emails for the first time when making important announcements :)
@Michael - Thanks! I wouldn't say it would be a decaf *version* of anything
:) It's supposed to play friendly with application frameworks.



On Mon, Mar 2, 2009 at 3:00 PM, Michael Wills mich...@mawills.com wrote:

I like the possibility of using it with Mate/Cairngorm.

 So then it would be the decaf versions of mate/cairngorm? :-)

 Seriously though this is quite cool.

 Sam Lai wrote:

 I think you forgot the link (or my phone's playing tricks with me).
 http://code.seanhess.net/?p=156

 Nice work btw. I'm going to have to think about how it fits in with
 Flex and my current workflow, but I'll give it a shot in my new
 project :)

 On 3/3/09, Sean Clark Hess seanh...@gmail.com seanh...@gmail.com wrote:


  jQuery for Flex - a Behavior Injection
 Frameworkhttp://code.seanhess.net/?p=156 http://code.seanhess.net/?p=156

 [...] I’ve just finished my pre-alpha version of a Behavior Injection
 framework for Flex. It adds support for functionality similar to jQuery for
 flex, along with support for a more complete CSS syntax. The approach is
 slightly different than jQuery, and hopes to play along with Flex’s
 strengths as well. [...]



  

 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Alternative FAQ location: 
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 Search Archives: 
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links



 



[flexcoders] Some machines cannot sent data to Binary Socket

2008-10-10 Thread Sean Clark Hess
Hi everybody,
I'm very stumped, and any help would be appreciated. I have written a socket
server in PHP that communicates with flex via the Socket class (and JSON
encoded messages).

I've written a test client, and the server is currently active

https://sean.rapidintake.com/SocketTest.html

Some people cannot send binary data, even though they seem to be getting the
policy file just fine. I've tested this with tons of friends, in addition to
the client.  All of my friends were able to get through all the steps just
fine, except for one, but noone at the client company can.

So, for me and those like me, I get through all the steps. For all of the
employees at the client site, and for one friend, it hangs on the ping
server step.

What is going on? I've checked server logs and the ping message never
comes through, and the client is never notified that they have connected,
even though there is no security error.  Any ideas?

This is what your log should look like if it works:::

Thanks!
~sean

Open [√]
[JsonSocket] = 7 status
{users:[],yourid:44,locks:{},changes:{},versions:[]}
[JsonSocket] = 7 authenticated {hash:695861518}
[JsonSocket] = all open {username:SocketTestUser,id:239}
Open [ ]

Pass [√]
[JsonSocket] = all pass {username:SocketTestUser,project:239}
b17f0b7b73af6d58a698e8f6f2cee879
Pass [ ]

Ping Server [√]
[JsonSocket] = 7 pong {id:44}
[JsonSocket] = all ping {}
Ping Server [ ]

Connect to Server [√]
[JsonSocket] Connected
[JsonSocket] connecting...
[JsonSocket] About to connect sockets.rapidintake.com:80
Connect to Server [ ]

Create Socket Connection [√]
Create Socket Connection [ ]


Re: [flexcoders] How to display a total row on a DataGrid

2008-07-23 Thread Sean Clark Hess
I ran with your example, and threw it into a reusable component.  I hope
this helps somebody else! Alex, my traceback is awaiting moderation on your
blog post.
http://code.steelpotato.com/2008/07/footer-datagrid-display-total-or.html

On Mon, Jul 21, 2008 at 1:51 PM, Sean Clark Hess [EMAIL PROTECTED] wrote:

 Your examples were some of the first I looked at.  I don't remember now why
 I thought I couldn't use them.  I'll try the Flex 3 DataGrid Footers post
 again and see if I run into the same problems I'm experiencing (mismatched
 column widths, 100% width not working).
 Thanks for the reminder

 On Mon, Jul 21, 2008 at 1:23 PM, Alex Harui [EMAIL PROTECTED] wrote:

There's a footer example on my blog


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Sean Clark Hess
 *Sent:* Monday, July 21, 2008 11:33 AM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] How to display a total row on a DataGrid



 Hello All,



 Well, I'm stuck.  I've approached this about 3 different ways and have run
 into (different) dead ends on all of them. I've tried using multiple
 datagrids, which I got working fabulously, but setting the datagrid to width
 100% does really wacky things with the column sizes.  I've also tried to use
 the built-in Summary classes with the AdvancedDataGrid, but they seem only
 to work with Grouped data. I could hack a collection to do it, but that
 would screw up my pagination and wouldn't show unless I scrolled to the
 bottom.



 I just want a footer that displays the total of each column.  Is there any
 good way to do this?  The Summary and Grouping classes were disappointing.



 Thanks

 ~sean





  





[flexcoders] how to override a public var, or put it in an interface?

2008-07-22 Thread Sean Clark Hess
I want to make a class that works with both DataGridColumn and
AdvancedDataGridColumn.  Each of these has a dataField property.  I have
subclassed each, and they both implement a common interface.  In the
interface, I have
function set dataField(value:String):void
function get dataField():String

I get the error Interface method get dataField ... is implemented with an
incompatible signature

So, if I try to override it in the subclass, I get incompatible override

Is there a good way to do this?  I guess I could leave it out of the
interface and cast it as an object to work with dataField, but that's kind
of lame.


[flexcoders] Re: how to override a public var, or put it in an interface?

2008-07-22 Thread Sean Clark Hess
Oh, I forgot to mention. The reason why the interface doesn't work is
because it was implemented as a public var instead of an accessor.

On Tue, Jul 22, 2008 at 12:50 PM, Sean Clark Hess [EMAIL PROTECTED]
wrote:

 I want to make a class that works with both DataGridColumn and
 AdvancedDataGridColumn.  Each of these has a dataField property.  I have
 subclassed each, and they both implement a common interface.  In the
 interface, I have
 function set dataField(value:String):void
 function get dataField():String

 I get the error Interface method get dataField ... is implemented with an
 incompatible signature

 So, if I try to override it in the subclass, I get incompatible override

 Is there a good way to do this?  I guess I could leave it out of the
 interface and cast it as an object to work with dataField, but that's kind
 of lame.



Re: [flexcoders] Re: how to override a public var, or put it in an interface?

2008-07-22 Thread Sean Clark Hess
Thanks Alex.  I'm trying to use this interface as a common type.  Any way to
do that?  Right now I have to cast it as an object, or create a wrapper
accessor for dataField

On Tue, Jul 22, 2008 at 1:30 PM, Alex Harui [EMAIL PROTECTED] wrote:

You can't switch a var to a get/set pair.  You can override its default
 value though.


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Sean Clark Hess
 *Sent:* Tuesday, July 22, 2008 11:51 AM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Re: how to override a public var, or put it in an
 interface?



 Oh, I forgot to mention. The reason why the interface doesn't work is
 because it was implemented as a public var instead of an accessor.

 On Tue, Jul 22, 2008 at 12:50 PM, Sean Clark Hess [EMAIL PROTECTED]
 wrote:

 I want to make a class that works with both DataGridColumn and
 AdvancedDataGridColumn.  Each of these has a dataField property.  I have
 subclassed each, and they both implement a common interface.  In the
 interface, I have



 function set dataField(value:String):void

 function get dataField():String



 I get the error Interface method get dataField ... is implemented with an
 incompatible signature



 So, if I try to override it in the subclass, I get incompatible override



 Is there a good way to do this?  I guess I could leave it out of the
 interface and cast it as an object to work with dataField, but that's kind
 of lame.



  



[flexcoders] How to display a total row on a DataGrid

2008-07-21 Thread Sean Clark Hess
Hello All,
Well, I'm stuck.  I've approached this about 3 different ways and have run
into (different) dead ends on all of them. I've tried using multiple
datagrids, which I got working fabulously, but setting the datagrid to width
100% does really wacky things with the column sizes.  I've also tried to use
the built-in Summary classes with the AdvancedDataGrid, but they seem only
to work with Grouped data. I could hack a collection to do it, but that
would screw up my pagination and wouldn't show unless I scrolled to the
bottom.

I just want a footer that displays the total of each column.  Is there any
good way to do this?  The Summary and Grouping classes were disappointing.

Thanks
~sean


Re: [flexcoders] How to display a total row on a DataGrid

2008-07-21 Thread Sean Clark Hess
Your examples were some of the first I looked at.  I don't remember now why
I thought I couldn't use them.  I'll try the Flex 3 DataGrid Footers post
again and see if I run into the same problems I'm experiencing (mismatched
column widths, 100% width not working).
Thanks for the reminder

On Mon, Jul 21, 2008 at 1:23 PM, Alex Harui [EMAIL PROTECTED] wrote:

There's a footer example on my blog


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Sean Clark Hess
 *Sent:* Monday, July 21, 2008 11:33 AM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] How to display a total row on a DataGrid



 Hello All,



 Well, I'm stuck.  I've approached this about 3 different ways and have run
 into (different) dead ends on all of them. I've tried using multiple
 datagrids, which I got working fabulously, but setting the datagrid to width
 100% does really wacky things with the column sizes.  I've also tried to use
 the built-in Summary classes with the AdvancedDataGrid, but they seem only
 to work with Grouped data. I could hack a collection to do it, but that
 would screw up my pagination and wouldn't show unless I scrolled to the
 bottom.



 I just want a footer that displays the total of each column.  Is there any
 good way to do this?  The Summary and Grouping classes were disappointing.



 Thanks

 ~sean





  



[flexcoders] Where is the right place to add children from a setter?

2008-07-16 Thread Sean Clark Hess
Hi everybody,
I know how to add children to a component doing something like the
following, but I can't help but think there ought to be a better way to do
it.  Perhaps I should be overriding one of UIComponent's methods?  Anyway,
the issue (see link) is that container isn't defined when the setter is
called.  Where is the proper place to actually add the children?

http://pastie.textmate.org/234853


You would use it like this --


me:myComp

  me:newChildren

 mx:Button label='new button'/

  /me:newChildren

/me:myComp


Thanks!


Re: [flexcoders] Where is the right place to add children from a setter?

2008-07-16 Thread Sean Clark Hess
For future reference, here's how that would look.  Thanks Doug!

http://pastie.textmate.org/234868




On Wed, Jul 16, 2008 at 9:59 AM, Doug McCune [EMAIL PROTECTED] wrote:

   Set a dirty flag in your setter (like childrenDirty = true) and call
 invalidateProperties(), then override commitProperties() and check if
 your dirty flag is set, if so then add the children in there.

 Doug


 On Wed, Jul 16, 2008 at 8:52 AM, Sean Clark Hess [EMAIL 
 PROTECTED]seanhess%40gmail.com
 wrote:
  Hi everybody,
  I know how to add children to a component doing something like the
  following, but I can't help but think there ought to be a better way to
 do
  it. Perhaps I should be overriding one of UIComponent's methods? Anyway,
  the issue (see link) is that container isn't defined when the setter is
  called. Where is the proper place to actually add the children?
 
  http://pastie.textmate.org/234853
 
  You would use it like this --
 
  me:myComp
 
  me:newChildren
 
  mx:Button label='new button'/
 
  /me:newChildren
 
  /me:myComp
 
  Thanks!
 
 

  



[flexcoders] How to use scrollPosition if the scrollbars are off?

2008-07-15 Thread Sean Clark Hess
Hi, I'm trying to set horizontalScrollPosition, but I don't want to show any
scroll bars.  I'm trying to have the scrollbar of another component control
this one (by binding to horizontalScrollPosition on the other
component). However, if I set horizontalScrollPolicy='off' the position
variable doesn't do anything.
I've tried extending the component to hide the scroll bar, but I'm still
left with a white area underneath.

Any ideas?  What is the right way to do this?  Thanks!


[flexcoders] Skinning SuperTabNavigator - how to change the close button?

2008-07-04 Thread Sean Clark Hess
Hey all, I can't figure out how to change the close button in Doug McCune's
SuperTabNavigator.  Details and some code snippets here.

http://code.steelpotato.com/2008/07/skinning-supertabnavigator.html

Thanks for your help!


[flexcoders] Default size in custom UIComponents

2008-07-04 Thread Sean Clark Hess
I don't have a lot of experience making custom UI Components, but there is
one thing I've noticed several times that doesn't make any sense.

When you add new subcomponents by overriding createChildren, they don't seem
to show up at all unless you explicitly set the width and height.  For
example...

var button:Button = new Button();

button.width = 20; // if you don't set these, it doesn't show up
button.height = 20;

addChild(button);

It seems like a lot of the time you would want the button to be just as big
as it's going to be, without setting it's width and height.  I'm sure
there's a way to do this.  What am I missing?  Please note that I most
recently noticed this on a button that was skinned.

~sean


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

2008-07-03 Thread Sean Clark Hess
Yeah, sorry, I'm not sure

On Thu, Jul 3, 2008 at 8:50 AM, lytvynyuk [EMAIL PROTECTED] wrote:

   Well, I've picked file by browsing using FileReference's browse()
 method, and my file is simple *.png


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Sean
 Clark Hess [EMAIL PROTECTED] wrote:
 
  The other thing is that the file may be corrupted, or doesn't exist...
 
  On Wed, Jul 2, 2008 at 1:43 PM, lytvynyuk [EMAIL PROTECTED] wrote:
 
   I did. I all cases request can reach server, in my case no. Just an
   exception, no network activity I'm puzzled.
  
  
   --- In flexcoders@yahoogroups.com 
   flexcoders%40yahoogroups.comflexcoders%
 40yahoogroups.com,
 Sean
   Clark Hess seanhess@ wrote:
   
You have to do it serverside -- for example, if you're using PHP,
   you have
to change Apache's maximum upload size for that domain.
   
Do a search for error 2038 in these forums though, I thought I saw
   another
couple of threads about it.
   
~sean
   
  
  
  
 

  



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

2008-07-03 Thread Sean Clark Hess
Do you have different versions running in IE and firefox?

On Thu, Jul 3, 2008 at 8:56 AM, lytvynyuk [EMAIL PROTECTED] wrote:

   Update:
 I works under IE7 doesn't work with Rirefox 2.0.0.15!
 Doesn't work with Opera as well! I suspect this is not browser issue,
 this is FlashPlayer issue, because Firefox and Opera uses same Flash
 Player binaries!


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 lytvynyuk [EMAIL PROTECTED] wrote:
 
  I getting this error, but when I put breakpoint at my server side code
  nothing coming through!! When I created little HTML page with file
  upload filed to same servlet location - IT WORKS!
 
  I used Live HTTP headers to see activity on HTTP requests -
  nothing nothing going through, also I used Wireshark - same effect.
 
  So what is going on ? any Ideas?
 
  AS code is extremely simple:
 
  var request:URLRequest = new URLRequest();
  request.url = UPLOAD_URL;
  fr.upload(request);
  fileNameLabel.text = fr.name;
 

  



Re: [flexcoders] Problems with SWFLoader

2008-07-03 Thread Sean Clark Hess
Is the loaded swf written the same version of actionscript as the loader?

On Thu, Jul 3, 2008 at 8:21 AM, carloveparade [EMAIL PROTECTED]
wrote:

   I had been working with the SWFLoader to embed external swf
 aplications on my flex application. Now I need to start a second embed
 swf when the first one ( a movieclip) is on the end of the movie. In
 other words I need to star a new movie when the first is endes, but i
 cant put a next button so i need start the second one automatically.
 Could you help me?

  



Re: [flexcoders] Saving or Exporting application charts as images?

2008-07-03 Thread Sean Clark Hess
I've tried things like this before, and it never works.  I can't remember if
there's some way to do this natively with as3, or if I was doing it with a
swf2exe tool, but either way, it sucks.

Send the data serverside and regenerate it there.  Your serverside language
should have some packages to create images or pdfs or something.  It's
annoying to generate the report in two places, but it's the only way I know
how to do it.

On Thu, Jul 3, 2008 at 6:04 AM, cox.blair [EMAIL PROTECTED] wrote:

   Hi everyone,

 Our application will have charts and it will be required that the user
 be able to save these charts as an image suitable for use in MS Office
 products - ie. Word  PowerPoint. The user shouldn't have to perform
 any editing or cropping.

 Any ideas on how this could be accomplished - from within the application?

 Thanks,

  



Re: [flexcoders] Re: Problems with SWFLoader

2008-07-03 Thread Sean Clark Hess
SWFLoader has a content property.  As soon as it is fully loaded and content
is defined, try something like this.

var movie:MovieClip = mySwfLoader.content as MovieClip;
movie.addEventListener( ... uhhh

Actually, I've never worked with flash movieclips in as3 (I've only used
flex stuff).  Why doesn't movieclip have an end or stop event???

I guess you could always use enterFrame as the event handler, and check for
the last frame in good old as2 style

On Thu, Jul 3, 2008 at 9:18 AM, carloveparade [EMAIL PROTECTED]
wrote:

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

 
  Is the loaded swf written the same version of actionscript as the
 loader?
 
  On Thu, Jul 3, 2008 at 8:21 AM, carloveparade [EMAIL PROTECTED]
  wrote:
 
   I had been working with the SWFLoader to embed external swf
   aplications on my flex application. Now I need to start a second
 embed
   swf when the first one ( a movieclip) is on the end of the
 movie. In
   other words I need to star a new movie when the first is endes,
 but i
   cant put a next button so i need start the second one
 automatically.
   Could you help me?
  
  
  
 ys its actionscript 3

  



Re: [flexcoders] Re: Problems with SWFLoader

2008-07-03 Thread Sean Clark Hess
I'm not sure how to detect when it finished playing.  Anyone?

On Thu, Jul 3, 2008 at 11:35 AM, carloveparade [EMAIL PROTECTED]
wrote:

   --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Sean
 Clark Hess [EMAIL PROTECTED]
 wrote:
 OKOKOKOK, Im using flex and i need to put a swf publicity on my
 panel, im using swfloader and after publicity is on the end i need
 to go to another panel or canvas using a viewstack. but i need to go
 to the other canvas after the publicity ends and do ti
 automatically.
 im using a viewstack an i was thinking in goto another selected
 index when the publicity end but how i know on my code if the
 movieclip ended? what do you thing about not to use a viewstack
 and use a panel and when the publicity end load the next swf on the
 same panel? i dont know what to do , maybe some event when the swf
 ends. could you help me?
  SWFLoader has a content property. As soon as it is fully loaded
 and content
  is defined, try something like this.
 
  var movie:MovieClip = mySwfLoader.content as MovieClip;
  movie.addEventListener( ... uhhh
 
  Actually, I've never worked with flash movieclips in as3 (I've
 only used
  flex stuff). Why doesn't movieclip have an end or stop
 event???
 
  I guess you could always use enterFrame as the event handler, and
 check for
  the last frame in good old as2 style
 
  On Thu, Jul 3, 2008 at 9:18 AM, carloveparade [EMAIL PROTECTED]
  wrote:
 
   --- In flexcoders@yahoogroups.com 
   flexcoders%40yahoogroups.comflexcoders%
 40yahoogroups.com, Sean
   Clark Hess seanhess@
   wrote:
  
   
Is the loaded swf written the same version of actionscript as
 the
   loader?
   
On Thu, Jul 3, 2008 at 8:21 AM, carloveparade
 carlos.robinson@
wrote:
   
 I had been working with the SWFLoader to embed external swf
 aplications on my flex application. Now I need to start a
 second
   embed
 swf when the first one ( a movieclip) is on the end of the
   movie. In
 other words I need to star a new movie when the first is
 endes,
   but i
 cant put a next button so i need start the second one
   automatically.
 Could you help me?



   ys its actionscript 3
  
  
  
 

  



Re: [flexcoders] Re: Problems with SWFLoader

2008-07-03 Thread Sean Clark Hess
Oh, i know what to do.  On the last frame of your animation, put the
following in.

dispatchEvent(new Event('lastFrame'));

Then, you can listen for that event to know when to start the next one,
using the idea I wrote before

On Thu, Jul 3, 2008 at 11:47 AM, Sean Clark Hess [EMAIL PROTECTED] wrote:

 I'm not sure how to detect when it finished playing.  Anyone?


 On Thu, Jul 3, 2008 at 11:35 AM, carloveparade [EMAIL PROTECTED]
 wrote:

   --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Sean
 Clark Hess [EMAIL PROTECTED]
 wrote:
 OKOKOKOK, Im using flex and i need to put a swf publicity on my
 panel, im using swfloader and after publicity is on the end i need
 to go to another panel or canvas using a viewstack. but i need to go
 to the other canvas after the publicity ends and do ti
 automatically.
 im using a viewstack an i was thinking in goto another selected
 index when the publicity end but how i know on my code if the
 movieclip ended? what do you thing about not to use a viewstack
 and use a panel and when the publicity end load the next swf on the
 same panel? i dont know what to do , maybe some event when the swf
 ends. could you help me?
  SWFLoader has a content property. As soon as it is fully loaded
 and content
  is defined, try something like this.
 
  var movie:MovieClip = mySwfLoader.content as MovieClip;
  movie.addEventListener( ... uhhh
 
  Actually, I've never worked with flash movieclips in as3 (I've
 only used
  flex stuff). Why doesn't movieclip have an end or stop
 event???
 
  I guess you could always use enterFrame as the event handler, and
 check for
  the last frame in good old as2 style
 
  On Thu, Jul 3, 2008 at 9:18 AM, carloveparade [EMAIL PROTECTED]
  wrote:
 
   --- In flexcoders@yahoogroups.com 
   flexcoders%40yahoogroups.comflexcoders%
 40yahoogroups.com, Sean
   Clark Hess seanhess@
   wrote:
  
   
Is the loaded swf written the same version of actionscript as
 the
   loader?
   
On Thu, Jul 3, 2008 at 8:21 AM, carloveparade
 carlos.robinson@
wrote:
   
 I had been working with the SWFLoader to embed external swf
 aplications on my flex application. Now I need to start a
 second
   embed
 swf when the first one ( a movieclip) is on the end of the
   movie. In
 other words I need to star a new movie when the first is
 endes,
   but i
 cant put a next button so i need start the second one
   automatically.
 Could you help me?



   ys its actionscript 3
  
  
  
 

  





Re: [flexcoders] Re: Saving or Exporting application charts as images?

2008-07-03 Thread Sean Clark Hess
Very cool... Didn't look like doug was using air to me

On Thu, Jul 3, 2008 at 11:17 AM, cox.blair [EMAIL PROTECTED] wrote:

   Hmm, yup that sucks. I'll be using PHP5 and MySQL 4.1, any tips on
 where I could look for some tips on accomplishing this? New territory
 for me.

 Cheers,


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Sean
 Clark Hess [EMAIL PROTECTED] wrote:
 
  I've tried things like this before, and it never works. I can't
 remember if
  there's some way to do this natively with as3, or if I was doing it
 with a
  swf2exe tool, but either way, it sucks.
 
  Send the data serverside and regenerate it there. Your serverside
 language
  should have some packages to create images or pdfs or something. It's
  annoying to generate the report in two places, but it's the only way
 I know
  how to do it.

  



[flexcoders] Socket does not connect on FP9 r45

2008-07-02 Thread Sean Clark Hess
Hello coders!

This is my first question to the list, so go easy on me, alright? :)

I spent quite a while developing a good socket system that communicated with
PHP via JSON.  It uses the Socket class (since that's the only way you can
do it, as far as I'm aware).  It works perfectly now, with one small
caveat.

When testing it on machines with r45 of FP9 installed, it didn't connect.
 I'm not sure which version started working, but I think it works on r115
and r124.  As far as I can tell, the connect event just never fires.   The
policy file request goes through fine, but the socket server never hears
from the connection request.

Thanks!
~sean


Re: [flexcoders] Re: Socket does not connect on FP9 r45

2008-07-02 Thread Sean Clark Hess
Does WebORB use sockets?  I thought it was an http connection, but I could
be mistaken. If there's a better way, I'd be happy to switch, but I couldn't
find anything. The current system is VERY lightweight, and it's quite
unlikely that WebORB is faster, but it might be a lot more stable -- I
definitely want to look into it.

Our needs are
1) Messaging between clients (Push to client)
2) Speed (for lightweight messages)

Does WebORB do #1?

I looked at the example you posted -- Yes, it is very easy to send JSON to
PHP and get a JSON response -- we are doing this elsewhere.  But HTTPService
is, well, HTTP -- the server can't push data back to the client.

Thanks!
~sean

On Wed, Jul 2, 2008 at 7:42 AM, valdhor [EMAIL PROTECTED] wrote:

   I can't help you with your problem but do wonder why you felt the need
 to create your own socket system to implement JSON to PHP.

 AFAIK there are a number of solutions for this (eg.

 http://blog.paranoidferret.com/index.php/2007/08/24/flex-php-json-mysql-advanced-updating/
 ).

 Also, WebORB with AMF3 is a much simpler (And probably faster)
 solution for getting data to and from Flex/PHP.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Sean
 Clark Hess [EMAIL PROTECTED] wrote:
 
  Hello coders!
 
  This is my first question to the list, so go easy on me, alright? :)
 
  I spent quite a while developing a good socket system that
 communicated with
  PHP via JSON. It uses the Socket class (since that's the only way
 you can
  do it, as far as I'm aware). It works perfectly now, with one small
  caveat.
 
  When testing it on machines with r45 of FP9 installed, it didn't
 connect.
  I'm not sure which version started working, but I think it works on
 r115
  and r124. As far as I can tell, the connect event just never fires.
 The
  policy file request goes through fine, but the socket server never hears
  from the connection request.
 
  Thanks!
  ~sean
 

  



Re: [flexcoders] display text input values in datagrid

2008-07-02 Thread Sean Clark Hess
You want to change your val() function to something more like this.

 private function val():void
{
var values:Array = new Array();

// this is only one row
values.push({tt1:pp1.text, tt2:pp2.text, tt3:pp3.text});


dg.dataProvider=values;
}

The dataProvider for a datagrid should be something like an array (because
of all the rows).  Each row should be an object with fields (like tt1
tt2 and tt3)

On Tue, Jul 1, 2008 at 8:43 PM, Santhosh Garlapad 
[EMAIL PROTECTED] wrote:

   Hi guys,

 i m a beginner to flex development.

 i have few text input fieds and when i click add button all the text input
 values to be displayed in datagrid.

 if i add few more items into the datagrid the values the new values display
 first

 sample datagrid as follows;
 column1 col2col3
 text1text 2   text3
 textatextbtextc

 please find the sample code below''

 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute

 mx:Script
 ![CDATA[
 private function val():void

 {
 dg.dataProvider=pp1.text;
 }
 ]]
 /mx:Script

 mx:TextInput x=170 y=73 id=pp1/
 mx:TextInput x=170 y=73 id=pp2/
 mx:TextInput x=170 y=73 id=pp3/
 mx:DataGrid x=207 y=144 id=dg
 mx:columns
 mx:DataGridColumn headerText=Column 1 dataField=tt1/
 mx:DataGridColumn headerText=Column 2 dataField=tt2/
 mx:DataGridColumn headerText=Column 3 dataField=tt3/
 /mx:columns
 /mx:DataGrid
 mx:Button x=85 y=134 label=Button click=val()/

 /mx:Application

 can anyone help with the script..

 thanks
 san


  



Re: [flexcoders] Re: Socket does not connect on FP9 r45

2008-07-02 Thread Sean Clark Hess
Ok, that's what I thought about WebORB.  We were using a custom polling
mechanism before switching to sockets -- the delay was annoying, which is
why we switched.

Are you saying that BlazeDS uses http persistent connections?  You're right,
that could get annoying.  It doesn't make any sense to use persistent
connections with apache or another large-scale HTTP server.  My socket
server bypasses apache and just uses TCP/IP and the Socket class to open as
many persistent connections as I need.  Since the communication is so
lightweight (no files, or even real data passed), it shouldn't be a big deal
to have hundreds or thousands of persistent connections at a time.  Any time
it needs to pass big data, it just stores it in the db, messages the
recipients, who get it through a standard HTTP service.

So far, our custom solution seems to be the best, since messages are sent
fairly infrequently, but we want them to show up instantaneously.  A 2 or 4
second poll per client, with each one accessing the database can get hairy
pretty fast.

Thanks
~sean





On Wed, Jul 2, 2008 at 9:51 AM, valdhor [EMAIL PROTECTED] wrote:

   As far as I understand WebORB, it uses a pseudo push mechanism. The
 client actively polls for any new data. (I could be wrong about this.
 Please let me know if I am. I am basing my assumptions on forum posts
 - eg. http://www.themidnightcoders.com/forum/default.aspx?g=postst=505).

 If you don't like active polling, look at BlazeDS.

 I use an active poll in my applications but I do it once every 30
 minutes (It's just to alert users of any news they need to know).

 I don't know if I like the non polling solution. It means that you
 have to open a persistent connection to the server and sooner or later
 you will run out of connections.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Sean
 Clark Hess [EMAIL PROTECTED] wrote:
 
  Does WebORB use sockets? I thought it was an http connection, but I
 could
  be mistaken. If there's a better way, I'd be happy to switch, but I
 couldn't
  find anything. The current system is VERY lightweight, and it's quite
  unlikely that WebORB is faster, but it might be a lot more stable -- I
  definitely want to look into it.
 
  Our needs are
  1) Messaging between clients (Push to client)
  2) Speed (for lightweight messages)
 
  Does WebORB do #1?
 
  I looked at the example you posted -- Yes, it is very easy to send
 JSON to
  PHP and get a JSON response -- we are doing this elsewhere. But
 HTTPService
  is, well, HTTP -- the server can't push data back to the client.
 
  Thanks!
  ~sean
 
  On Wed, Jul 2, 2008 at 7:42 AM, valdhor [EMAIL PROTECTED] wrote:
 
   I can't help you with your problem but do wonder why you felt
 the need
   to create your own socket system to implement JSON to PHP.
  
   AFAIK there are a number of solutions for this (eg.
  
  

 http://blog.paranoidferret.com/index.php/2007/08/24/flex-php-json-mysql-advanced-updating/
   ).
  
   Also, WebORB with AMF3 is a much simpler (And probably faster)
   solution for getting data to and from Flex/PHP.
  
  
   --- In flexcoders@yahoogroups.com 
   flexcoders%40yahoogroups.comflexcoders%
 40yahoogroups.com,
 Sean
   Clark Hess seanhess@ wrote:
   
Hello coders!
   
This is my first question to the list, so go easy on me, alright? :)
   
I spent quite a while developing a good socket system that
   communicated with
PHP via JSON. It uses the Socket class (since that's the only way
   you can
do it, as far as I'm aware). It works perfectly now, with one small
caveat.
   
When testing it on machines with r45 of FP9 installed, it didn't
   connect.
I'm not sure which version started working, but I think it works on
   r115
and r124. As far as I can tell, the connect event just never fires.
   The
policy file request goes through fine, but the socket server
 never hears
from the connection request.
   
Thanks!
~sean
   
  
  
  
 

  



Re: [flexcoders] display text input values in datagrid

2008-07-02 Thread Sean Clark Hess
I'm not sure what you mean, or why you would want to push them down.  but
you can add more rows by adding more rows to the array... The datagrid just
displays what is in the array.  So, just copy that values.push() line, and
put different (or blank) values in .

~sean

On Wed, Jul 2, 2008 at 10:24 AM, Santhosh Garlapad 
[EMAIL PROTECTED] wrote:

Hi Sean,

 Thannks for the suggestion.
 How can push the values down if i want to add few more rows in the
 datagrid?
 Do i need to loo through the datagrid?

 Thanks
 Santosh





 - Original Message 
 From: Sean Clark Hess [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com
 Sent: Wednesday, July 2, 2008 8:32:51 AM
 Subject: Re: [flexcoders] display text input values in datagrid

  You want to change your val() function to something more like this.

  private function val():void
 {
 var values:Array = new Array();

 // this is only one row
 values.push( {tt1:pp1. text, tt2:pp2.text,
 tt3:pp3.text} );


 dg.dataProvider= values;
 }

 The dataProvider for a datagrid should be something like an array (because
 of all the rows).  Each row should be an object with fields (like tt1
 tt2 and tt3)

 On Tue, Jul 1, 2008 at 8:43 PM, Santhosh Garlapad santhoshgarlapad@
 yahoo.com [EMAIL PROTECTED] wrote:

 Hi guys,

 i m a beginner to flex development.

 i have few text input fieds and when i click add button all the text input
 values to be displayed in datagrid.

 if i add few more items into the datagrid the values the new values
 display first

 sample datagrid as follows;
 column1 col2col3
 text1text 2   text3
 textatextbtextc

 please find the sample code below''

 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe. com/2006/ 
 mxmlhttp://www.adobe.com/2006/mxml
 layout=absolute

 mx:Script
 ![CDATA[
 private function val():void

 {
 dg.dataProvider= pp1.text;
 }
 ]]
 /mx:Script

 mx:TextInput x=170 y=73 id=pp1/
 mx:TextInput x=170 y=73 id=pp2/
 mx:TextInput x=170 y=73 id=pp3/
 mx:DataGrid x=207 y=144 id=dg
 mx:columns
 mx:DataGridColumn headerText=Column 1 dataField=tt1/
 mx:DataGridColumn headerText=Column 2 dataField=tt2/
 mx:DataGridColumn headerText=Column 3 dataField=tt3/
 /mx:columns
 /mx:DataGrid
 mx:Button x=85 y=134 label=Button click=val()/

 /mx:Application

 can anyone help with the script..

 thanks
 san




  



Re: [flexcoders] display text input values in datagrid

2008-07-02 Thread Sean Clark Hess
Ah, I understand.  You should use an ArrayCollection.   If you set the
dataProvider of the datagrid to the array collection, you can update or
change the collection's source at any time.

So, you'd want something like this:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute

mx:Script
![CDATA[
import mx.collections.ArrayCollection;

[Bindable]
private var collection:ArrayCollection = new ArrayCollection(new
Array());

private function val():void
{
// will add one row to the collection you are already
watching
collection.source.push({tt1:pp1.text, tt2:pp2.text,
tt3:pp3.text});
}
]]
/mx:Script

mx:TextInput x=170 y=73 id=pp1/
mx:TextInput x=170 y=73 id=pp2/
mx:TextInput x=170 y=73 id=pp3/

!-- I bind the dataProvider to the collection here --
mx:DataGrid x=207 y=144 id=dg dataProvider='{collection}'
mx:columns
mx:DataGridColumn headerText=Column 1 dataField=tt1/
mx:DataGridColumn headerText=Column 2 dataField=tt2/
mx:DataGridColumn headerText=Column 3 dataField=tt3/
/mx:columns
/mx:DataGrid
mx:Button x=85 y=134 label=Button click=val()/

/mx:Application


On Wed, Jul 2, 2008 at 10:36 AM, Santhosh Garlapad 
[EMAIL PROTECTED] wrote:

   Hi Sean,
 I m working on Shopping cart application.
 I have Button called ADD another Item.If i click on that button the all the
 shopping cart item details shold be displayed in the datagrid.
 Your solution is perfect if i have only one row item in the datagrid.If i
 click Add another items multiple times and alll the text input values should
 be displayed in the datagrid.
 Say i clicked the add another item 20 times ,,the datagrid should contains
 20 items in that(with textinput values)


 The sample datagrid as follows:
 column1 col2col3
 text1text 2   text3 --button Clicked second time
 textatextbtextc--button Clicked first time



 Thanks

 Santosh



 - Original Message 
 From: Sean Clark Hess [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com
 Sent: Wednesday, July 2, 2008 9:27:00 AM
 Subject: Re: [flexcoders] display text input values in datagrid

  I'm not sure what you mean, or why you would want to push them down.
  but you can add more rows by adding more rows to the array... The datagrid
 just displays what is in the array.  So, just copy that values.push( ) line,
 and put different (or blank) values in .

 ~sean

 On Wed, Jul 2, 2008 at 10:24 AM, Santhosh Garlapad santhoshgarlapad@
 yahoo.com [EMAIL PROTECTED] wrote:

 Hi Sean,

 Thannks for the suggestion.
 How can push the values down if i want to add few more rows in the
 datagrid?
 Do i need to loo through the datagrid?

 Thanks
 Santosh





 - Original Message 
 From: Sean Clark Hess [EMAIL PROTECTED] com [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] ups.com flexcoders@yahoogroups.com
 Sent: Wednesday, July 2, 2008 8:32:51 AM
 Subject: Re: [flexcoders] display text input values in datagrid

  You want to change your val() function to something more like this.

  private function val():void
 {
 var values:Array = new Array();

 // this is only one row
 values.push( {tt1:pp1. text, tt2:pp2.text,
 tt3:pp3.text} );


 dg.dataProvider= values;
 }

 The dataProvider for a datagrid should be something like an array (because
 of all the rows).  Each row should be an object with fields (like tt1
 tt2 and tt3)

 On Tue, Jul 1, 2008 at 8:43 PM, Santhosh Garlapad santhoshgarlapad@
 yahoo.com [EMAIL PROTECTED] wrote:

 Hi guys,

 i m a beginner to flex development.

 i have few text input fieds and when i click add button all the text
 input values to be displayed in datagrid.

 if i add few more items into the datagrid the values the new values
 display first

 sample datagrid as follows;
 column1 col2col3
 text1text 2   text3
 textatextbtextc

 please find the sample code below''

 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe. com/2006/ 
 mxmlhttp://www.adobe.com/2006/mxml
 layout=absolute

 mx:Script
 ![CDATA[
 private function val():void

 {
 dg.dataProvider= pp1.text;
 }
 ]]
 /mx:Script

 mx:TextInput x=170 y=73 id=pp1/
 mx:TextInput x=170 y=73 id=pp2/
 mx:TextInput x=170 y=73 id=pp3/
 mx:DataGrid x=207 y=144 id=dg
 mx:columns
 mx:DataGridColumn headerText=Column 1 dataField=tt1/
 mx:DataGridColumn headerText=Column 2 dataField=tt2/
 mx:DataGridColumn headerText=Column 3 dataField=tt3/
 /mx:columns
 /mx:DataGrid
 mx:Button x=85 y=134 label=Button click=val()/

 /mx:Application

 can anyone help with the script..

 thanks
 san






  



Re: [flexcoders] Compile issues in FlexBuilder 3

2008-07-02 Thread Sean Clark Hess
Try creating a new project, and just copying the src folder from the sample
into your new one.

On Wed, Jul 2, 2008 at 10:38 AM, daddyo_buckeye 
[EMAIL PROTECTED] wrote:

   I have an app in Flex that won't compile, I'm getting a message that
 the HTML file is missing.

 This is a downloaded sample app loaded into Flex and tried to compile
 it the first time to see how the code works.

 Is there a prefs file or compile parameters to tell Flex Builder to
 forget about previous builds and compile a new version? I'm guessing
 it's looking for a previous compile the author built but didn't
 include in the download.

 BTW, I'm not getting any errors in the code.

 Thanks in advance for your assistance.

  



Re: [flexcoders] List displaying wrong information

2008-07-02 Thread Sean Clark Hess
And both are bound to the same ArrayCollection?

On Wed, Jul 2, 2008 at 10:19 AM, nathanpdaniel [EMAIL PROTECTED] wrote:

   I'm building shopping cart functionality which uses a ShoppingCart
 component with 2 states. A mini cart and a regular view. The
 regular view works fine with a DataGrid component and shows correct
 cart items and price etc.

 The mini cart on the other hand doesn't work properly once you add an
 item to the cart.

 If I add an item to the cart it displays properly. When I delete a
 cart item, it displays properly. When I add another cart item after
 deleting one, the item I last deleted shows up rather than the new
 item I'm trying to add. I change view to regular (with DataGrid)
 and it displays properly.

 If I add 5 items to my cart, the mini view will show the first 5
 items I put in my cart. If I only had 3 items originally, then
 deleted all three and put 5 new ones, the first three display as the
 original 3 (in the order they were deleted), the final 2 are the
 final 2 items I added with the set of 5.

 Hopefully I've explained my situation in a way that is helpful. As
 for me, I'm at a loss - completely. I'm tracing through my cart
 items and it displays what should be showing up.

 I'm using a List component with a custom itemRenderer.

 -Nathan D.

  



Re: [flexcoders] Issues panning a swf loaded via SWFLoader

2008-07-02 Thread Sean Clark Hess
Do you have clipContent='true' on the container?

On Wed, Jul 2, 2008 at 9:14 AM, djepyon [EMAIL PROTECTED] wrote:

   I'm loading a swf into a SWFLoader (earth-shattering, I know). The swf
 document size itself is set 2800x960, but there is an additional
 element beneath this in the pasteboard (what was the flash 8
 workarea) that is about 500px in length. I need to be able to pan
 down to this element. If make a call to set the y value of the
 SWFLoader to -500 (to pan downward) the top portion breaks out and
 hovers above my other components instead disappearing at the top border.

 I went a step further and wrapped the swfLoader in a Canvas object.
 Setting the y value to -500 on the MXML object did just what I wanted
 to. I then began setting this dynamically, which produced the same
 results as before. I also tried to run validateDisplayList() hoping it
 would fix things but to no avail.

 Any suggestions would be greatly appreciated :)

  



Re: [flexcoders] Re: List displaying wrong information

2008-07-02 Thread Sean Clark Hess
Yeah, that's as far as I can get without seeing any code

On Wed, Jul 2, 2008 at 12:01 PM, Tim Hoff [EMAIL PROTECTED] wrote:


 Interested to see what your itemRenderer looks like. Are you
 over-riding any methods?

 -TH


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 nathanpdaniel [EMAIL PROTECTED] wrote:
 
  BTW - If I don't use an itemRenderer, it works fine and displays how
  it should.
 
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 nathanpdaniel ndaniel@
  wrote:
  
   Yes - and in fact - to clarify - when I run my application, it
   displays the mini cart all the time (always on) - so when I add
   items, it updates, when they're removed, it's updated.
  Unfortunately
   when I delete an item and add a new one, it displays the old one,
   even though in my cart itself is showing the new item. I'm only
   making changes to the Cart object itself which has a property
   cartItems (ArrayCollection). Debugging, this is always right with
   what the cart should be - it's just not showing the right products.
  
   --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 Sean Clark Hess seanhess@
   wrote:
   
And both are bound to the same ArrayCollection?
   
On Wed, Jul 2, 2008 at 10:19 AM, nathanpdaniel ndaniel@ wrote:
   
 I'm building shopping cart functionality which uses a
   ShoppingCart
 component with 2 states. A mini cart and a regular view. The
 regular view works fine with a DataGrid component and shows
   correct
 cart items and price etc.

 The mini cart on the other hand doesn't work properly once you
   add an
 item to the cart.

 If I add an item to the cart it displays properly. When I
  delete a
 cart item, it displays properly. When I add another cart item
   after
 deleting one, the item I last deleted shows up rather than the
  new
 item I'm trying to add. I change view to regular (with
  DataGrid)
 and it displays properly.

 If I add 5 items to my cart, the mini view will show the first 5
 items I put in my cart. If I only had 3 items originally, then
 deleted all three and put 5 new ones, the first three display
  as
   the
 original 3 (in the order they were deleted), the final 2 are the
 final 2 items I added with the set of 5.

 Hopefully I've explained my situation in a way that is helpful.
  As
 for me, I'm at a loss - completely. I'm tracing through my cart
 items and it displays what should be showing up.

 I'm using a List component with a custom itemRenderer.

 -Nathan D.



   
  
 

  



Re: [flexcoders] Inspecting data from HTTPService result to an ArrayCollection

2008-07-02 Thread Sean Clark Hess
Each row is an xml object...

So, (myData.getItemAt(i) as XML).children()

Then you could loop through the children and ask them for their name. After
the as XML step you can do anything you can normally do with the XML object

On Wed, Jul 2, 2008 at 12:11 PM, Stephen More [EMAIL PROTECTED]
wrote:

   ( Example code taken from:
 http://livedocs.adobe.com/flex/201/html/charts_intro_108_12.html )
 Here is the dataset I am trying to work with:

 data
 result month=Jan-04
 apple81768/apple
 orange60310/orange
 banana43357/banana
 /result
 result month=Feb-04
 apple81156/apple
 orange58883/orange
 banana49280/banana
 /result
 /data

 The flex code will look like this:
 mx:HTTPService
 id=srv
 url=../assets/data.xml
 useProxy=false
 result=myData=ArrayCollection(srv.lastResult.data.result)
 /

 How can I interrogate the ArrayCollection named myData so that it will
 return apple, orange, and banana ?
 I am not looking to get the numerical values, I want to get the xml name.

 -Thanks
 Steve More
  



Re: [flexcoders] Re: Socket does not connect on FP9 r45

2008-07-02 Thread Sean Clark Hess
Ah... the truth come out.  Ok, thanks, that's good to know.  I don't mind
Java, but running tomcat might be a problem.  I'll ask the system admin.

Thanks
~sean

On Wed, Jul 2, 2008 at 12:45 PM, valdhor [EMAIL PROTECTED] wrote:

   BlazeDS does exactly what your custom solution does (Albeit more
 stably). The only caveat is that you would need a Java Servlet
 container (eg. Tomcat, JBoss) and you would need to learn Java.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Sean
 Clark Hess [EMAIL PROTECTED] wrote:
 
  Ok, that's what I thought about WebORB. We were using a custom polling
  mechanism before switching to sockets -- the delay was annoying,
 which is
  why we switched.
 
  Are you saying that BlazeDS uses http persistent connections?
 You're right,
  that could get annoying. It doesn't make any sense to use persistent
  connections with apache or another large-scale HTTP server. My socket
  server bypasses apache and just uses TCP/IP and the Socket class to
 open as
  many persistent connections as I need. Since the communication is so
  lightweight (no files, or even real data passed), it shouldn't be a
 big deal
  to have hundreds or thousands of persistent connections at a time.
 Any time
  it needs to pass big data, it just stores it in the db, messages the
  recipients, who get it through a standard HTTP service.
 
  So far, our custom solution seems to be the best, since messages are
 sent
  fairly infrequently, but we want them to show up instantaneously. A
 2 or 4
  second poll per client, with each one accessing the database can get
 hairy
  pretty fast.
 
  Thanks
  ~sean
 
 
 
 
 
  On Wed, Jul 2, 2008 at 9:51 AM, valdhor [EMAIL PROTECTED] wrote:
 
   As far as I understand WebORB, it uses a pseudo push mechanism. The
   client actively polls for any new data. (I could be wrong about this.
   Please let me know if I am. I am basing my assumptions on forum posts
   - eg.
 http://www.themidnightcoders.com/forum/default.aspx?g=postst=505).
  
   If you don't like active polling, look at BlazeDS.
  
   I use an active poll in my applications but I do it once every 30
   minutes (It's just to alert users of any news they need to know).
  
   I don't know if I like the non polling solution. It means that you
   have to open a persistent connection to the server and sooner or later
   you will run out of connections.
  
  
   --- In flexcoders@yahoogroups.com 
   flexcoders%40yahoogroups.comflexcoders%
 40yahoogroups.com,
 Sean
   Clark Hess seanhess@ wrote:
   
Does WebORB use sockets? I thought it was an http connection, but I
   could
be mistaken. If there's a better way, I'd be happy to switch, but I
   couldn't
find anything. The current system is VERY lightweight, and it's
 quite
unlikely that WebORB is faster, but it might be a lot more
 stable -- I
definitely want to look into it.
   
Our needs are
1) Messaging between clients (Push to client)
2) Speed (for lightweight messages)
   
Does WebORB do #1?
   
I looked at the example you posted -- Yes, it is very easy to send
   JSON to
PHP and get a JSON response -- we are doing this elsewhere. But
   HTTPService
is, well, HTTP -- the server can't push data back to the client.
   
Thanks!
~sean
   
On Wed, Jul 2, 2008 at 7:42 AM, valdhor stevedepp@ wrote:
   
 I can't help you with your problem but do wonder why you felt
   the need
 to create your own socket system to implement JSON to PHP.

 AFAIK there are a number of solutions for this (eg.


  
  

 http://blog.paranoidferret.com/index.php/2007/08/24/flex-php-json-mysql-advanced-updating/
 ).

 Also, WebORB with AMF3 is a much simpler (And probably faster)
 solution for getting data to and from Flex/PHP.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
 flexcoders%40yahoogroups.comflexcoders%

   40yahoogroups.com,
   Sean
 Clark Hess seanhess@ wrote:
 
  Hello coders!
 
  This is my first question to the list, so go easy on me,
 alright? :)
 
  I spent quite a while developing a good socket system that
 communicated with
  PHP via JSON. It uses the Socket class (since that's the
 only way
 you can
  do it, as far as I'm aware). It works perfectly now, with
 one small
  caveat.
 
  When testing it on machines with r45 of FP9 installed, it didn't
 connect.
  I'm not sure which version started working, but I think it
 works on
 r115
  and r124. As far as I can tell, the connect event just never
 fires.
 The
  policy file request goes through fine, but the socket server
   never hears
  from the connection request.
 
  Thanks!
  ~sean
 



   
  
  
  
 

  



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

2008-07-02 Thread Sean Clark Hess
We would get that error a lot when the file was too big.  Try increasing
your upload size.

On Wed, Jul 2, 2008 at 1:01 PM, lytvynyuk [EMAIL PROTECTED] wrote:

   I getting this error, but when I put breakpoint at my server side code
 nothing coming through!! When I created little HTML page with file
 upload filed to same servlet location - IT WORKS!

 I used Live HTTP headers to see activity on HTTP requests -
 nothing nothing going through, also I used Wireshark - same effect.

 So what is going on ? any Ideas?

 AS code is extremely simple:

 var request:URLRequest = new URLRequest();
 request.url = UPLOAD_URL;
 fr.upload(request);
 fileNameLabel.text = fr.name;

  



Re: [flexcoders] Re: Issues panning a swf loaded via SWFLoader

2008-07-02 Thread Sean Clark Hess
Ah, ok.. great

On Wed, Jul 2, 2008 at 12:55 PM, djepyon [EMAIL PROTECTED] wrote:

   Figured out the problem here. I was moving the content within the
 SWFLoader instead of the SWFLoader itself. Moving the SWFLoader in a
 canvas object with clipContent = true solved the problem.

 Much thanks for the tip Sean.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 djepyon [EMAIL PROTECTED] wrote:
 
  (I accidentally put this as a response to another topic the first time
  so I'm re-posting)
 
  I'm loading a swf into a SWFLoader (earth-shattering, I know). The swf
  document size itself is set 2800x960, but there is an additional
  element beneath this in the pasteboard (what was the flash 8
  workarea) that is about 500px in length. I need to be able to pan
  down to this element. If make a call to set the y value of the
  SWFLoader to -500 (to pan downward) the area above it hovers above my
  flex components instead of going underneath.
 
  I went a step further and wrapped the swfLoader in a Canvas object.
  Setting the y value to -500 on the MXML object did just what I wanted
  to. I then began setting this dynamically, which produces the same
  results as before. I also tried to run validateDisplayList() hoping it
  would fix things but to no avail.
 
  Any suggestions would be greatly appreciated :)
 

  



Re: [flexcoders] Inspecting data from HTTPService result to an ArrayCollection

2008-07-02 Thread Sean Clark Hess
What do you get when you trace myData.getItemAt(0)?  That will return null
if it isn't an XML.  You can do this too:

trace(CHECK :  + (myData.getItemAt(0) is XML));

You can check to see if it is an XMLList too, but I thought looking at it,
it seemed like a flat xml.

On Wed, Jul 2, 2008 at 1:32 PM, Stephen More [EMAIL PROTECTED] wrote:

   Thats what I was thinking but when I try:

 var myXML:XML;
 myXML = myData.getItemAt(0) as XML;
 trace( DEBUG:  + myXML );

 I get
 DEBUG: null


 On Wed, Jul 2, 2008 at 2:30 PM, Sean Clark Hess [EMAIL 
 PROTECTED]seanhess%40gmail.com
 wrote:
  Each row is an xml object...
 
  So, (myData.getItemAt(i) as XML).children()
 
  Then you could loop through the children and ask them for their name.
 After
  the as XML step you can do anything you can normally do with the XML
 object
 
  On Wed, Jul 2, 2008 at 12:11 PM, Stephen More [EMAIL 
  PROTECTED]stephen.more%40gmail.com
 
  wrote:
 
  ( Example code taken from:
  http://livedocs.adobe.com/flex/201/html/charts_intro_108_12.html )
  Here is the dataset I am trying to work with:
 
  data
  result month=Jan-04
  apple81768/apple
  orange60310/orange
  banana43357/banana
  /result
  result month=Feb-04
  apple81156/apple
  orange58883/orange
  banana49280/banana
  /result
  /data
 
  The flex code will look like this:
  mx:HTTPService
  id=srv
  url=../assets/data.xml
  useProxy=false
  result=myData=ArrayCollection(srv.lastResult.data.result)
  /
 
  How can I interrogate the ArrayCollection named myData so that it will
  return apple, orange, and banana ?
  I am not looking to get the numerical values, I want to get the xml
 name.
 
  -Thanks
  Steve More
 
 
  



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

2008-07-02 Thread Sean Clark Hess
You have to do it serverside -- for example, if you're using PHP, you have
to change Apache's maximum upload size for that domain.

Do a search for error 2038 in these forums though, I thought I saw another
couple of threads about it.

~sean

On Wed, Jul 2, 2008 at 1:33 PM, lytvynyuk [EMAIL PROTECTED] wrote:

   How I can increase upload size? There is no such thing in URLRequest
 and FileReference...


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Sean
 Clark Hess [EMAIL PROTECTED] wrote:
 
  We would get that error a lot when the file was too big. Try increasing
  your upload size.
 
  On Wed, Jul 2, 2008 at 1:01 PM, lytvynyuk [EMAIL PROTECTED] wrote:
 
   I getting this error, but when I put breakpoint at my server
 side code
   nothing coming through!! When I created little HTML page with file
   upload filed to same servlet location - IT WORKS!
  
   I used Live HTTP headers to see activity on HTTP requests -
   nothing nothing going through, also I used Wireshark - same
 effect.
  
   So what is going on ? any Ideas?
  
   AS code is extremely simple:
  
   var request:URLRequest = new URLRequest();
   request.url = UPLOAD_URL;
   fr.upload(request);
   fileNameLabel.text = fr.name;
  
  
  
 

  



Re: [flexcoders] Reference to mxml id from within mxml component

2008-07-02 Thread Sean Clark Hess
Yes, use event.target.

private function onMouseDown(event:MouseEvent):void
{
(event.target as Spirte).startDrag();
}

The reason why your last two things don't work is because, unlike
javascript, this and id would refer to the parent component (e.g. the
file you are currently editing).  So, if you want to pass id you have to
pass ComponentCId.id (like you did in #2).  Or, if you want to pass this
you have to pass ComponentDId

This way is very consistent... this always just refers to the file your
working in.  It's always easy to drill down anyway.



On Wed, Jul 2, 2008 at 1:18 PM, edlueze [EMAIL PROTECTED] wrote:

   I am trying to refer to the id field for an mxml component from within
 that component so I can pass it back to some actionscript.

 Consider this example: I want to be able to drag components around a
 panel by calling mouseDown/mouseUp from within the mxml component
 definition. The first two components work (ComponentA and ComponentB)
 but the second two components don't work (ComponentC and ComponentD).

 Being able to reference the component id from within the mxml
 component provides a little more scalability. Perhaps there is a
 better way altogether?

 mx:Script
 ![CDATA[

 private function onMouseDown(event:MouseEvent, myid:String ):void
 {
 this[myid].startDrag();
 }

 private function onMouseUp(event:MouseEvent, myid:String ):void
 {
 this[myid].stopDrag();
 }
 ]]
 /mx:Script

 !-- This works --
 component:ComponentA
 id=ComponentAId
 mouseDown=onMouseDown(event,'ComponentAId')
 mouseUp=onMouseUp(event,'ComponentAId')/

 !-- And this works --
 component:ComponentB
 id=ComponentBId
 mouseDown=onMouseDown(event,ComponentBId.id)
 mouseUp=onMouseUp(event,ComponentBId.id)/

 !-- But this doesn't work --
 component:ComponentC
 id=ComponentCId
 mouseDown=onMouseDown(event,id)
 mouseUp=onMouseUp(event,id)/

 !-- And this doesn't work --
 component:ComponentD
 id=ComponentDId
 mouseDown=onMouseDown(event,this)
 mouseUp=onMouseUp(event,this)/

  



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

2008-07-02 Thread Sean Clark Hess
The other thing is that the file may be corrupted, or doesn't exist...

On Wed, Jul 2, 2008 at 1:43 PM, lytvynyuk [EMAIL PROTECTED] wrote:

   I did. I all cases request can reach server, in my case no. Just an
 exception, no network activity I'm puzzled.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Sean
 Clark Hess [EMAIL PROTECTED] wrote:
 
  You have to do it serverside -- for example, if you're using PHP,
 you have
  to change Apache's maximum upload size for that domain.
 
  Do a search for error 2038 in these forums though, I thought I saw
 another
  couple of threads about it.
 
  ~sean
 

  



Re: [flexcoders] Inspecting data from HTTPService result to an ArrayCollection

2008-07-02 Thread Sean Clark Hess
Ah, got it.

The mx:Model tag converts everything to a flat object.  So the minute you
use it, you no longer have xml.

It's still easy enough to loop through though.

var result:Object = myData.getItemAt(0);
for (var name:String in result)
{
trace(name +  ::  + result[name]);
}

should output
apple :: 81768
orange :: 60310
banana :: 43357


On Wed, Jul 2, 2008 at 1:46 PM, Stephen More [EMAIL PROTECTED] wrote:

   Here is my output:

 DEBUG: 2 null
 [object Object]
 CHECK : false
 CHECK : false

 Here is all the code:
 ?xml version=1.0?
 !-- charts/XMLFileToArrayCollectionDataProvider.mxml --
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 width=100% height=100%
 mx:Script
 import mx.utils.ArrayUtil;
 /mx:Script

 mx:Model id=results source=../assets/data.xml/
 mx:ArrayCollection id=myData
 source={ArrayUtil.toArray(results.result)}
 /

 mx:Panel title=Line Chart
 mx:LineChart id=chart dataProvider={myData} showDataTips=true
 mx:horizontalAxis
 mx:CategoryAxis categoryField=month/
 /mx:horizontalAxis
 mx:series
 mx:LineSeries yField=banana displayName=Banana/
 mx:LineSeries yField=apple displayName=Apple/
 mx:LineSeries yField=orange displayName=Orange/
 /mx:series
 /mx:LineChart

 mx:Button id=iconButton label=Button with Icon
 labelPlacement=right color=#993300
 click=printMessage(event);/

 mx:Script
 ![CDATA[

 import flash.events.Event;

 // Event handler function to print a message
 // describing the selected Button control.
 private function printMessage(event:Event):void {
 //message.text += event.target.label +  pressed + \n;


 var myXML:XML;
 myXML = myData.getItemAt(0) as XML;
 trace( DEBUG:  + myData.length +   + myXML );
 trace( myData.getItemAt(0) );
 trace(CHECK :  + (myData.getItemAt(0) is XML));
 trace(CHECK :  + (myData.getItemAt(0) is XMLList));
 }

 ]]
 /mx:Script

 /mx:Panel
 /mx:Application


 On Wed, Jul 2, 2008 at 3:34 PM, Sean Clark Hess [EMAIL 
 PROTECTED]seanhess%40gmail.com
 wrote:
  What do you get when you trace myData.getItemAt(0)? That will return null
  if it isn't an XML. You can do this too:
 
  trace(CHECK :  + (myData.getItemAt(0) is XML));
 
  You can check to see if it is an XMLList too, but I thought looking at
 it,
  it seemed like a flat xml.
 
  On Wed, Jul 2, 2008 at 1:32 PM, Stephen More [EMAIL 
  PROTECTED]stephen.more%40gmail.com
 wrote:
 
  Thats what I was thinking but when I try:
 
  var myXML:XML;
  myXML = myData.getItemAt(0) as XML;
  trace( DEBUG:  + myXML );
 
  I get
  DEBUG: null
 
  On Wed, Jul 2, 2008 at 2:30 PM, Sean Clark Hess [EMAIL 
  PROTECTED]seanhess%40gmail.com
 
  wrote:
   Each row is an xml object...
  
   So, (myData.getItemAt(i) as XML).children()
  
   Then you could loop through the children and ask them for their name.
   After
   the as XML step you can do anything you can normally do with the XML
   object
  
   On Wed, Jul 2, 2008 at 12:11 PM, Stephen More [EMAIL 
   PROTECTED]stephen.more%40gmail.com
 
   wrote:
  
   ( Example code taken from:
   http://livedocs.adobe.com/flex/201/html/charts_intro_108_12.html )
   Here is the dataset I am trying to work with:
  
   data
   result month=Jan-04
   apple81768/apple
   orange60310/orange
   banana43357/banana
   /result
   result month=Feb-04
   apple81156/apple
   orange58883/orange
   banana49280/banana
   /result
   /data
  
   The flex code will look like this:
   mx:HTTPService
   id=srv
   url=../assets/data.xml
   useProxy=false
   result=myData=ArrayCollection(srv.lastResult.data.result)
   /
  
   How can I interrogate the ArrayCollection named myData so that it
 will
   return apple, orange, and banana ?
   I am not looking to get the numerical values, I want to get the xml
   name.
  
   -Thanks
   Steve More
  
  
 
 

  



Re: [flexcoders] How to post values from a swf widget to a backend server

2008-07-02 Thread Sean Clark Hess
Use this.mouseX and this.mouseY to get the point, then on the click handler
create a new instance of HTTPService and pass them as parameters (see the
documentation)

On Wed, Jul 2, 2008 at 2:03 PM, pankajtandon2003 [EMAIL PROTECTED]
wrote:

   Hello,
 I've got a flex swf Panel say that I'm asking the user to click on.
 Once he has clicked, I would like to sent a http request (preferably a
 POST) to a back end server with the values of the coordinates of the
 point he has clicked on.

 Any suggestions on how I could affect this?

 TIA,

 Pankaj

  



Re: [flexcoders] Question about ContextMenu and dataGrid

2008-07-02 Thread Sean Clark Hess
You can't click the row with enabled = false.  But if you set enabled =
true, and hid the two indicators, you could easily use the itemFocusIn event
to know what you clicked.

On Wed, Jul 2, 2008 at 2:03 PM, markgoldin_2000 [EMAIL PROTECTED]
wrote:

   My DG is enabled = false and both drawSelectionIndicator and
 drawHighlightIndicator are overridden to completely hide the selection
 indicator. Is there a way of knowing what item/row were clicked?

 Thanks

  



Re: [flexcoders] Re: Question about ContextMenu and dataGrid

2008-07-02 Thread Sean Clark Hess
Can you bind to selectedItem?


On Wed, Jul 2, 2008 at 2:54 PM, markgoldin_2000 [EMAIL PROTECTED]
wrote:

   I wasn't right, the grid is enabled.
 I have added this to the grid:
 addEventListener(itemFocusIn, itemFocusInHandler);

 itemFocusInHandler does not fire.

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

 
  You can't click the row with enabled = false. But if you set
 enabled =
  true, and hid the two indicators, you could easily use the
 itemFocusIn event
  to know what you clicked.
 
  On Wed, Jul 2, 2008 at 2:03 PM, markgoldin_2000
 [EMAIL PROTECTED]
  wrote:
 
   My DG is enabled = false and both drawSelectionIndicator and
   drawHighlightIndicator are overridden to completely hide the
 selection
   indicator. Is there a way of knowing what item/row were clicked?
  
   Thanks
  
  
  
 

  



Re: [flexcoders] Re: Question about ContextMenu and dataGrid

2008-07-02 Thread Sean Clark Hess
Something like
mx:Binding source='myDataGrid.selectedItem' destination='mySelectedItem'/


public function set mySelectedItem(value:Object):void
{
trace(Selected Row + value);
}


On Wed, Jul 2, 2008 at 2:58 PM, markgoldin_2000 [EMAIL PROTECTED]
wrote:

   In where? In contextmenu handler? How would I do that?


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Sean
 Clark Hess [EMAIL PROTECTED]
 wrote:
 
  Can you bind to selectedItem?
 
 
  On Wed, Jul 2, 2008 at 2:54 PM, markgoldin_2000
 [EMAIL PROTECTED]
  wrote:
 
   I wasn't right, the grid is enabled.
   I have added this to the grid:
   addEventListener(itemFocusIn, itemFocusInHandler);
  
   itemFocusInHandler does not fire.
  
   --- In flexcoders@yahoogroups.com 
   flexcoders%40yahoogroups.comflexcoders%
 40yahoogroups.com, Sean
   Clark Hess seanhess@
   wrote:
  
   
You can't click the row with enabled = false. But if you set
   enabled =
true, and hid the two indicators, you could easily use the
   itemFocusIn event
to know what you clicked.
   
On Wed, Jul 2, 2008 at 2:03 PM, markgoldin_2000
   markgoldin_2000@
wrote:
   
 My DG is enabled = false and both drawSelectionIndicator and
 drawHighlightIndicator are overridden to completely hide the
   selection
 indicator. Is there a way of knowing what item/row were
 clicked?

 Thanks



   
  
  
  
 

  



Re: [flexcoders] Inspecting data from HTTPService result to an ArrayCollection

2008-07-02 Thread Sean Clark Hess
Tracy,

can a datagrid read an xml object directly?  (Like, an XMLList or
XMLListCollection?)  If so, why would manually converting it perform better
than the original XML?  Does it have something to do with the strong typing?

Thanks
~sean

On Wed, Jul 2, 2008 at 4:29 PM, Tracy Spratt [EMAIL PROTECTED] wrote:

It is a rare case that you want to use mx:Model or the default
 resultFormat=object.  You take the performance hit for the conversion, you
 have no control over the conversion process (your strings that look like
 numbers will get converted to numbers, willy nilly) and you wind up with
 dynamic objects, which have an access peformance penalty.



 I advise using resultFormat=e4x, a result handler function, and an
 instance variable to hold the xmlResult.



 The best performance, especially in a multi-renderer DataGrid, will be if
 you manually convert the XML node data ino an ArrayCollection of strongly
 typed value objects.



 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Sean Clark Hess
 *Sent:* Wednesday, July 02, 2008 4:05 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Inspecting data from HTTPService result to an
 ArrayCollection



 Ah, got it.

 The mx:Model tag converts everything to a flat object.  So the minute you
 use it, you no longer have xml.

 It's still easy enough to loop through though.

 var result:Object = myData.getItemAt(0);
 for (var name:String in result)
 {
 trace(name +  ::  + result[name]);
 }

 should output
 apple :: 81768
 orange :: 60310
 banana :: 43357

  On Wed, Jul 2, 2008 at 1:46 PM, Stephen More [EMAIL PROTECTED]
 wrote:

 Here is my output:

 DEBUG: 2 null
 [object Object]
 CHECK : false
 CHECK : false

 Here is all the code:
 ?xml version=1.0?
 !-- charts/XMLFileToArrayCollectionDataProvider.mxml --
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 width=100% height=100%
 mx:Script
 import mx.utils.ArrayUtil;
 /mx:Script

 mx:Model id=results source=../assets/data.xml/
 mx:ArrayCollection id=myData
 source={ArrayUtil.toArray(results.result)}
 /

 mx:Panel title=Line Chart
 mx:LineChart id=chart dataProvider={myData} showDataTips=true
 mx:horizontalAxis
 mx:CategoryAxis categoryField=month/
 /mx:horizontalAxis
 mx:series
 mx:LineSeries yField=banana displayName=Banana/
 mx:LineSeries yField=apple displayName=Apple/
 mx:LineSeries yField=orange displayName=Orange/
 /mx:series
 /mx:LineChart

 mx:Button id=iconButton label=Button with Icon
 labelPlacement=right color=#993300
 click=printMessage(event);/

 mx:Script
 ![CDATA[

 import flash.events.Event;

 // Event handler function to print a message
 // describing the selected Button control.
 private function printMessage(event:Event):void {
 //message.text += event.target.label +  pressed + \n;



 var myXML:XML;
 myXML = myData.getItemAt(0) as XML;

 trace( DEBUG:  + myData.length +   + myXML );
 trace( myData.getItemAt(0) );


 trace(CHECK :  + (myData.getItemAt(0) is XML));

 trace(CHECK :  + (myData.getItemAt(0) is XMLList));
 }

 ]]
 /mx:Script

 /mx:Panel
 /mx:Application



 On Wed, Jul 2, 2008 at 3:34 PM, Sean Clark Hess [EMAIL 
 PROTECTED]seanhess%40gmail.com
 wrote:
  What do you get when you trace myData.getItemAt(0)? That will return null
  if it isn't an XML. You can do this too:
 
  trace(CHECK :  + (myData.getItemAt(0) is XML));
 
  You can check to see if it is an XMLList too, but I thought looking at
 it,
  it seemed like a flat xml.
 
  On Wed, Jul 2, 2008 at 1:32 PM, Stephen More [EMAIL 
  PROTECTED]stephen.more%40gmail.com
 wrote:
 
  Thats what I was thinking but when I try:
 
  var myXML:XML;
  myXML = myData.getItemAt(0) as XML;
  trace( DEBUG:  + myXML );
 
  I get
  DEBUG: null
 
  On Wed, Jul 2, 2008 at 2:30 PM, Sean Clark Hess [EMAIL 
  PROTECTED]seanhess%40gmail.com
 
  wrote:
   Each row is an xml object...
  
   So, (myData.getItemAt(i) as XML).children()
  
   Then you could loop through the children and ask them for their name.
   After
   the as XML step you can do anything you can normally do with the XML
   object
  
   On Wed, Jul 2, 2008 at 12:11 PM, Stephen More [EMAIL 
   PROTECTED]stephen.more%40gmail.com
 
   wrote:
  
   ( Example code taken from:
   http://livedocs.adobe.com/flex/201/html/charts_intro_108_12.html )
   Here is the dataset I am trying to work with:
  
   data
   result month=Jan-04
   apple81768/apple
   orange60310/orange
   banana43357/banana
   /result
   result month=Feb-04
   apple81156/apple
   orange58883/orange
   banana49280/banana
   /result
   /data
  
   The flex code will look like this:
   mx:HTTPService
   id=srv
   url=../assets/data.xml
   useProxy=false
   result=myData=ArrayCollection(srv.lastResult.data.result)
   /
  
   How can I interrogate the ArrayCollection named myData so that it
 will
   return apple, orange, and banana ?
   I am not looking to get the numerical values, I want to get the xml
   name.
  
   -Thanks

Re: [flexcoders] Re: Reference to mxml id from within mxml component

2008-07-02 Thread Sean Clark Hess
Hi Ted.

1. Oh, right... the mouse events bubble, so they are fired not only for your
components, but for whatever you actually clicked on underneath it.  It
looks like I used event.currentTarget instead of event.target.  Can you
trace (event.target) and see if it is actually the component you wanted?

2. Try fixing 1 and seeing if that fixes

3. You needed to import flash.display.Spirte;  Google flex 3 language
reference.  you can find everything there.  The only reason I used sprite
was because that was the class that defines startDrag.  Normally, if all the
components were the same (all of type ComponentA), I would do
event.currentTarget as ComponentA, since that's more specific.  Since all
flex components are UIComponents, which are sprites, they all have the
startDrag event.  you would have to import your ComponentA though.  You
could have done event.currentTarget as UIComponent just as easily (import
mx.core.UIComponent).



On Wed, Jul 2, 2008 at 2:36 PM, edlueze [EMAIL PROTECTED] wrote:

   Thanks Sean!

 I've only just started playing with your suggestion - it seems to work
 fine but there are some things I'm going to need to dig into before I
 fully understand what's going on:

 1. Not only do my components drag around fine, but the components
 *within* those components now also drag around. Interesting, but not
 what I expected. I'm going to have to figure out how to lock those
 internal parts of the component.

 2. There is some text that I'm displaying within the components. It
 appears that this text is not allowed to be dragged, and when I click
 on the text to drag it an error is thrown.

 3. I now need to add an additional line of code import
 flash.display.*. I didn't need that before - presumably I need it now
 to cast the component into a Sprite. Not sure which part of
 flash.display.* I actually need.

 All the best!

 Ted.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Sean
 Clark Hess [EMAIL PROTECTED] wrote:
 
  Yes, use event.target.
 
  private function onMouseDown(event:MouseEvent):void
  {
  (event.target as Spirte).startDrag();
  }
 
  The reason why your last two things don't work is because, unlike
  javascript, this and id would refer to the parent component
 (e.g. the
  file you are currently editing). So, if you want to pass id you
 have to
  pass ComponentCId.id (like you did in #2). Or, if you want to
 pass this
  you have to pass ComponentDId
 
  This way is very consistent... this always just refers to the file your
  working in. It's always easy to drill down anyway.
 
 
 
  On Wed, Jul 2, 2008 at 1:18 PM, edlueze [EMAIL PROTECTED] wrote:
 
   I am trying to refer to the id field for an mxml component from
 within
   that component so I can pass it back to some actionscript.
  
   Consider this example: I want to be able to drag components around a
   panel by calling mouseDown/mouseUp from within the mxml component
   definition. The first two components work (ComponentA and ComponentB)
   but the second two components don't work (ComponentC and ComponentD).
  
   Being able to reference the component id from within the mxml
   component provides a little more scalability. Perhaps there is a
   better way altogether?
  
   mx:Script
   ![CDATA[
  
   private function onMouseDown(event:MouseEvent, myid:String ):void
   {
   this[myid].startDrag();
   }
  
   private function onMouseUp(event:MouseEvent, myid:String ):void
   {
   this[myid].stopDrag();
   }
   ]]
   /mx:Script
  
   !-- This works --
   component:ComponentA
   id=ComponentAId
   mouseDown=onMouseDown(event,'ComponentAId')
   mouseUp=onMouseUp(event,'ComponentAId')/
  
   !-- And this works --
   component:ComponentB
   id=ComponentBId
   mouseDown=onMouseDown(event,ComponentBId.id)
   mouseUp=onMouseUp(event,ComponentBId.id)/
  
   !-- But this doesn't work --
   component:ComponentC
   id=ComponentCId
   mouseDown=onMouseDown(event,id)
   mouseUp=onMouseUp(event,id)/
  
   !-- And this doesn't work --
   component:ComponentD
   id=ComponentDId
   mouseDown=onMouseDown(event,this)
   mouseUp=onMouseUp(event,this)/
  
  
  
 

  



Re: [flexcoders] Flex/AJAX Bridge and Safari 3

2008-06-30 Thread Sean Clark Hess
You don't need a flex/ajax bridge just to let flex and javascript talk to
each other.  The simplest way to do that is with the ExternalInterface
class.  It's pretty easy to use.  You just decide which flex methods to
expose to javascript (ExternalInterface.addCallback) and then javascript can
call them through the reference to the embedded object.


On Mon, Jun 30, 2008 at 12:46 PM, honoraryvato [EMAIL PROTECTED]
wrote:

   Has anyone gotten the Flex/AJAX Bridge to work successfully with
 Safari 3 on Windows? If not does anyone know of another way I get get
 Flex and Javascript to talk to each other?

  



Re: [flexcoders] File uploading and passing string information

2008-06-30 Thread Sean Clark Hess
I usually just check the session to see if they are authenticated or not.

On Mon, Jun 30, 2008 at 1:48 PM, timgerr [EMAIL PROTECTED] wrote:

   Hello all,
 I am working on a file upload application and I have a few questions.
 I want to upload a file and also send some string information to
 varify user information. Can this be done? I am using the example
 from

 http://www.dgrigg.com/post.cfm/08/02/2007/Flex-and-Flash-file-uploading-with-return-data

 Here is my code (that I took)
 ?xml version=1.0 encoding=utf-8?
 !--
 Derrick Grigg
 [EMAIL PROTECTED] derrick%40dgrigg.com
 http://www.dgrigg.com
 created on August 2, 2007

 A simple file upload process with data returned from the server
 using the UPLOAD_COMPLETE_DATA event.
 --
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute
 mx:Script
 ![CDATA[
 public var file:FileReference;

 public function selectFile():void
 {
 file = new FileReference();
 file.addEventListener(Event.SELECT, fileSelected);
 file.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA,
 uploadDataComplete);
 file.addEventListener(Event.COMPLETE, uploadComplete);
 file.addEventListener(IOErrorEvent.IO_ERROR, handleError);
 file.browse();
 }

 public function handleError(event:IOErrorEvent):void
 {
 status_txt.text = 'ERROR: ' + event.text + '\n';
 }
 public function fileSelected(event:Event):void
 {
 file = FileReference(event.target);
 file_txt.text = file.name;
 status_txt.text = 'upload file: '+ file.name + '\n';

 var request:URLRequest = new URLRequest();
 request.url = uploader.cfm;
 file.upload(request);
 }

 public function uploadDataComplete(event:DataEvent):void
 {
 var result:XML = new XML(event.data);
 status_txt.text += 'Upload Data Complete\n'
 status_txt.text += 'RESULT: ' + result.toString() + '\n'
 status_txt.text += 'STATUS: ' + result.status + '\n';
 status_txt.text += 'MESSAGE: '+ result.message;
 }

 public function uploadComplete(event:Event):void
 {
 status_txt.text += 'Upload complete\n';

 }
 ]]
 /mx:Script
 mx:VBox
 mx:TextInput id=file_txt/
 mx:Button id=select_btn label=select click=selectFile();/
 mx:TextArea id=status_txt width=400 height=200/
 /mx:VBox
 /mx:Application

 Thanks,
 timgerr