I send a userId to my application to display a linechart with the application.parameter object. I get the userId parameter inside my application and can trace or alert it and I see the userId on my screen. Ok everything is working fine for now. Then I want to use the userId to call php function. And there is where it breaks. Somehow the userId parameter is empty.
example:
private var userId:int = 1234;
private function init():void{
this.userId = Application.application.parameters.userId;
}
for this example I set a default value of 1234 and on creationComplete the userId is set with the real userId value, lets say that the userId in parameters is 1. If I trace the userId inside the application after the init() it returns 1. That is normal. But if I now call the remoteObject:
{this.userId}
With this call the php function receives a userId with 1234. Very strange because we already set that with an other number.
solution for me
I tried a lot of different ways to fix this problem and now I finally found a solution. I set the value of the userId parameter inside a invisible label. And use that label to send the userId back to php.
this.userIdLabel.text =(this.userId).toString();
and in the remoteObject:
{int(this.userIdLabel.text)}
Leave a Reply to Zjéraar Cancel reply