Help Please, Need to Fix a Code for a Search Feature

Hi

What I need is something like a search feature that works like a shortcut to a specifict scene and frame. When I type a number in the input field and the number is related to a specific scene and frame in the code of the button I should be taken to that specific frame in that specific scene.

This is not a database based search.

The wrong code I have is the following (it is the code of the button that triggers the search):

on (release) {
if (searchinput=123456) {
gotoAndPlay(“Scene 2”, 1);
} else {
gotoAndPlay(“Scene 3”, 1);
}
}

*“searchinput” is the instance name of the input text box

What I’m trying to state with this code is:

On release of the mouse button
if the value entered in the input text box is equal to 123456
go to and play scene 2 frame 1,
else (other value or no value)
go to and play scene 3 frame 1

I think the error is the line that says: if (searchinput=123456) { because I don’t know exactly how to state the relation between the value entered in the input text field and the number 123456.

I’m including a file called TestSearchForm.fla, it have what I have done and it may help you figure what I mean.

If you can help me please reply, I really need someone to help me, thanks for your time, bye.

daghost

:hair:

if(searchinput == 12345)

you have to have two == not one.

I looked at your file. change this:


	if ("number="+123456) {

to


	if (number==123456) {

and that worked for me.

Hi.

IT WORKED! thanks a lot Jubba.

daghost

:hair: