Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 Flex Coldfusion可变交叉总体_Actionscript 3_Apache Flex_Coldfusion_Coldfusion 9_Flex4.6 - Fatal编程技术网

Actionscript 3 Flex Coldfusion可变交叉总体

Actionscript 3 Flex Coldfusion可变交叉总体,actionscript-3,apache-flex,coldfusion,coldfusion-9,flex4.6,Actionscript 3,Apache Flex,Coldfusion,Coldfusion 9,Flex4.6,我正在使用Coldfusion将Flex4.6表单连接到SQLServer2008。当我的表单提交到DB时,我发现我的变量正在交叉,我似乎看不到导致它的问题: Flex远程对象调用: private function RegisterNewEmployee():void{ //remote object and method instantiated roCreateNewUser.createNewEmployeeProfile(fm_userName.text,

我正在使用Coldfusion将Flex4.6表单连接到SQLServer2008。当我的表单提交到DB时,我发现我的变量正在交叉,我似乎看不到导致它的问题:

Flex远程对象调用:

private function RegisterNewEmployee():void{
    //remote object and method instantiated 
    roCreateNewUser.createNewEmployeeProfile(fm_userName.text, 
    fm_password.text, fm_accessLevel.selectedItem, fm_emailAddress.text, 
    fm_domainField.selectedItem ); 
}
<cfargument name="fm_accessLevel" type="any" default="1"> 
<cfargument name="fm_emailAddress" type="any" default="user01"> 
<cfargument name="fm_domainField" type="any" default="aaa.com"> 
<!--- Concatenate email and domain --->
<cfset emailString = #arguments.fm_emailAddress# & "@" & #arguments.fm_domainField# >
柔性组件

<mx:FormItem label="Access Level:" width="182" color="#FFFFFF" required="false">
    <s:DropDownList width="60" color="#FFFFFF" id="fm_accessLevel">
        <s:dataProvider>
            <mx:ArrayList id="accessLevelList">
                <fx:String>9</fx:String>
                <fx:String>44</fx:String>
            </mx:ArrayList>
        </s:dataProvider>
    </s:DropDownList>
</mx:FormItem>
<mx:FormItem label="Email: " fontSize="12" width="173" horizontalAlign="left" color="#FFFFFF" required="false"><s:TextInput color="#000000" id="fm_emailAddress" text="{fm_userName.text}" />
</mx:FormItem><s:Label text="@&#xd;&#xd;&#xd;" fontSize="14" width="15" height="21" color="#FEFEFE" />
<s:ComboBox color="#FFFFFF" id="fm_domainField" height="22" enabled="true">
    <s:dataProvider>
        <mx:ArrayList id="domainList">
            <fx:String>aaa.com</fx:String>
            <fx:String>bbb.com</fx:String>
            <fx:String>ccc.com</fx:String>
        </mx:ArrayList>
    </s:dataProvider>
</s:ComboBox>

9
44
aaa.com
bbb.com
ccc.com
Coldfusion代码:

private function RegisterNewEmployee():void{
    //remote object and method instantiated 
    roCreateNewUser.createNewEmployeeProfile(fm_userName.text, 
    fm_password.text, fm_accessLevel.selectedItem, fm_emailAddress.text, 
    fm_domainField.selectedItem ); 
}
<cfargument name="fm_accessLevel" type="any" default="1"> 
<cfargument name="fm_emailAddress" type="any" default="user01"> 
<cfargument name="fm_domainField" type="any" default="aaa.com"> 
<!--- Concatenate email and domain --->
<cfset emailString = #arguments.fm_emailAddress# & "@" & #arguments.fm_domainField# >

问题从这里开始:

private function RegisterNewEmployee():void{
    //remote object and method instantiated 
    roCreateNewUser.createNewEmployeeProfile(fm_userName.text, 
    fm_password.text, fm_accessLevel.selectedItem, fm_emailAddress.text, 
    fm_domainField.selectedItem ); 
}
<cfargument name="fm_accessLevel" type="any" default="1"> 
<cfargument name="fm_emailAddress" type="any" default="user01"> 
<cfargument name="fm_domainField" type="any" default="aaa.com"> 
<!--- Concatenate email and domain --->
<cfset emailString = #arguments.fm_emailAddress# & "@" & #arguments.fm_domainField# >

不知何故,连接的结果返回的是

<cfset emailString = #arguments.accessLevel# & "@" & #arguments.emailAddress# >
or **44@MyUserName** in plain text output

或**44@MyUserName**在纯文本输出中
代码中有任何值得注意的问题会导致这种情况吗?它以前在没有任何限制的情况下工作
问题缓存和浏览器历史记录已清除,问题仍然存在。

以前工作正常,没有问题发生了什么变化?它是每次都发生,还是只是偶尔发生?如果是零星的,
emailString
变量VAR/LOCAL作用域是否在函数内部?如果不是,可能是典型的比赛条件。局部作用域该变量和任何其他函数局部变量将修复它。从代码角度看,没有任何更改。发生的情况是,有时它会在userName处呈现accessLevel值,有时它会在userName@accessLevel值处呈现accessLevel值。它甚至以某种方式抛出了一个变量参数.position@accessLevel。它只是表现得很不真实。(编辑)好吧,就像我上面说的,如果它是零星的,那可能是一种种族状况。变量是否本地化?此外,您是否记录了流程中每个点的值,以确定流程中的哪些地方出现故障?如果函数未接收到正确的值,则表明存在Flex问题。如果函数确实接收到正确的值,但只有串联错误,则表明函数代码中存在问题。变量被本地化为函数。当我使用.cfm页面来转储变量并完成连接时,我的函数没有出现问题。当它从flex传递到CF时,值是正确的。然而,一旦这些值进入DB表,我就发现变量以某种方式错误了,并且没有按照上面的代码所读的那样进行操作。对于零星错误,您需要一直记录,直到错误再次发生,才能准确地知道哪里出了问题。如果所有函数变量都已正确本地化,听起来应该可以工作,但是。。。很明显,有些事情和你想象的不一样。在每个步骤中添加详细的日志记录将精确指出应用程序中出现问题的地方,如Flex、CF或SQL。