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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB/Flash help

Status
Not open for further replies.

rds747

Technical User
Mar 8, 2005
180
US
I am using VB6 and Flash8.

I have a text input with instance name: CraneReady and variable name: txtCraneReady. The text of the text input is set as "Test".

The Vb Project has a button that triggers the fscommand and changes the value of the text input to "CraneReady".

Once I get the value CraneReady in the text input, I would like to create a new movie clip. However, the code isn't working accordingly.

Here is the code:
Code:
var txtCraneReady:String = "Test";
fscommand(sVariable, sValue);
if (CraneReady.text == "CRANEREADY")
{
	this.createEmptyMovieClip("Sample_mc", 0);
	//Gantry_mc.loadMovie("Sample.png");
}

Please help!
 
Do an event handler for the change event of the text field. (also BTW you don't need both instance name and variable name on the text field and should use only one. I would recommend instance name).

So it would be something like.

Code:
txtField.onChanged = function(txtField:TextField){
	if (txtField.text == "CraneReady"){
		trace("That's it!");
	}
}

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
I just read in the help section for the onChanged event that it would only be triggered if there was user interaction and not programmatically. This means that I would not be able to use the fscommand that communicates from vb to flash and vice versa.

So if I clicked a button on the vb form, the onChanged event would not fire from Flash?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top