[flexcoders] Passing data from top level component to lower level component
Hi gang, I'm having a dense moment. How do I pass data through an event from the application level component to a child component? I know how to pass data through an event from a child component to the application component, is it a similar process? Thanks! Steve Good http://lanctr.com
[flexcoders] Flex 3 / AIR: Checking for a window's existence and if it has focus
Hi all, I've built a very basic chat application with flex 3 and packaged it up in an AIR app and I'm wanting to refine it a bit. Currently I can double click a name in my buddy list and create a new window. The problem is if the window already exists and I double click the buddies name again I create another window. What I am trying to do is build in the ability for the buddy list to check if a window has already been created for the selected buddy, and if it has, bring the window forward and set it's focus. I was playing around with NativeApplication.nativeApplication.openedWindows but I'm not really sure how I use this, all I did was trace() the object. Am I on the right track? If so, then what would be my next step, if not then how would I check for a windows existence? Thanks! Steve Good http://lanctr.com
[flexcoders] newbie question
Let me start by saying that I am completely new to Flex and obviously the list. I'll apologize upfront for asking the dumb and obvious questions, but I'm still going to ask them :P So here's a description of what I'm doing and my question. I built an Air app with Flex 3 that posts some form data to a remote cfm file. The cfm file then returns a string. If I watch the app running in the Flex Builder 3 debug perspective I can see the string that's returned. My question is this. How do I get that string and make it available to another function? I want to use the returned string in another post method in the same app. If more details are required I can give them, just holler J and Thanks in advance. ~Steve http://lanctr.com/
RE: [flexcoders] newbie question
Sorry about the subject, I'm not sure why I didn't use something more descriptive. Here's a snippet of the code I'm using. public function postData(){ var urlData:String = "foo=bar"; trace(urlData); var variables:URLVariables = new URLVariables(urlData); var request:URLRequest = new URLRequest(); request.url = "http://domain.com/remoteScript.cfm";; request.method = URLRequestMethod.POST; request.data = variables; var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.VARIABLES; loader.addEventListener(Event.COMPLETE, completeHandler); try { loader.load(request); } catch (error:Error) { trace("Unable to load URL"); } function completeHandler(event:Event):void { trace(event.target.data.resultCode); } } I don't know if this is the best way to do this, I just copied and modified one of the examples at http://livedocs.adobe.com/flex/3/html/help.html?content=17_Networking_and_co mmunications_3.html The string I'm trying to get is in the last trace, resultCode. FB3 does show a warning about the function. "-1008: return value for function 'postData' has no type declaration." I don't have a clue what this means. I have a Flex 3 book on order, so hopefully I can bring my dumb questions down to a minimum once I get my hands on it. Thanks! ~Steve http://lanctr.com/ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Wednesday, April 23, 2008 1:06 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] newbie question Welcome, Steve. First, please use a descriptive subject for all posts, including "AIR", if you think that might be signficant. There is too much traffic on this list for anyone to read all posts, so we choose what to read based on the subject. Subjects like "HELP ME!!!" and "URGENT!!!", and even "Newbie Question" stand a good chance of being skipped. Now, for your question, I do not use AIR much yet, but generally, you need to use a result handler on your data call. That function will be called when your data returns, and you can then do whatever you need with it. Are you using RemoteObject to make the call? All the of the RPC protocols support the result event. Tracy _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Steve Good Sent: Wednesday, April 23, 2008 1:44 PM To: flexcoders Subject: [flexcoders] newbie question Let me start by saying that I am completely new to Flex and obviously the list. I'll apologize upfront for asking the dumb and obvious questions, but I'm still going to ask them :P So here's a description of what I'm doing and my question. I built an Air app with Flex 3 that posts some form data to a remote cfm file. The cfm file then returns a string. If I watch the app running in the Flex Builder 3 debug perspective I can see the string that's returned. My question is this. How do I get that string and make it available to another function? I want to use the returned string in another post method in the same app. If more details are required I can give them, just holler J and Thanks in advance. ~Steve http://lanctr.com/ __ Information from ESET NOD32 Antivirus, version of virus signature database 3049 (20080423) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
RE: [flexcoders] newbie question
Cool, I think I understand. I'll give it a try. Thanks. ~Steve http://lanctr.com/ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Wednesday, April 23, 2008 2:02 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] newbie question That is ok, but it is the hard way. HTTPService is easier to use. So you have the string you need in the completeHandler? If so, then I guess I don't understand your question. If you need to 'save" that string for later use by some other function, you could declare an "instance" (global) variable and store it in that. Declare that var outside of any function: private var _sMyString:String; then in completeHandler(): _sMyString = event.target.data.resultCode; Now you can access that value from most anywhere. That warning is from the function declaration: public function postData(){ To fix it do: public function postData():void{ This declares the return type of the function to be "void" Tracy _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Steve Good Sent: Wednesday, April 23, 2008 2:10 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] newbie question Sorry about the subject, I'm not sure why I didn't use something more descriptive. Here's a snippet of the code I'm using. public function postData(){ var urlData:String = "foo=bar"; trace(urlData); var variables:URLVariables = new URLVariables(urlData); var request:URLRequest = new URLRequest(); request.url = "http://domain.com/remoteScript.cfm";; request.method = URLRequestMethod.POST; request.data = variables; var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.VARIABLES; loader.addEventListener(Event.COMPLETE, completeHandler); try { loader.load(request); } catch (error:Error) { trace("Unable to load URL"); } function completeHandler(event:Event):void { trace(event.target.data.resultCode); } } I don't know if this is the best way to do this, I just copied and modified one of the examples at http://livedocs.adobe.com/flex/3/html/help.html?content=17_Networking_and_co mmunications_3.html The string I'm trying to get is in the last trace, resultCode. FB3 does show a warning about the function. "-1008: return value for function 'postData' has no type declaration." I don't have a clue what this means. I have a Flex 3 book on order, so hopefully I can bring my dumb questions down to a minimum once I get my hands on it. Thanks! ~Steve http://lanctr.com/ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Wednesday, April 23, 2008 1:06 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] newbie question Welcome, Steve. First, please use a descriptive subject for all posts, including "AIR", if you think that might be signficant. There is too much traffic on this list for anyone to read all posts, so we choose what to read based on the subject. Subjects like "HELP ME!!!" and "URGENT!!!", and even "Newbie Question" stand a good chance of being skipped. Now, for your question, I do not use AIR much yet, but generally, you need to use a result handler on your data call. That function will be called when your data returns, and you can then do whatever you need with it. Are you using RemoteObject to make the call? All the of the RPC protocols support the result event. Tracy _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Steve Good Sent: Wednesday, April 23, 2008 1:44 PM To: flexcoders Subject: [flexcoders] newbie question Let me start by saying that I am completely new to Flex and obviously the list. I'll apologize upfront for asking the dumb and obvious questions, but I'm still going to ask them :P So here's a description of what I'm doing and my question. I built an Air app with Flex 3 that posts some form data to a remote cfm file. The cfm file then returns a string. If I watch the app running in the Flex Builder 3 debug perspective I can see the string that's returned. My question is this. How do I get that st
[flexcoders] Flex 3 / AIR: using timers and binding data to text
I'm trying to make a call to a remote script at regular intervals. I can get it to make the calls, but I can't figure out how to apply a timer to the second call. I thought I had figured out how to bind the data to a text object, but I'm not getting any results displayed. Here's a sample of the code. http://domain.com/dir/script1.cfm"; result="getCallID(event)"/> http://domain.com/dir/script2.cfm"; result="showStatus(event)"/> Also, the mx:text is giving this warning: "Data binding will not be able to detect assignments to "callStatus"." Any help is greatly appreciated. Thanks! ~Steve http://lanctr.com/
[flexcoders] Flex 3 / AIR: Creating a Timer and binding Text
(I sent this earlier, but it never made it through, so I apologize if it ends up being a double post) I'm trying to make a call to a remote script at regular intervals. I can get it to make the calls, but I can't figure out how to apply a timer to the second call. I thought I had figured out how to bind the data to a text object, but I'm not getting any results displayed. Here's a sample of the code. http://domain.com/dir/script1.cfm"; result="getCallID(event)"/> http://domain.com/dir/script2.cfm"; result="showStatus(event)"/> Also, the mx:text is giving this warning: "Data binding will not be able to detect assignments to "callStatus"." Any help is greatly appreciated. Thanks! ~Steve http://lanctr.com/ ~Steve http://lanctr.com/
RE: [flexcoders] Flex 3 / AIR: Creating a Timer and binding Text
I think I understand, but would love to see an example if you have one. So far I'm really digging working with Flex. -- ~Steve http://lanctr.com/ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Wednesday, April 23, 2008 10:51 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Flex 3 / AIR: Creating a Timer and binding Text Also (gratuitous advice, not related to your problem) , you can use a single HTTPService instance and a single result handler for all calls. Send() returns an AsyncToken, which is a dynamic object that is associated with the specific send call, to which you can add any properties that you want. You can include functions if you want, but I usually just send a couple string parameters, on that indicates an id for the call, and an optional one that indicates special processing. In the result handler, you can access the AsyncToken using event.token, then access the values stored in you properties. I use a switch statement to determine what to do with any given result. So all results are in one place. It makes it easy to chain calls, and to maintain that chain. If you are interested, I can post some sample code. Tracy _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Andrew D. Goodfellow Sent: Wednesday, April 23, 2008 10:07 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Flex 3 / AIR: Creating a Timer and binding Text Hi Steve, You need a [Bindable] meta tag in front of every property you need to be bindable. You only have it on callID, not callStatus. -Andy On 4/23/08, Steve Good <[EMAIL PROTECTED] <mailto:sgood%40lanctr.com> > wrote: > (I sent this earlier, but it never made it through, so I apologize if it > ends up being a double post) > > > > I'm trying to make a call to a remote script at regular intervals. I can > get it to make the calls, but I can't figure out how to apply a timer to the > second call. I thought I had figured out how to bind the data to a text > object, but I'm not getting any results displayed. Here's a sample of the > code. > > > > http://domain.com/dir/script1.cfm"; > result="getCallID(event)"/> > > url="http://domain.com/dir/script2.cfm"; result="showStatus(event)"/> > > > > > > > > > > > > > > > > > > > > > > > > Also, the mx:text is giving this warning: "Data binding will not be able to > detect assignments to "callStatus"." > > > > Any help is greatly appreciated. > > > > Thanks! > > > > ~Steve > > http://lanctr.com/ > > > > > > > > ~Steve > > http://lanctr.com/ > > > >
RE: [flexcoders] Flex 3 / AIR: Creating a Timer and binding Text
Thanks for the info. Any ideas on setting up a timer, or did I do it right? ~Steve http://lanctr.com From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Andrew D. Goodfellow Sent: Wednesday, April 23, 2008 9:07 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Flex 3 / AIR: Creating a Timer and binding Text Hi Steve, You need a [Bindable] meta tag in front of every property you need to be bindable. You only have it on callID, not callStatus. -Andy On 4/23/08, Steve Good <[EMAIL PROTECTED] <mailto:sgood%40lanctr.com> > wrote: > (I sent this earlier, but it never made it through, so I apologize if it > ends up being a double post) > > > > I'm trying to make a call to a remote script at regular intervals. I can > get it to make the calls, but I can't figure out how to apply a timer to the > second call. I thought I had figured out how to bind the data to a text > object, but I'm not getting any results displayed. Here's a sample of the > code. > > > > http://domain.com/dir/script1.cfm"; > result="getCallID(event)"/> > > url="http://domain.com/dir/script2.cfm"; result="showStatus(event)"/> > > > > > > > > > > > > > > > > > > > > > > > > Also, the mx:text is giving this warning: "Data binding will not be able to > detect assignments to "callStatus"." > > > > Any help is greatly appreciated. > > > > Thanks! > > > > ~Steve > > http://lanctr.com/ > > > > > > > > ~Steve > > http://lanctr.com/ > > > >
[flexcoders] [Bindable] variables
While doing the examples out of my Flex 3 book I had a question that, as far as I can tell, isn't covered by the book. Is there any difference between the following two declarations? [Bindable] private var foo:String; OR [Bindable] private var foo:String; Thanks! ~Steve http://lanctr.com/
RE: [flexcoders] [Bindable] variables
Cool, thanks! ~Steve http://lanctr.com/ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Douglas Knudsen Sent: Sunday, May 04, 2008 8:30 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] [Bindable] variables Nope, only visually different. DK On 5/3/08, Steve Good <[EMAIL PROTECTED] <mailto:sgood%40lanctr.com> > wrote: > While doing the examples out of my Flex 3 book I had a question that, as far > as I can tell, isn't covered by the book. Is there any difference between > the following two declarations? > > > > [Bindable] > > private var foo:String; > > > > OR > > > > [Bindable] private var foo:String; > > > > > > Thanks! > > > > ~Steve > > http://lanctr.com/ > > > > -- Sent from Gmail for mobile | mobile.google.com Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
[flexcoders] Posting XML to an HTTPService
I ran across an article explaining how to do this a while back when I was trying to figure out how to post form data to a remote object. Since then I've forgotten what my old search terms were that I used to find this info. Does anyone have an example of how I would post an XML packet to an HTTPService? Thanks! -- Steve Good http://lanctr.com/
[flexcoders] XMLRPC for Actionscript
Looking for clear documentation / examples on how to use XMLRPC for Actionscript. Anyone have any links? I'm reading through the comments in the source, but it's just not sinking in. Thanks! -- Steve Good http://lanctr.com/