Macromedia Flash Movies, Sound Loops, Tutorials, Action Scripts, Menus, Buttons, Web Templates, intros & more!

Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

 Submit Here! · Link to Us · Newsletter · Tell a Friend · · Make It Homepage

» Advertisement

Create Speaking Characters for your website and Flash movies. 15 Day Free Trial









Go Back   Flash Tutorials, flash help, action script and flash discussion > Development > General Flash


Tags: , , , , , ,

Reply
 
Thread Tools Display Modes
  #1  
Old 02-28-2004, 07:02 PM
burroughs23 burroughs23 is offline
 
Join Date: Feb 2004
Posts: 5
burroughs23 is on a distinguished road
Default Invisible Hit State/Hit Area in Flash Button Movie?

I'm using a movie with three states to create a button, and I'm wondering if there is any way to duplicate the "Hit State" in a Button Symbol in a Movie? The button is text, and it fades in, so using the same color as the background won't work (the background fades in also, making the effect not so smooth). I like how the "Hit State" in a button is invisible...is there something comparitive I can do for this movie?

Thank you!
Reply With Quote
Sponsored
jeet jeet is offline
 
Join Date: May 2004
Default
  #2  
Old 02-29-2004, 08:32 AM
Taff Taff is offline
 
Join Date: Sep 2003
Posts: 105
Taff is on a distinguished road
Default

you could just make a square, turn it into a movieclip and reduce the _alpha to 0 making it invisible
Reply With Quote
  #3  
Old 02-29-2004, 04:11 PM
burroughs23 burroughs23 is offline
 
Join Date: Feb 2004
Posts: 5
burroughs23 is on a distinguished road
Default Excellent...

Thank you! Works perfectly...I'm still working on the whole button thing, though...
The buttons I'm working have two states (Up(1), Over(2)). They need to stay in the Over state after being clicked, while their subject is being viewed. Then, when another button is clicked, the first button needs to go back to the up state, while the second button stays down, and so on. The buttons also move around the stage and fade in and out occassionaly. The problem I'm having now, is that after a button is clicked, and then another button is clicked (sending the first button back into Up state), the first button stays in the Over state after being rolled over, instead of returning to the Up state. I think it has to do with the fact that I changed the rollOut value to the same as the release value in the onRelease section (this is how I got the button to stay Down while the item is being viewed). For some reason, after the button is clicked and the onRelease value is triggered, the button is never the same again Is there a way to tell the button "OK, another button is clicked, you can go back to your orginal state now." Am I making this more complicated than it needs to be? Here's a sample of code:

on the button itself:
on (release) {
_root.clients1.gotoAndStop(1);
_root.coo.gotoAndStop(1);
_root.riv.gotoAndStop(1);
this.onRollOut=function(){
this.gotoAndStop(2);
};
_root.gotoAndPlay(55);
}
and on the same frame in the timeline:
port1.onRollOut = function() {
this._parent.port1.gotoAndStop(1);
}
port1.onRollOver = function() {
this._parent.port1.gotoAndStop(2);
}
port1.onRollOut = function() {
this._parent.port1.gotoAndStop(1);
}
Reply With Quote
  #4  
Old 03-03-2004, 05:35 AM
Taff Taff is offline
 
Join Date: Sep 2003
Posts: 105
Taff is on a distinguished road
Default

I always make a little function, dont actually use button symbols as of MX, just a movieClip with a over state (lets say in frame 2) and a stay state (lets say in frame 3). So we name our buttons numerically btn1 thru (however many we have ) lets say 4.

we then use an for loop so when a button is clicked it goes thru the loop resetting all the buttons, then just changes the button that was clicked.
Code:
//no of buttons
for (i=0; i<4; i++) {
//the buttons function
this["btn"+i].onRelease = function() {
//firstly we need to set all buttons back to normal, using another for loop
		for (j=0; j<myBtn.length; j++) {
		//send all buttons to their normal position
		this._parent["btn"+j].gotoAndStop("normal");
		}
	//send the one being clicked to the frameLabel "depressed"
		this.gotoAndStop("depressed");
	};

	//when we rollOver the button with the mouse:
	this["btn"+i].onRollOver = function() {
//send it to the frameLabel "over"
		this.gotoAndStop("over");
//create an onRollOut function sending the playhead to "Normal"
		this.onRollOut = function() {
			this.gotoAndStop("normal");
		};
	};
}
Something like this maybe

Taff
Reply With Quote
  #5  
Old 03-04-2004, 03:57 AM
burroughs23 burroughs23 is offline
 
Join Date: Feb 2004
Posts: 5
burroughs23 is on a distinguished road
Default ??

I get the following error message:

Scene=Scene 1, Layer=1, Frame=1: Line 2: Statement must appear within on/onClipEvent handler
for (i=0; i<4; i++) {

I'm also using movies also, not buttons...they are text combined with "hit states" defined as alpha 0% to be invisible..does the "length" reference in the code refer to the size of the button?
Reply With Quote
  #6  
Old 03-04-2004, 05:08 AM
burroughs23 burroughs23 is offline
 
Join Date: Feb 2004
Posts: 5
burroughs23 is on a distinguished road
Default Sorry I'm sounding ignorant

But I was wondering: myBtn is ? The actual name of my movie button instance? or do I type myBtn in the code...and "btn"...same question...
Reply With Quote
  #7  
Old 03-21-2004, 04:34 PM
Taff Taff is offline
 
Join Date: Sep 2003
Posts: 105
Taff is on a distinguished road
Default

Sorry for the (very) late reply.

myBtn is as you guessed the instance name of the button.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Button hit state problem scrotaur Newbies 3 04-02-2006 04:12 AM
linking a button in a flash movie menue Shorty_K_Dahee Newbies 1 01-11-2006 12:59 AM
MC in button over state mrfranchot Design and Animation 9 01-11-2005 04:04 PM
Keeping Button in Down State While In Use burroughs23 Flash Scripting 1 02-26-2004 08:25 PM
Controlling Button State nusharp Newbies 3 01-07-2004 07:39 AM

All times are GMT. The time now is 12:53 AM.



Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Forum SEO by Zoints