Google Answers Logo
View Question
 
Q: Flash Actionscript Debugging Help ( No Answer,   1 Comment )
Question  
Subject: Flash Actionscript Debugging Help
Category: Computers > Software
Asked by: g8z-ga
List Price: $5.00
Posted: 19 Jan 2003 11:38 PST
Expires: 11 Feb 2003 12:08 PST
Question ID: 145592
Hi, I have a class that looks like this:

Connection = function( myForm ) 
{	
	this.phpUrl;
	this.fields;
}

Connection.prototype.getFieldList = function( table )
{
	sender = new LoadVars();
	loader = new LoadVars();
	
	sender.table = table;

	sender.sendAndLoad(this.phpUrl, loader);
	loader.onLoad = this.parseLoadResult;
}

Connection.prototype.parseLoadResult = function( success )
{
	if (success) 
	{
		this.fields = unescape(this);
		
		trace( this.fields );	// gives me correct trace results
	} 
}


And I'm using the class in this way:

c = new Connection();
c.phpUrl = "http://www.somedomain.com/php/somescript.php";
c.getFieldList( "test_table" );

trace( c.fields );  // this gives "undefined"


In other words, when I call trace( this.fields ) inside of the
parseLoadResult function, I get the correct value. However, when I try
to access the fields variable of the Connection object 'c' (c.fields),
I get an incorrect result. I'm fairly experienced at Flash
Actionscripting, but I have never used the sendAndLoad method. I have
used loadVariables in the past. I suspect some scoping issue that I
can't see. Could you guide me in the right direction?
Answer  
There is no answer at this time.

Comments  
Subject: Re: Flash Actionscript Debugging Help
From: functionifelse-ga on 11 Feb 2003 01:55 PST
 
Classes are prehaps the MOST confuzing thing ever to me.
I mean i've read and read and then again read about them
but i just cant get it through.. especialy this one.. in
the c++ book it made a little more sense but i never really
needed to use then.. i have always been happy with the way
i do things... anyways.. i think the problem is this..

ensted of
trace( c.fields );

make it

c.trace(fields);

i dunno.. try that or just figure another way to do it.. i belive
object oriented programing is the worst idea since... ummmm something
bad.. anyways :-P maybe that will help you out some.. but i think that
will work... how do i get money.. is this real money?

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy