RE: [flexcoders] passing variables using getURL?
If I understand you correctly, then no, getURL does not pass all variables if you make a call using the javascript: pseudo-protocol syntax because it's not generating the same kind of request. --- Example 1. function reportEvent(e) { var eType = e.type; var eName = e.target.id; var url = javascript:catchClick(' + eName + ',' + eType + '); getURL(url); } Here, getURL only passes the two variables to a specific JavaScript function (in this case, catchClick()) in the wrapper because it's using only javascript on the current page, so no request headers (read: no GET or POST) are being set: --- Example 2. var url; function google() { url = http://www.google.com/search?hl=enq=; + ta1.text; getURL(url,_blank,GET); } Here, getURL passes all of the root application's properties as well as global variables (including the value of url) to the resulting page as a GET request. If you look at the request string, you'll see a lot of the app's properties: http://www.google.com/search?hl=enq=fredhistoryUrl=%2Fflex%2Fflex%2Din ternal%3Faction%3Dhistory%5Fhtmllconid=d357liblist=sizelist=preloadO bj=%5Bobject+Object%5Dwidth=undefinedheight=undefinednestLevel=0focu sManager=%5Flevel0%2EfocusManagertabChildren=truetabEnabled=false ... [snip] --- Example 3. function queryGoogle() { var query = createEmptyMovieClip(null,0); url = http://www.google.com/search?hl=enq=; + ta1.text; query.getURL(url,_blank,GET); } Here, getURL only invokes the GET request with the raw url string. There are no properties of the movieclip to add on since we create an empty movieclip and invoke getURL off of that. --- HTH, Matt Horn Flex docs From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Friday, May 20, 2005 3:40 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] passing variables using getURL? Does this only apply if the url is external? Do we get anything if we use getURL to call a javascript function in our html wrapper? I have been building delimited strings to pass arguments up to the wrapper. Is there a better way? Tracy -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Abdul Qabiz Sent: Friday, May 20, 2005 12:34 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] passing variables using getURL? Hi, You can pass variable to external script using getURL(...), getURL(..) sends all variable declared in current scope. Infact getURL(..) sends all variable declared, that means it sends unwanted stuff also. But I think, you can use LoadVars object for such kind of work. LoadVars gives more control and looks more clean. I am not sure why you launching external page and passing variable, but following example might help you. ##LoadVarsExample.mxml## mx:Application width=800 height=600 xmlns:mx=http://www.macromedia.com/2003/mxml; mx:Script ![CDATA[ function sendVars() { //create LoadVars instance var _lv:LoadVars = new LoadVars(); //create properties _lv.name = Abdul; _lv.age = 24; _lv.send(http://localhost/echo.asp,_blank;, GET); } ]] /mx:Script mx:Button label=Send Vars click=sendVars()/ /mx:Application More about LoadVars: http://www.macromedia.com/support/flash/action_scripts/actionscript_dict iona ry/actionscript_dictionary427.html Hope that helps... -abdul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of sbyrne_dorado Sent: Friday, May 20, 2005 4:06 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] passing variables using getURL? I'm having problems figuring out how to pass variables using getURL. The documentation that I can find seems to indicate that any random variable that you declare that's in some (unspecified) scope, will be appended (for GET) or passed (for POST) as parameters along with the URL. So I have tried setting some typed local variables and invoking
Re: [flexcoders] passing variables using getURL?
Abdul Qabiz wrote: No we don't get anything back if invoke JavaScript function using getURL(..). But you can do something similar, as described below: For what it's worth, some of the various browsers *did* return JavaScript values to plugins after receiving a javascript: pseudo-URL. I haven't tested whether any of the current browsers work like this. But like all that underdocumented stuff, it worked in some browsers, didn't work in others, and was subject to side-effects in many cases (didn't work with WMODE on, etc). Some of the browsers *do* offer a documented, tested, and supported plugin/browser intercommunication scheme, and where such an ability is offered the Macromedia Flash Player has exploited it, under the general FSCommand interface. I see lots of people continue to promote javascript: pseudo-URLs and this worries me, just because of the great variability of browser support for this ability. jd -- John Dowdell . Macromedia Developer Support . San Francisco CA USA Weblog: http://www.macromedia.com/go/blog_jd Aggregator: http://www.macromedia.com/go/weblogs Technotes: http://www.macromedia.com/support/ Spam killed my private email -- public record is best, thanks. Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] passing variables using getURL?
Interesting. Most of the examples I see use getURL. Even Cristophe's HTML-InIFrame-Over-Flex solution has the fscommand lines commented out and is using getURL! So far, we have been able to control the browser, but are there any other advantages? Tracy -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of John Dowdell Sent: Friday, May 20, 2005 4:38 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] passing variables using getURL? Abdul Qabiz wrote: No we don't get anything back if invoke JavaScript function using getURL(..). But you can do something similar, as described below: For what it's worth, some of the various browsers *did* return JavaScript values to plugins after receiving a javascript: pseudo-URL. I haven't tested whether any of the current browsers work like this. But like all that underdocumented stuff, it worked in some browsers, didn't work in others, and was subject to side-effects in many cases (didn't work with WMODE on, etc). Some of the browsers *do* offer a documented, tested, and supported plugin/browser intercommunication scheme, and where such an ability is offered the Macromedia Flash Player has exploited it, under the general FSCommand interface. I see lots of people continue to promote javascript: pseudo-URLs and this worries me, just because of the great variability of browser support for this ability. jd -- John Dowdell . Macromedia Developer Support . San Francisco CA USA Weblog: http://www.macromedia.com/go/blog_jd Aggregator: http://www.macromedia.com/go/weblogs Technotes: http://www.macromedia.com/support/ Spam killed my private email -- public record is best, thanks. Yahoo! Groups Links Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] passing variables using getURL?
sbyrne_dorado wrote: I'm having problems figuring out how to pass variables using getURL. Pass info from where, to where...? jd -- John Dowdell . Macromedia Developer Support . San Francisco CA USA Weblog: http://www.macromedia.com/go/blog_jd Aggregator: http://www.macromedia.com/go/weblogs Technotes: http://www.macromedia.com/support/ Spam killed my private email -- public record is best, thanks. Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] passing variables using getURL?
Hi, You can pass variable to external script using getURL(...), getURL(..) sends all variable declared in current scope. Infact getURL(..) sends all variable declared, that means it sends unwanted stuff also. But I think, you can use LoadVars object for such kind of work. LoadVars gives more control and looks more clean. I am not sure why you launching external page and passing variable, but following example might help you. ##LoadVarsExample.mxml## mx:Application width=800 height=600 xmlns:mx=http://www.macromedia.com/2003/mxml; mx:Script ![CDATA[ function sendVars() { //create LoadVars instance var _lv:LoadVars = new LoadVars(); //create properties _lv.name = Abdul; _lv.age = 24; _lv.send(http://localhost/echo.asp,_blank;, GET); } ]] /mx:Script mx:Button label=Send Vars click=sendVars()/ /mx:Application More about LoadVars: http://www.macromedia.com/support/flash/action_scripts/actionscript_dictiona ry/actionscript_dictionary427.html Hope that helps... -abdul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of sbyrne_dorado Sent: Friday, May 20, 2005 4:06 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] passing variables using getURL? I'm having problems figuring out how to pass variables using getURL. The documentation that I can find seems to indicate that any random variable that you declare that's in some (unspecified) scope, will be appended (for GET) or passed (for POST) as parameters along with the URL. So I have tried setting some typed local variables and invoking getURL; no luck. No luck with either POST or GET. What's the magic? Do the variables have to be in the top level application? Do they have to be global within the the containing class? Does this functionality even work at all? Yahoo! Groups Links Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/