pheromix
pheromix

Reputation: 19347

How to use an actioscript static member from a flex tag?

I am developping a mobile flex project. I created an actionscript class :

package
{
    import flash.net.SharedObject;
    public class Config
    {
        public static var config_so:SharedObject;
        public static var db_so:SharedObject;
        public function Config()
        {
        }
    }
}

Then I set data to the sharedobject in a view :

Config.config_so.data.url = url.text;
Config.config_so.flush();

Now I want to use this sharedobject parameter data inside the parameter value of a HTTPService item : <mx:HTTPService id="userRequest" url="here_the_sharedobject_param_value/crr.php" resultFormat="text" ... />

So how to call ( get ) the sharedobject param value inside the url param value of the HTTPService item ?

Upvotes: 0

Views: 98

Answers (1)

Gio
Gio

Reputation: 1954

Try out the Flex data binding, like this:

<mx:HTTPService id="userRequest" url="{ Config.config_so.data.url + '/crr.php'}" resultFormat="text" ... />

Upvotes: 1

Related Questions