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

Closed Thread
Results 1 to 7 of 7
  1. #1

    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!

  2. # ADS
    Join Date
    Always
    Posts
    Many
     
  3. #2

    Default

    you could just make a square, turn it into a movieclip and reduce the _alpha to 0 making it invisible

  4. #3

    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);
    }

  5. #4

    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 &#40;i=0; i<4; i++&#41; &#123;
    //the buttons function
    this&#91;"btn"+i&#93;.onRelease = function&#40;&#41; &#123;
    //firstly we need to set all buttons back to normal, using another for loop
    		for &#40;j=0; j<myBtn.length; j++&#41; &#123;
    		//send all buttons to their normal position
    		this._parent&#91;"btn"+j&#93;.gotoAndStop&#40;"normal"&#41;;
    		&#125;
    	//send the one being clicked to the frameLabel "depressed"
    		this.gotoAndStop&#40;"depressed"&#41;;
    	&#125;;
    
    	//when we rollOver the button with the mouse&#58;
    	this&#91;"btn"+i&#93;.onRollOver = function&#40;&#41; &#123;
    //send it to the frameLabel "over"
    		this.gotoAndStop&#40;"over"&#41;;
    //create an onRollOut function sending the playhead to "Normal"
    		this.onRollOut = function&#40;&#41; &#123;
    			this.gotoAndStop&#40;"normal"&#41;;
    		&#125;;
    	&#125;;
    &#125;
    Something like this maybe

    Taff

  6. #5

    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?

  7. #6

    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...

  8. #7

    Default

    Sorry for the (very) late reply.

    myBtn is as you guessed the instance name of the button.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial