Copy link to clipboard
Copied
Hi,
Im doing a project for uni and trying to create a search bar throughout the flash document for people to find what they are looking for.
Followed a tutorial online step by step and then i get this error. #1065 variable TCMText is not defined.
I'm really a beginner, any help would be so greatly appreciated!
stop();
var i:int = 0;
var names:Array = new Array("Annual Report","annual report");
var frames:Array = new Array("2","2");
text_in = "..."; /*what is wrong with you */
searchbutton.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
findInArray(text_in.text);
gotoAndStop(frames);
}
function findInArray(str:String):int
{
for(i = 0; i < names.length; i++)
{
if(names == str)
{
return i;
}
}
return 0;
}
it says the issue is on line 7 where i have commented out "what is wrong with you"!
Ive read a lot of things online and i have got it as classic text, which everyone is telling them to do. So quite confused.
If you can, please help me.
Thanks!!!
Copy link to clipboard
Copied
For the line in question, I would say the problem is that you have a String variable that you have not declared (as in: var text_in:String; ). But I don't think that is the line 7 the error is pointing to. If you are using any components in your design then that might be where the problem is coming from. If you show the complete error it might prove helpful.
Copy link to clipboard
Copied
Sorry for a delay in reply.
Here is what the error says...
ReferenceError: Error #1065: Variable TCMText is not defined.
Scene 1, Layer 'Actions', Frame 1, Line 7 | 1067: Implicit coercion of a value of type String to an unrelated type flash.text:TextField. |
If you could help in away that would be great cheers!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now