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: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of flexnubslice
Sent: Friday, November 30, 2007 2:57 PM
To: [email protected]
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