Disable Button onClick (with/without Script), Different techniques - SWiSHMax Tutorials
 
  Buy Ebooks, Video Games, DVDs, Electronics and more !
Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads Make Money Online Blog . Free Image and Photo Sharing and Hosting

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Free image hosting
   Web Design Pakistan
   Swish Templates
   SWiSH Climax
   Talkfreelance Community
   Template Desire
   Lite boards
   Script Sector
   GimpTalk
   13dots
   Idea Designs
   PHP Cafe
   Sposatoettore
   Free swishmax templates
   Swishzone

Manage your site with Flax Article Content Management System
Disable Button onClick (with/without Script), Different techniques
Category : SWiSHMax | Level : Intermediate | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

Description:

There are a number of methods to achieve this, but here is a simple method which can help you to achieve this quickly when you are making templates for customers.
Here are the steps to do, I am making an example with only 2 buttons.

Method:

1. Make 2 buttons (Home and About)
2. Now make two DUMMY rectangles (same as buttons, two rectangles of same size of your buttons)
3. Group all of them to SPRITE (rename sprite to "all_buttons")

Now we have to do all this in this sprite, we have adopted SPRITE method becuase we know there can be more sprites for different pages so we are making it more easy to edit any part of the template.

We will achieve this simply by using PLACE and REMOVE effect. Now as in this example we are using only 2 buttons and we want when we RUN swf, only the ABOUT button should be enabled and the HOME button should be disabled by default, becuase we are displaying the HOME button details. This can be a simple TEMPLATE with 2 buttons, when you click any button it will be disabled and the other one will be enabled. HOME button is disabled by default in this example.

4. Put a STOP action on Frame number 0 of BUTTONS sprite.
5. Now, put a PLACE effect in front of ABOUT button on FRAME number 0 and put a REMOVE effect on FRAME number 1.
6. Put a REMOVE effect in front of HOME button on FRAME 0 and put a PLACE effect on FRAME 1.

now we have to display DUMMY buttons which are fake buttons (just rectanlges)..

7. Now, put a PLACE effect in front of HOME dummy button on FRAME 0, and REMOVE on frame 1.
8. Again put a REMOVE effect in front of ABOUT dummy button on FRame 0, and use REMOVE effect on frame 1.

So all of these PLACE and REMOVE effect will look like this:
user posted image

Now we have to put action for buttons,

9. For HOME button use action GOTO Frame 1.
10. For ABOUT button use action GOTO Frame 0.

You can achieve this easily within SWiSHMax by using the following script..
buttonName.enabled = false;

where buttonName is the name of your button.

The zip file is attached below, if you have any questions, feel free to ask.
I have writen this quick tutorial becuase there were a number of questions asked for this specific trick, so I thought it may help anyone.

Download Example

Regards,

@Zahra


© 2002-2005 Flaxweb Network | Article Manager | Gimp Tutorials Library | RAD C++ Library | Free C/C++ Sourcecode |
Sites of interest : Web Design Blog | Swish Templates | Swishmax Ebook | Photoshop Templates | Gimp Tutorials | Text Forum | Make Money Online