Why loadVars doesn't work?

Hello, I have asp page to retrieve back the info from database. And use flash to reload the datas and show the info.

I can see all the variables and value on the asp page, but don’t understand why nothing shown on the flash page using
myData = new LoadVars();
myData.source = “cart.asp”
myData.load(myData.source, myData);
myData.onLoad = function() {

}

I wonder whether it is ok that flash page can just load part of the code and show?? Or it should load everthing onto the flashpage??

Thanks !!

You let the most important part of the code out :stuck_out_tongue: Please post the whole code, including the function.

_root.screen.text = myData.textTL_text;
_root.screen._x = myData.xpositionTL_text;
_root.screen._y = myData.ypositionTL_text;
_root.screen._xscale = myData.xscaleTL_text;
_root.screen._yscale = myData.yscaleTL_text;
_root.screen._rotation = myData.rotationTL_text;
leftsformat = new TextFormat();
leftsformat.font = myData.fontTL_text;
leftsformat.color = myData.colorTL_text;
_root.screen.setTextFormat(leftsformat);

_root.mulscreen.text = myData.textTL_multext;
_root.mulscreen._x = myData.xpositionTL_multext;
_root.mulscreen._y = myData.ypositionTL_multext;
_root.mulscreen._xscale = myData.xscaleTL_multext;
_root.mulscreen._yscale = myData.yscaleTL_multext;
_root.mulscreen._rotation = myData.rotationTL_multext;
leftmformat = new TextFormat();
leftmformat.font = myData.fontTL_multext;
leftmformat.color = myData.colorTL_multext;
_root.mulscreen.setTextFormat(leftmformat);
imF = "uploadedimage/"+this.bg_id+"left.jpg";
imgaF = "uploadedimage/"+this.galleryLTL_pic;
_root.imagemc.loadMovie(imF);
_root.gallery.loadMovie(imgaF);
_root.gallery._rotation=_root.leftrotationgl;

And screen, mulscreen are two textfields, gallery is the movieclip

[AS]
myData = new LoadVars();
myData.source = "cart.asp"
myData.onLoad = function() {
_root.screen.text = this.textTL_text;
_root.screen._x = this.xpositionTL_text;
_root.screen._y = this.ypositionTL_text;
_root.screen._xscale = this.xscaleTL_text;
_root.screen._yscale = this.yscaleTL_text;
_root.screen._rotation = this.rotationTL_text;
leftsformat = new TextFormat();
leftsformat.font = this.fontTL_text;
leftsformat.color = this.colorTL_text;
_root.screen.setTextFormat(leftsformat);

_root.mulscreen.text = this.textTL_multext;
_root.mulscreen._x = this.xpositionTL_multext;
_root.mulscreen._y = this.ypositionTL_multext;
_root.mulscreen._xscale = this.xscaleTL_multext;
_root.mulscreen._yscale = this.yscaleTL_multext;
_root.mulscreen._rotation = this.rotationTL_multext;
leftmformat = new TextFormat();
leftmformat.font = this.fontTL_multext;
leftmformat.color = this.colorTL_multext;
_root.mulscreen.setTextFormat(leftmformat);
imF = “uploadedimage/”+this.bg_id+“left.jpg”;
imgaF = “uploadedimage/”+this.galleryLTL_pic;
_root.imagemc.loadMovie(imF);
_root.gallery.loadMovie(imgaF);
_root.gallery._rotation=_root.leftrotationgl;
}
myData.load(myData.source, myData);
[/AS]

That should do it. I saw you used myData.variable, I’m not sure if that works (seems not, since it didn’t work for you :P), but I am sure that this.variable works since loadVars is an object. So I changed them all to this.variable.

Is leftrotationgl also a variable from the ASP file ? If so, change _root.leftrotationgl to this.leftrotationgl.

Remember this thread ?

Hello, I tested it once again, but still it doesn’t work. I have no idea what is wrong. In asp page, the variable are like &a=&b=&
and in flashpage, it is the same as what u said. Then what other possibility of mistake I can made?

Thanks for your code!

Your ASP output should be like this: &textTL_text=This is text loaded from the database through ASP&xpositionTL_text=25&ypositionTL_text=45&xscaleTL_text=102& …

And so on. The values I used (This is text… ,25,45,102) are just examples, they can be any value. If the output is like that it should work. If it still doesn’t work, can I see the FLA and the URL of the script ?

Hello, I am sorry to say at this moment, the link is not active. So I attach the asp and .fla in attachment. Thanks very much for your help and hope you have some good suggestion. Thanks again!

If the link is not active it’s pretty obvious that it doesn’t work. Sorry, my host doesn’t support ASP, so I can’t test it.

Thanks, and could you have a look at the code of cart.txt in my zip file?

Sorry, I know nothing of ASP :frowning: