Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling a function from within function

Status
Not open for further replies.

tomhughes

Vendor
Aug 8, 2001
233
US
Is there any way to call a function from within a function?

***************************************************

Here is the Function I am calling from:

SET.onRelease = function() {
in1_txt.text = "C";
in2_txt.text = "F";
in3_txt.text = "G";
OUT1.text = "C";
OUT2.text = "F";
OUT3.text = "G";
varKeyShift = 0;
this._parent.varShow = "SET.onRelease";
Output_Key(); // Here is the Function call
};

****************************************

Here is the function I am calling:

function Output_Key() {

this._parent.var1 = 1;

}

*******************************************

I have an Input Text with Variable Name "var1"

but var1 shows no value when clip is run
 
I inserted the filespec into the "Step3 Attachment" box. I don't know if that will attach the file or not.
 
Well that didn't work, so here is the file.


Code:
Init.onRelease = function() {
	in1_txt.text = "C";
	in2_txt.text = "F";
	in3_txt.text = "G";
	in4_txt.text = "A";	
	OUT1.text = "C";
	OUT2.text = "F";
	OUT3.text = "G";
	OUT4.text = "A";	
	Output_Key();
};

function Output_Key() {
	for (m=1; m<=4; m++) {
	this._parent["var"+m] = (this._parent["Out"+m].text);
	}
}
Set.onRelease = function() {
	for (m=1; m<=4; m++) {
	this._parent["var"+m] = (this._parent["Out"+m].text);
	}
}

Set1.onRelease = function() {
	for (m=1; m<=4; m++) {
	this._parent["var"+m] = m;
	}
}
 
Init.onRelease = function() {
in1_txt.text = "C";
in2_txt.text = "F";
in3_txt.text = "G";
in4_txt.text = "A";
OUT1.text = "C";
OUT2.text = "F";
OUT3.text = "G";
OUT4.text = "A";
Output_Key();
};

function Output_Key() {
for (m=1; m<=4; m++) {
this["var"+m] = (this["OUT"+m].text);
}
}

Watch the caps of your variables... You ere using "Out" while the actual names are all caps as "OUT"...

Regards. FLASH HELP - OPENED FOR BUSINESS!
TO GET YOUR OWN FREE WEBSITE HOSTING
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top