Button Problem

I am very new to flash. I created a forms application and places some buttons on the application screen. I named them home_btn and search_btn. The problem is when I click on them they should take me to Home and ShowSearchMenu.

I assigned Behaviors for them. The home button click event goes to slide Home and the Search button click event goes to slide ShowSearchMenu.

Any idea of why they wouldn't work? I just threw this app together. I am working on moving over to ColdFusion/ASP.net backend with a Flash front end.
JoshDaleAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JoshDaleAuthor Commented:
If you would like to take a look at this app, I can put it up on a ftp site.
0
JoshDaleAuthor Commented:
http://www.pcfloans.com/testapp
It is the Document Management.fla file
0
blue-genieCommented:
Hi.
From what I can see, your problem lies in the following:

if (screen instanceof mx.screens.Slide) {

you define var screen = null - but you've not specified a datatype for screen, if you comment out your if statement, it loads the slides, as I see it, the screen is not of type Slide so um... never true, thus button appears not to work.

blu.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

JoshDaleAuthor Commented:
Still doesn't work. Keep in mind I created this application in Flash MX 2004 Professional and that the code generated was not written by hand.
0
blue-genieCommented:
what do you mean by that?
0
JoshDaleAuthor Commented:
I created the button then I clicked on it, went to the behaviors pannel, clicked the plus sign, clicked screen, clicked go to slide, selected the slide home and clicked ok.
That is the process I went through creating the button.
0
blue-genieCommented:
Personally, i don't use slides or behaviours, so i'm not very clued up on those, but i just opened your example. I gave it a go, and I used the "show screen" behaviour rather than the go to behaviour and it works.

so try that.
0
JoshDaleAuthor Commented:
Yea, the only problem is, when I click a button and then another button, the content from the button before is still displayed.
0
blue-genieCommented:
why dont' u write your own code,
when a button is pressed, check if the destination screen is the current one, if yes do nothing, else hide current screen and show new one.
0
JoshDaleAuthor Commented:
I am new to doing this, the way I learned was using behaviours and having flash do the rest.
0
blue-genieCommented:
maybe someone with experience with behaviours can help you out then

sorry.
0
JoshDaleAuthor Commented:
Thanks
0
badrulnmCommented:
Hi Josh,

Slide behavior won't work since you're using a form application. You can try this script:

For home_btn:

on (click) {
      _parent.Search.visible = false;      
      _parent.Home.visible = true;
}

For search_btn:

on (click) {
      _parent.Home.visible = false;
      _parent.Search.visible = true;
      _parent.Search.ShowSearchMenu.visible = true;
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JoshDaleAuthor Commented:
Ok, that works. There is one problem though, I stuck the navigation on the application screen, how can I set visible = false; for all layers but the one triggered? Do I manually have to put visible = false; for every layer?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.