Hi Tracy,

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

No we don't get anything back if invoke JavaScript function using
getURL(..). But you can do something similar, as described below:

- call js function from flex app using getURL(..)
- in return js sets the return value in a variable in flex app.


> I have been building delimited strings to pass arguments up to the
> wrapper.  Is there a better way?

I think, yeah its better way. You can also pass data as xml that can be
parsed in browser, but there is string length limitation in getURL(..), so
less verbose string would be efficient.


I am working on new version JSFCommunicator library(
http://www.abdulqabiz.com/files/JSFC/JSFCommunicator%20Library.htm ). Which
would work with Flex/Flash authored applications. I am thinking to many
things, some of them are:

- An easy and intuitive API to establish two-way connection between Flash
Player & JavaScript. Yeah, it would work with applications authored in Flash
IDE or Flex environment.

- Return values, if you call a JavaScript function from Flex you get the
return value immediately in flex or vice-versa.

- Making it work on most of the browsers and platforms. I will add
intelligent detection which would use JavaScript way or LocalConnection way
depending on browser or platform. I will try to keep things transparent to
library users by keeping interfaces common.


I am going to spend this weekend to make a list of To-Dos for JSFC, I will
appreciate if you can tell me what all you do with Flex/JavaScript, I might
be able to support in next version JSFC..

I hope, I can resolve this issue in JSFC...

Disclaimer: Note JSFC is something I started while back, it is not related
to my employer(Macromedia), that means I am responsible for
everything(support, bugs et al) :)


-abdul





-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Saturday, May 21, 2005 1:10 AM
To: [email protected]
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: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Abdul Qabiz
Sent: Friday, May 20, 2005 12:34 AM
To: [email protected]
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: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of sbyrne_dorado
Sent: Friday, May 20, 2005 4:06 AM
To: [email protected]
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



 






 
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