>  HTTPService.url isn't marked [Bindable]. 
 
Alex, your code
 
    <mx:HTTPService ...  url= "{scrmurl}xmlrpc/request.php" ... />

should have generated a binding warning. Do you have them turned off?
 
- Gordon

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Peter Farland
Sent: Friday, November 30, 2007 3:26 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Registering flashvar variables properly?



Right, HTTPService.url isn't marked [Bindable]. Programmatically
updating it as needed should work, as Tracy mentioned.

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Gordon Smith
Sent: Friday, November 30, 2007 6:13 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Registering flashvar variables properly?


> I had to finally resort to giving the HTTPService object an id
 
The HTTPService object already had id="contactform".
 
> and adjusting that object's ID inside of the initialize block. 
 
Do you mean adjusting the HTTPService's 'url' property?
 
- Gordon

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Lex
Sent: Friday, November 30, 2007 2:26 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Registering flashvar variables properly?



Whatever I tried, it just wouldn't work.
 
I had to finally resort to giving the HTTPService object an id, and
adjusting that object's ID inside of the initialize block.  Doing that,
worked.  Setting the HTTPService url to the bindable var inside of the
XML markup, was a no-go.
 
 
 
 

        ----- Original Message ----- 
        From: Tracy Spratt <mailto:[EMAIL PROTECTED]>  
        To: flexcoders@yahoogroups.com
<mailto:flexcoders@yahoogroups.com>  
        Sent: Friday, November 30, 2007 5:23 PM
        Subject: RE: [flexcoders] Registering flashvar variables
properly?


        

        Oops, missed that, but of course, otherwise "this[i] =" would
have errored, since Application is not dynamic.

        

        Thanks' for the correction, Gordon, and never-mind, Alex.

        

        So, Alex, this: "url= "{scrmurl}xmlrpc/request.php"  should
work.  How about when you do your send(), you verify scrmurl has the
string in it?

        

        You might also try a different style of binding/assignment:

        url= "{scrmurl + 'xmlrpc/request.php'}"

        

        Tracy

        

        

        
________________________________


        From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Gordon Smith
        Sent: Friday, November 30, 2007 4:40 PM
        To: flexcoders@yahoogroups.com
        Subject: RE: [flexcoders] Registering flashvar variables
properly?

        

        scrmurl isn't a dynamic property.. it's declared at compile time
as a public var, and should be bindable. 

        

        - Gordon

        

        
________________________________


        From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt
        Sent: Friday, November 30, 2007 12:23 PM
        To: flexcoders@yahoogroups.com
        Subject: RE: [flexcoders] Registering flashvar variables
properly?

        You won't be able to {bind} to dynamically created properties
easily.  There may be a way to set up a binding using AS, not sure.  

        You could just set the url directly in initApp().

        Tracy

        
        
________________________________


        From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of flexnubslice
        Sent: Friday, November 30, 2007 2:57 PM
        To: flexcoders@yahoogroups.com
        Subject: [flexcoders] Registering flashvar variables properly?

        Hi,
        
           I'm busting my head against the wall on this one, I have to
say that Flex is pretty frustrating when you otherwise code C++ or Java
by trade.
        
           Poking around, I have found how to pass variables into Flex
apps using flashvars.  If I check the Application.application.parameters
value, they are all there.  So far so good.
        
           What I need to do, is pass a proxy URL from HTML, into Flex,
that will be used as a url parameter for an HTTPService.
        
        I have for example:
        
        <?xml version="1.0" encoding="utf-8"?>
        <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
            layout="absolute" height="380" width="450" alpha="1.0"
initialize="initApp();">
        
            <mx:Script>
                <![CDATA[
        
            [Bindable]
            public var scrmurl:String;
        
            private function initApp():void{
                        var elements:Array = [ "scrmurl" ]; // there's
quite a few of these..
        
                        for( var i:String in elements ){            
                            if( Application.application.parameters[i] )

                                this[i] =
Application.application.parameters[i];
                        }    
            }
                ]]>
            </mx:Script>
        
        <mx:HTTPService
                contentType="application/x-www-form-urlencoded"
                id="contactform"
                method="POST"
                resultFormat="e4x"
                showBusyCursor="true"
                url= "{scrmurl}xmlrpc/request.php"
                useProxy="false"        
                fault="handleFault( event )"
                result="handleResult( event )"
        />
        
        
        The idea is to pass in scrmurl, ie http://yourdomain.com/  and
the URL in HTTPService then becomes:
        http://yourdomain.com/xmlrpc/request.php
        
        Why won't they HTTPService then, acknowledge the scrmurl
variable?  When it posts, it only posts to xmlrpc/request.php, as though
the parameter is being completely ignored..
        
        Thanks!
        Alex

        

        

 

Reply via email to