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/
 


Reply via email to