PDA

View Full Version : LoadVars (driving me crtazy)


lelales
01-17-2007, 02:06 PM
This should be easy because I've done it many times before. But anyway, here it goes. My loadVars traces "done loading" but nothing appears in the text field. Here's my code: PMIBN.onRelease=function()
{

LoadVarsText2 = new LoadVars();
LoadVarsText2.onLoad = function (success)
{
if (success)
{
trace ("done loading");
_root.textMC.textbox1.htmlText = this.about_PMI;
}
else
{
trace ("not loaded");
} // end else if
};
LoadVarsText2.load("http://www.metapps.com/final/textboxload/About_PMI.php");
}

I've also tried: _root.textMC.textbox1.htmlText = this.about_PMI;

no luck. I think it's a targeting issue, but it's so simple, I don't see it. On the main timeline I have a textMC, within the same instance name. And inside of there I have a textbox with the instance name "textbox1." Any ideas?

here's the a link:http://www.metapps.com/final/textboxload/text2.html
here's a link to About_PMI.php: http://www.metapps.com/final/textboxload/About_PMI.php

thanks

CyanBlue
01-17-2007, 02:32 PM
Um... I don't see what that does not work... The only thing that I can think of is the space right after the '='... Can you try removing those spaces???

Also, add trace("this.about_PMI = " + this.about_PMI); after your trace() line and see if you are actually getting that data...

lelales
01-17-2007, 02:40 PM
I followed your instructions and it's tracing the text. But the text doesn't load into textbox1 which is inside of texMC. I've had this problem before but I have forgotten what I did.

thanks

lelales
01-17-2007, 02:51 PM
Here's the problem:
_level0.textMC.textbox1.htmlText= this.about_PMI;
should be
_level0.textMC.textbox1= this.about_PMI;

thanks;)

CyanBlue
01-17-2007, 02:54 PM
Welll... It can be either the problem with the mask or the path issue...

Can you temporarily remove the mask so that we can check if the text loads???

If that does not work, can you add the following lines within the if statement block and let me know what you get???
if (success)
{
trace ("done loading");
// trace ("this.about_PMI = " + this.about_PMI);
trace ("_root.textMC = " + _root.textMC);
trace ("_root.textMC._x = " + _root.textMC._x);
trace ("_root.textMC.textbox1 = " + _root.textMC.textbox1);
trace ("_root.textMC.textbox1._x = " + _root.textMC.textbox1._x);
trace ("_root.textMC.textbox1.htmlText = " + _root.textMC.textbox1.htmlText);
trace ("_root.textMC.textbox1.text = " + _root.textMC.textbox1.text);
_root.textMC.textbox1.htmlText = this.about_PMI;
}