Variables in Adobe Flex
I'm tyring to use a variable that I declare in my CDATA later on in my flex document. How can I manipulate "userid" in the CDATA and also send it off in the later HTTPService code?
<fx:Style source="felxible_1.css"/>
<fx:Script>
<![CDATA[
public var userid:String;
]]>
</fx:Script>
<fx:Declarations>
<mx:HTTPService
id="fetch_list_1"
result="listfetched1(event)"开发者_C百科
method="POST"
url="find_data_1.php"
useProxy="false">
<mx:request xmlns="">
<userid>userid</userid>
</mx:request>
</mx:HTTPService>
</fx:Declarations>
You need to use the "binding" syntax. In your script, make the variable send update messages when you change it:
[Bindable] var userid:String;
Then, in the markup, tell the userid
tag to update when the variable changes.
<userid>{userid}</userid>
精彩评论