Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Button Problem

Posted on 2004-10-26
15
Medium Priority
?
183 Views
Last Modified: 2010-04-03
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.
0
Comment
Question by:JoshDale
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
15 Comments
 

Author Comment

by:JoshDale
ID: 12416327
If you would like to take a look at this app, I can put it up on a ftp site.
0
 

Author Comment

by:JoshDale
ID: 12416449
http://www.pcfloans.com/testapp
It is the Document Management.fla file
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 12419131
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:JoshDale
ID: 12423050
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
 
LVL 39

Expert Comment

by:blue-genie
ID: 12423128
what do you mean by that?
0
 

Author Comment

by:JoshDale
ID: 12423167
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
 
LVL 39

Expert Comment

by:blue-genie
ID: 12423308
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
 

Author Comment

by:JoshDale
ID: 12423367
Yea, the only problem is, when I click a button and then another button, the content from the button before is still displayed.
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 12423396
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
 

Author Comment

by:JoshDale
ID: 12423419
I am new to doing this, the way I learned was using behaviours and having flash do the rest.
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 12423490
maybe someone with experience with behaviours can help you out then

sorry.
0
 

Author Comment

by:JoshDale
ID: 12423558
Thanks
0
 
LVL 5

Accepted Solution

by:
badrulnm earned 2000 total points
ID: 12490709
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
 

Author Comment

by:JoshDale
ID: 12494354
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question