Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








ROLL_OVER Button State "jumpy"?


I have created a circle where each sector (piece of pie) is a button which has a rollover state. All works fine as long as I move into a pice of the pie from the outside and leave via this path. As soon as I move from one piece to the next, everything becomes jumpy and in fact I can turn on several rollovers at the same time.
This happens regardless of me using a stop for the tweening.

See:
http://www.spallek.com/flash/freevis_menu.html

Here is the code for one piece of the pie (I also noticed that the hit area is not "solid" meaning its not over the whole sector despite the fact that the mc is exactly the shape of the sector--maybe related?):


Code:
var Ablauflink:URLRequest = new URLRequest("http://www.spallek.com");
Ablauf_hit_mc.alpha = 0;
Ablauf_sel_mc.alpha = 0;
Ablauf_txt_sel_mc.alpha = 0;
Ablauf_exp_mc.alpha = 0;

Ablauf_hit_mc.addEventListener(MouseEvent.CLICK, onAblClick);
Ablauf_hit_mc.addEventListener(MouseEvent.ROLL_OVER, AblOver);
Ablauf_hit_mc.addEventListener(MouseEvent.ROLL_OUT, AblOut);

function AblOver(event:MouseEvent):void
{
var myTweenAlphaOverAblaufBtn:Tween = new Tween(Ablauf_sel_mc, "alpha", Strong.easeOut, 0, 1, 2, true);

var myTweenAlphaOverAblaufTxt:Tween = new Tween(Ablauf_txt_sel_mc, "alpha", Strong.easeOut, 0, 1, 2, true);

var myTweenAlphaOverAblaufExp:Tween = new Tween(Ablauf_exp_mc, "alpha", Strong.easeOut, 0, 1, 2, true);

Waehlen_sel_mc.alpha = 0;
Waehlen_exp_mc.alpha = 0;
Waehlen_mc.alpha = 1;
Waehlen_txt_sel_mc.alpha = 0;

Ablauf_txt_mc.alpha = 0;
Technologie_sel_mc.alpha = 0;
Technologie_txt_sel_mc.alpha = 0;
Technologie_exp_mc.alpha = 0;
Vorteile_txt_sel_mc.alpha = 0;
Vorteile_sel_mc.alpha = 0;
Vorteile_exp_mc.alpha = 0
Indikationen_txt_sel_mc.alpha = 0;
Indikationen_sel_mc.alpha = 0;
Indikationen_exp_mc.alpha = 0;
Zentren_txt_sel_mc.alpha = 0;
Zentren_sel_mc.alpha = 0;
Zentren_exp_mc.alpha = 0
FAQ_txt_sel_mc.alpha = 0;
FAQ_sel_mc.alpha = 0;
FAQ_exp_mc.alpha = 0;
}

function AblOut(event:MouseEvent):void
{
if (myTweenAlphaOverAblaufTxt != null)
{
myTweenAlphaOverAblaufTxt.stop();
myTweenAlphaOverAblaufExp.stop();
}
var myTweenAlphaOverAblaufBtn:Tween = new Tween(Ablauf_sel_mc, "alpha", Strong.easeOut, 1, 0, 1, true);

var myTweenAlphaOverAblaufTxt:Tween = new Tween(Ablauf_txt_sel_mc, "alpha", Strong.easeOut, 1, 0, 1, true);

var myTweenAlphaOverAblaufExp:Tween = new Tween(Ablauf_exp_mc, "alpha", Strong.easeOut, 1, 0, 1, true);

Waehlen_sel_mc.alpha = 1;
Waehlen_exp_mc.alpha = 1;
Waehlen_txt_sel_mc.alpha = 1;
Waehlen_mc.alpha = 0;
Ablauf_txt_mc.alpha = 1;

}

function onAblClick(event:MouseEvent):void
{
navigateToURL(Ablauflink);
}

Ablauf_hit_mc.buttonMode = true;




FlashKit > Flash Help > Actionscript 3.0
Posted on: 11-16-2008, 07:55 AM


View Complete Forum Thread with Replies

Sponsored Links:

ROLL_OVER Button State "jumpy"?
I have created a circle where each sector (piece of pie) is a button which has a rollover state. All works fine as long as I move into a pice of the pie from the outside and leave via this path. As soon as I move from one piece to the next, everything becomes jumpy and in fact I can turn on several rollovers at the same time.
This happens regardless of me using a stop for the tweening.

See:
http://www.spallek.com/flash/freevis_menu.html

Here is the code for one piece of the pie (I also noticed that the hit area is not "solid" meaning its not over the whole sector despite the fact that the mc is exactly the shape of the sector--maybe related?):








Attach Code

var Ablauflink:URLRequest = new URLRequest("http://www.spallek.com");
Ablauf_hit_mc.alpha = 0;
Ablauf_sel_mc.alpha = 0;
Ablauf_txt_sel_mc.alpha = 0;
Ablauf_exp_mc.alpha = 0;

Ablauf_hit_mc.addEventListener(MouseEvent.CLICK, onAblClick);
Ablauf_hit_mc.addEventListener(MouseEvent.ROLL_OVER, AblOver);
Ablauf_hit_mc.addEventListener(MouseEvent.ROLL_OUT, AblOut);

function AblOver(event:MouseEvent):void
{
var myTweenAlphaOverAblaufBtn:Tween = new Tween(Ablauf_sel_mc, "alpha", Strong.easeOut, 0, 1, 2, true);

var myTweenAlphaOverAblaufTxt:Tween = new Tween(Ablauf_txt_sel_mc, "alpha", Strong.easeOut, 0, 1, 2, true);

var myTweenAlphaOverAblaufExp:Tween = new Tween(Ablauf_exp_mc, "alpha", Strong.easeOut, 0, 1, 2, true);

Waehlen_sel_mc.alpha = 0;
Waehlen_exp_mc.alpha = 0;
Waehlen_mc.alpha = 1;
Waehlen_txt_sel_mc.alpha = 0;

Ablauf_txt_mc.alpha = 0;
Technologie_sel_mc.alpha = 0;
Technologie_txt_sel_mc.alpha = 0;
Technologie_exp_mc.alpha = 0;
Vorteile_txt_sel_mc.alpha = 0;
Vorteile_sel_mc.alpha = 0;
Vorteile_exp_mc.alpha = 0
Indikationen_txt_sel_mc.alpha = 0;
Indikationen_sel_mc.alpha = 0;
Indikationen_exp_mc.alpha = 0;
Zentren_txt_sel_mc.alpha = 0;
Zentren_sel_mc.alpha = 0;
Zentren_exp_mc.alpha = 0
FAQ_txt_sel_mc.alpha = 0;
FAQ_sel_mc.alpha = 0;
FAQ_exp_mc.alpha = 0;
}

function AblOut(event:MouseEvent):void
{
if (myTweenAlphaOverAblaufTxt != null)
{
myTweenAlphaOverAblaufTxt.stop();
myTweenAlphaOverAblaufExp.stop();
}
var myTweenAlphaOverAblaufBtn:Tween = new Tween(Ablauf_sel_mc, "alpha", Strong.easeOut, 1, 0, 1, true);

var myTweenAlphaOverAblaufTxt:Tween = new Tween(Ablauf_txt_sel_mc, "alpha", Strong.easeOut, 1, 0, 1, true);

var myTweenAlphaOverAblaufExp:Tween = new Tween(Ablauf_exp_mc, "alpha", Strong.easeOut, 1, 0, 1, true);

Waehlen_sel_mc.alpha = 1;
Waehlen_exp_mc.alpha = 1;
Waehlen_txt_sel_mc.alpha = 1;
Waehlen_mc.alpha = 0;
Ablauf_txt_mc.alpha = 1;

}

function onAblClick(event:MouseEvent):void
{
navigateToURL(Ablauflink);
}

Ablauf_hit_mc.buttonMode = true;

View Replies !    View Related
Down State In Drop Down Menu-then Return To Up State When Other Button Is Clicked?
Hi - nice to meet everyone,

The drop down menu I'm referring to is located in the main movie. The menu is a movie clip with the buttons inside and I have each button as 'track as menu item' in the properties. The buttons are linked to external swfs that load into an empty movie clip on the main stage. Everything loads perfectly no problem. The problem is that I can't seem to figure out the right code to put on the sub-menu items/buttons in the drop down menu to show the 'down' state when the corresponding movie is loaded (i.e., about-main button, philosophy [menu item], philosophy movie loaded). Then get it to go back to the 'up' state when another button is pressed in the same drop area part of the menu? I hope I explained myself clear enough without confusing anyone!

I would appreciate any help - I think I'm going to lose my mind - this is driving me crazy!!

Thanks - Allee

View Replies !    View Related
Jumpy Button Help
Does anyone know why these buttons are so jumpy? Attached is the fla

View Replies !    View Related
Active Button State/3 State Buttons
http://www.thecodebehind.com/code/flash ... state.aspx

Does anybody know anything about implmenting the above - but via an external class (.as) file?

I'm still learning, and so it's a bit much to wrap my brain around...

View Replies !    View Related
FLASH 8 - Toggle Button/released State/pressed Button
I have a series of buttons inside an array. I am trying to get the buttons so that once they are pressed, they remain in the over state. Which is a darker color than the up state. So that people know which button they have pressed. Is there an easy way to do this for buttons?

Please help someone,
Thanks,
M

View Replies !    View Related
Button States - How To Keep Button On Rollover State When Clicked.
on (rollOver) {
this.btn_about.gotoAndPlay("mouseover");
setProperty(this.btn_about, _x, 25);
setProperty(this.btn_about, _y, 29);
}
on (rollOut) {
this.btn_about.gotoAndPlay("mouseout");
}

on(release){
_parent.gotoAndStop("about");
}

There's my button code. Now a rundown on my delima.

I have a movie "company.swf" that is loaded into an empty MC "content" that is located within my main movie "main.swf". My buttons are all located inside an MC "subnav" inside of company.swf. I have seperate MC's for each button with an actual button with just a "hit" area. I would like each button to stay in the rollover state when clicked so a user knows where they are in each section. I hope I'm being clear here. My rollover and rollout works fine.

Please help!! Thanks

View Replies !    View Related
Movie Clip Within Button - How Do You Disable Down State Of Button?
Hi - I have created a menu down the side of my flash site which is in the form of a button so that when the user rolls over the button, it brings up the menu. Within, this button is just text - the names for each page the user can select to go to (text is within movie clips so I can add actionscript to them).

However, I want to add on (press) {gotoAndPlay("home",1); } etc for each movie clip within this button but when i test the site, this code does not work as the buttons down state has priority over the movie clips within it.

Is there some actionscript code which could disable the down state of a button? (as i only need the button as a rollover anyway and i need the movie clips within the button to have priority in terms of actionscript for linkage etc)

Thanks

View Replies !    View Related
BUTTON ROLL OVER STATE TO STAY.. But Not A Button
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
}

this is what i have to animate a button/movie clip - kinda like what www.newstoday.com has for their buttons.....
but when i press the button and go to a different section i want the over state to stay over...ive tried to add this but not sure where i going wrong...

onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();

}

or do i need to go with a on script?
like this

View Replies !    View Related
Roll_over & Roll_out
Hello,

I have a navigation section that i want to fade in whenever the entire navsection has an active cursor over it. The navsection also includes a series of button_mc's that allow the user to navigate.

I have the Nav Section (instance named bg) animating properly, but whenever i move from 1 button to the next, it replays the alpha fade in.

Here's my code:


Code:
package {

import flash.display.*;
import flash.net.*;
import flash.events.*;
import flash.text.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;


public class Sfgdc extends MovieClip {

public var sfStat:Boolean = false;


// create a new LocalConnection instance used to send
// calls to a LocalConnection instance in another movie
var outgoing_lc:LocalConnection = new LocalConnection();

public function Sfgdc() {



visitors.addEventListener(MouseEvent.ROLL_OVER, myOver);
visitors.addEventListener(MouseEvent.ROLL_OUT, myOff);
visitors.addEventListener(MouseEvent.CLICK, linkVisitors);
visitors.buttonMode = true;

online.addEventListener(MouseEvent.ROLL_OVER, myOver);
online.addEventListener(MouseEvent.ROLL_OUT, myOff);
online.addEventListener(MouseEvent.CLICK, linkOnline);
online.buttonMode = true;

help.addEventListener(MouseEvent.ROLL_OVER, myOver);
help.addEventListener(MouseEvent.ROLL_OUT, myOff);
help.addEventListener(MouseEvent.CLICK, linkHelp);
help.buttonMode = true;

textv.addEventListener(MouseEvent.ROLL_OVER, myOver);
textv.addEventListener(MouseEvent.ROLL_OUT, myOff);
textv.addEventListener(MouseEvent.CLICK, loadError);
textv.buttonMode = true;

}

function myTrace(event:MouseEvent):void {
trace("Home --> Click");
}
function myOver(event:MouseEvent):void {
var myTween:Tween = new Tween(bg.cover_mc, "alpha", Strong.easeIn, 0, 1, .15, true);
}
function myOff(event:MouseEvent):void {
var myTween:Tween = new Tween(bg.cover_mc, "alpha", Strong.easeIn, 1, 0, .15, true);
}

function linkVisitors(event:MouseEvent):void {
trace("Home --> linkVisitors");
outgoing_lc.send("Channel", "linkVisitors");
}
function linkOnline(event:MouseEvent):void {
trace("Home --> linkOnline");
outgoing_lc.send("Channel", "linkOnline");
}
function linkHelp(event:MouseEvent):void {
trace("Home --> linkHelp");
outgoing_lc.send("Channel", "linkHelp");
}
function linkTextv(event:MouseEvent):void {
trace("Home --> linkText");
outgoing_lc.send("Channel", "linkText");
}
function loadError(event:MouseEvent):void {
trace("Home --> Error");
outgoing_lc.send("Channel", "myError");
}
}
}


So in other words, when i go from 1 button to the next, it plays the ROLL_OUT and creates a flash effect. I'd prefer it that if it was within the main Nav Section it just stayed opaque.

View Replies !    View Related
ROLL_OVER, ROLL_OUT Looping
Hi all, I am working on a small file and am having a very frustrating time dealing with uncontrollable looping of a an actionscripted animation. Basically I have a series of pins and a series of labels. When you mouse over the pin a a label appears. If I set it up to only appear and not disappear it works fine. When I have the ROLL_OVER set to have the label appear and the ROLL_OUT set to have it disappear it loops like crazy. I can't figure out how to get it to do each operation once only and then reset itself once the mouse is off of the pin location. I have included my code for any pointers. I have tried calling button operations as functions and directly embedding it in the button script. I included my FLA as well. Thanks so much!


ActionScript Code:
stop();

import flash.events.MouseEvent;
import fl.transitions.Tween;
import fl.transitions.easing.*;

var pinMiamiTween:Tween = new Tween(pinMiami, "y", Strong.easeIn, -50, 151, 1, true);
var pinWeymouthTween:Tween = new Tween(pinWeymouth, "y", Strong.easeIn, -50, 106, 1.5, true);
var pinScotlandTween:Tween = new Tween(pinScotland, "y", Strong.easeIn, -50, 96, 1.25, true);

var i:int = 1;
sailMiami.alpha = 0;

pinMiami.addEventListener(MouseEvent.ROLL_OVER,miamiOver);
function miamiOver(MouseEvent) {
    if (i==1) {
        var pinMiamiTweenIn:Tween = new Tween(sailMiami, "x", Strong.easeOut, 200, 287, 1, true);
        var pinMiamiAlphaIn:Tween = new Tween(sailMiami, "alpha", Strong.easeOut, 0, 1, 3, true);
        i = 2;
    }
}

pinMiami.addEventListener(MouseEvent.ROLL_OUT,miamiOut);
function miamiOut(MouseEvent) {
    if (i==2) {
        var pinMiamiAlphaOut:Tween = new Tween(sailMiami, "alpha", Strong.easeOut, 1, 0, 1, true);
        i=1;
    }
}

View Replies !    View Related
ROLL_OVER Behavior Inconsistent
I am working on a series of puzzle games.

Each piece is a movie clip. When the mouse rolls over a piece, its child object movie clip, called the "rotation mark", appears on the piece. (This is to allow the user to rotate the piece by clicking on it). When the mouse leaves the piece the rotation mark disappears.

I accomplish this by way of ROLL_OVER and ROL_OUT event handlers on the piece movie clip. On ROLL_OVER I simply set the rotation mark movie clip's visible property to true, and on ROLL_OUT I set it to true.


Here is what it looks like. (The mouse cursor doesn't get captured when you take a screen shot in Windows.)



When the mouse is moved over the rotation mark, inconsistent behaviour results:

1) When I try it with Control -> Test Movie in Flash it still seems to be considered "over" the piece.

2) However when I run the SWF embedded in an HTML file, moving the mouse over the rotation mark results in the piece dispatching a ROLL_OUT event.
(This causes the rotation mark to blink because when it's gone the piece fires ROLL_OVER, causing it to reappear, which causes the piece to fire ROLL_OUT again, ad infinitum.)

3) When I try it with Debug -> Debug Movie in Flash I get the same result as 2 above.

Why are these different? What is the expected behaviour.

One thing you may note is that all the MCs here (pieces as well as rotation mark) are loaded assets from external library SWFs. Before, when I had them all in a single SWF that was running I was getting the same results as 1 above in all cases. It was after I changed my design to have use a shell SWF and external libraries that this inconsistent behaviour began.

Any thoughts or ideas?

View Replies !    View Related
ROLL_OVER & ROLL_OUT Problems
Hello everyone,
I'm new to AS 3.0 and I'm trying to make a set of simple thumbnails with roll over and roll out effect. When I roll over one thumbnail in a row it has to scale up, and other thumbnails have to move to left and right respectively, and when I roll out everything has to go to it's original place. Problem is, when I roll out from one thumbnail and roll over the other one directly, other thumbnails don't go to their original position. I'm using Tween class for thumbnail motion and I suppose that I need to use TweenEvent.MOTION_FINISH but don't know how exactly...

I attached .fla and .as file, so if anyone can help I would appreciate it!

Sorry for my English...

View Replies !    View Related
ROLL_OVER / ROLL_OUT Issue
I'm in the process of writing a 'elastic' tooltip class, where the tooltip follows the mouse with a small delay, making it look like an 'elastic' effect.

You can se an example here:
http://www.2xmedie.dk/develop/tooltip/
(Try to touch the tooltip with the mouse)

Sourcefiles here:
http://www.2xmedie.dk/develop/tooltip/source.rar

There's one issue though: When the mousepointer touches the tooltip it self, it causes an MouseEvent.ROLL_OUT on the target movieclip
This is causing the tooltip movieclip to 'flicker' since ROLL.OVER and ROLL.OUT are called constantly.

Can I some how, make sure, that the MouseEvent.ROLL_OUT is NOT called, when the mousepointer touches the tooltip movieclip?

I was looking at the method preventDefault() - but I'm not sure how to implement it.

Can someone please advice?

View Replies !    View Related
Roll_over & Roll_out Problems
Hello, I'm a newbie to the max. First off, I'm thankful that there are forums like this to help me out, it's very challenging but since I'm just beginning and I need all the help I can get.


Code:
stop();

btnGroup.addEventListener(MouseEvent.ROLL_OVER, target, false, 0, true);
btnGroup.addEventListener(MouseEvent.ROLL_OUT, out, false, 0, true);
btnGroup.mouseEnabled = true;
btnGroup.buttonMode = true;

var btnName:String = "";

function target(evt:MouseEvent):void {
btnName = evt.target.name;
gotoAndStop(btnName);
}
function out(evt:MouseEvent):void {
gotoAndPlay('first');
}
I've created all the movieclip buttons, and I put them all on stage to create a btnGroup. I'm not quite sure if they (btn1, btn2, etc.) have instance names EACH, so that might be a problem. The btnGroup is the one on stage, none of the btns are. The btnGroup has an instance name, and I've created empty frame labels. The problem, when I Test Movie, is that it just plays through the movie and does not stop anywhere, nor is there a "hand" to click any of the buttons. btn1 is the only one prepared for the roll over effect as of now, and thats why there are no more keyframes in the text1 layer.

When there is a rollover, I want static text to appear and the rollout is to start over, empty on stage.

View Replies !    View Related
ROLL_OVER, ROLL_OUT Problem
Any ideas what could cause a ROLL_OVER & ROLL_OUT displayObject repeat the listener functions over and over again, as if you were rolling out and in over and over again, but you're not?

There's no way I can show all the code, it's part of a large & complicated app.

View Replies !    View Related
Image Is Replaced On ROLL_OVER?
How can I display a still image on the stage that loads on the first
frame and when the user rolls over a button, the button plays a movie
clip in place of the still image? So the image is temporarily swapped
with the movie clip.

I am currently using the following code provided in another thread to
make the movie clip play onrollover:


function showGraphic(event:MouseEvent):void {
mSymbol.visible = true;
}

function hideGraphic(event:MouseEvent):void {
mSymbol.visible = false;
}

btn.addEventListener(MouseEvent.ROLL_OVER, showGraphic);

btn.addEventListener(MouseEvent.ROLL_OUT, hideGraphic);



I am also using the following code to hide the movie clip on load:

mSymbol.visible = false;

Thanks!!!

View Replies !    View Related
ROLL_OVER Behavior Inconsistent
I am working on a series of puzzle games.

Each piece is a movie clip. When the mouse rolls over a piece, its child object movie clip, called the "rotation mark", appears on the piece. (This is to allow the user to rotate the piece by clicking on it). When the mouse leaves the piece the rotation mark disappears.

I accomplish this by way of ROLL_OVER and ROL_OUT event handlers on the piece movie clip. On ROLL_OVER I simply set the rotation mark movie clip's visible property to true, and on ROLL_OUT I set it to true.


Here is what it looks like. (The mouse cursor doesn't get captured when you take a screen shot in Windows.)



When the mouse is moved over the rotation mark, inconsistent behaviour results:

1) When I try it with Control -> Test Movie in Flash it still seems to be considered "over" the piece.

2) However when I run the SWF embedded in an HTML file, moving the mouse over the rotation mark results in the piece dispatching a ROLL_OUT event.
(This causes the rotation mark to blink because when it's gone the piece fires ROLL_OVER, causing it to reappear, which causes the piece to fire ROLL_OUT again, ad infinitum.)

3) When I try it with Debug -> Debug Movie in Flash I get the same result as 2 above.

Why are these different? What is the expected behaviour.

One thing you may note is that all the MCs here (pieces as well as rotation mark) are loaded assets from external library SWFs. Before, when I had them all in a single SWF that was running I was getting the same results as 1 above in all cases. It was after I changed my design to have use a shell SWF and external libraries that this inconsistent behaviour began.

Any thoughts or ideas?

View Replies !    View Related
AS3 Sound On Mouse Roll_over
hi... i've been experimenting with some buttons in AS3 and sounds... actually the buttons are movie clips and i'm trying to attach a sound to the ROLL_OVER action...
i used this code:


Code:
var buttonSound:Sound = new Sound();
var buttonSoundControl:SoundChannel = new SoundChannel();

buttonSound.load(new URLRequest("buttonsound.mp3"));

button_mc.addEventListener(MouseEvent.ROLL_OVER, RollOverListener);

function RollOverListener(e:MouseEvent):void
{
e.currentTarget.gotoAndStop(2)
e.currentTarget.buttonMode = true;
buttonSoundControl = buttonSound.play();
e.currentTarget.addEventListener(MouseEvent.CLICK, ClickListener);
}
so this code works.. but it loads the sound externally... and after a few minutes of browsing through the website the roll_over sound becomes laggy... i'm guessing it's because it loads over and over in the memory when hovering the buttons.. btw here is the website so you can try it for yourself:http://www.test.bvbusinessconsulting.ro/

my idea is to attach the sound to the swf file... i know that in AS2 there was a function attachSound() but this one is missing in AS3 and has now equivalent...
so if someone could help me on this one i would be really greateful!!

thanks in advanced!

View Replies !    View Related
ROLL_OVER, ROLL_OUT Interfering With Each Other?
I made a few movieclip buttons and when I when I roll my mouse over them they work just fine. They have an Over and an Out animation.

However, if I move my mouse around somewhat quickly over them all, the Over state for the button will stay on. They're only supposed to be active one at a time. I can move the pointer all around and the buttons won't always ROLL_OUT as I roll out and the ROLL_OVER state will stay on.

This isn't the first time I've had this happen. What can make these buttons work more efficiently when moving your mouse quickly over them?

Here is my AS3.


Actionscript Code:
but3.addEventListener(MouseEvent.ROLL_OVER, onButOver);but3.addEventListener(MouseEvent.ROLL_OUT, onButOut);but2.addEventListener(MouseEvent.ROLL_OVER, onButOver);but2.addEventListener(MouseEvent.ROLL_OUT, onButOut);but1.addEventListener(MouseEvent.ROLL_OVER, onButOver);but1.addEventListener(MouseEvent.ROLL_OUT, onButOut); 
function onButOver (event:MouseEvent) {    event.currentTarget.gotoAndPlay("over");}function onButOut (event:MouseEvent) {    event.currentTarget.gotoAndPlay("out");}

There has to be a way to do this. I have been to sites where I can roll over as fast as I want and the states will change. I can roll in and out of one button really quick and leave it in the ON state without it rolling out.

EDIT: This seems to only happen when the buttons are closer together. So picture 3 circles (100x100) about 15 pixels apart. Any help would be appreciated!!!

View Replies !    View Related
AS3 - Stage Listener For ROLL_OVER
Hi!

When I add an event listener that listens for ROLL_OVER on the stage, it doesn't work. I know MOUSE_OVER works but that fire:s on every enterframe and that's not what I want. So, how come ROLL_OVER doesnt work and how does one create this kind of listener for the stage? I just want to know if the mouse is somewhere within the stage, adding some kind of old school "clickArea" MC or something like that just doesn't seem to be the best solution...

Ideas anyone?

View Replies !    View Related
Simple ROLL_OVER Question.
Hey i'm sure this is a simple question for someone, I have a header im working on thats is flash, and is basically images with a rollover and rollout using a class. Most the time it works without a hitch but sometimes it gets stuck between the rollover and rollout and pulsates. Should i apply the rollout when the tween is finished? Thanks! Any help appreciated.

Code:

package
{
   import flash.events.*;
   import flash.net.*;
   import flash.display.*;
   import caurina.transitions.Tweener;
   import flash.filters.DropShadowFilter;
   
   public class PARTYPURPOSE extends MovieClip
   {
      public function PARTYPURPOSE()
      {
      addEventListener(MouseEvent.ROLL_OVER, onOver);
      addEventListener(MouseEvent.ROLL_OUT, onOut);
      }
   
      public function onOver(event:MouseEvent):void
      {
      Tweener.addTween(event.target, { scaleX:.75, scaleY:.75, time:.5 } );
      event.target.filters = [new DropShadowFilter(0,0,0x000000,90,20,20,.8,3)];
      stage.addChild(this);
      }
   
      public function onOut(event:MouseEvent):void
      {
      Tweener.addTween(event.target, { scaleX:.5, scaleY:.5, time:1 } );
      event.target.filters = [];
      }
   
   } //ends class
} // ends package

and here you can see the actual application:
http://www.pawspetplace.com/nick

View Replies !    View Related
Button Down State
I am trying to create a flash simulation of a security keypad. One of the required features is that a different action occur if the user holds down the button for 3 seconds rather than just releasing it. To accurately mimic the real-life keypad after the button has been held for three seconds certain lights should begin to flash and events trigger before the button is released.

I have tried countless things and none of them seem to be working. Is there a way to check the state of a button so I could do a "Do while" loop based upun it still being pressed?

Any nudging in the right direction is very appreciated.

View Replies !    View Related
Mc On Down State Of Button
If I create a movie clip that is the down state of a button how do I get it to finish playing even after button is released? Thanks

View Replies !    View Related
How Do You Set The State Of A Button With AS?
how do you set the state of a button with AS?

i have a button on the bottom of the stage, and another instance of the same button at the top of the stage (for visual effect). i'd like to make it so that when you roll over the instance of the button at the bottom of the stage, the instance at the top of the stage would show the rollover effect. any ideas? thanks in advance.

View Replies !    View Related
State Of Button
My requirement is that when I press a button the look of the button needs to change.In my case - a pause button - when clicked should change to a play button.

I've a deadline and I'm not getting anywhere.

Thanks

View Replies !    View Related
Hit State Button Help
ok, I put in an image inside of the already existing button, on the hit state of the button, how do i make it work when i click it????

View Replies !    View Related
Hit State Button Help
ok, I put in an image inside of the already existing button, on the hit state of the button, how do i make it work when i click it????

View Replies !    View Related
Hit State Button Help
ok, I put in an image inside of the already existing button, on the hit state of the button, how do i make it work when i click it????

View Replies !    View Related
On And Off State Of Button
Hi,
I have a button and it is suppose to bring up a pop up menu when a user hits it and when it is hit again (while the pop up menu is still up) the menu will disappear. This is what I have:

on (release) {
if(state=="off"){
state="on";
_root.gotoAndStop(65);
}
else
state="off";
_root.gotoAndStop(45);
}

However, this code doesn't work, I understand I need to initialize "state" somewhere, but I dunno how to or where to. how can I initialize the state? can someone help me please?
Thanks.

View Replies !    View Related
Button State
Hi there,

In my main swf i have 4 buttons.What I want to accomplish is this.

When I hit but 1 for instance the butons stays in the hit state.
If I then hit but2,3 or 4 but1 is back in the normal state but2,3or 4 is in the hit state visible.How do this?

You can see what I mean by going to this site for instance:
http://minkipark.com/

Hope someone can help.Big thx in advance.

Grtz

View Replies !    View Related
Button Over State
How do you enable the over state to remain visible after clicked, then go away when a different button is clicked and perform the same function?

View Replies !    View Related
Button Up State
Hello.

I am making a naviagation that fades out ounce you roll out of a button.

I have an up state with a nested movie clip to fade out.

It works, but it plays when you first enter the movie. This is annoying. How can I keep this wonderful roll out and get rid of the roll out animation when you first enter the movie.

Thank-you.

View Replies !    View Related
Button Down State
I'm not really a newb with flash but, I have never figured out an easy way to keep the state of a button, once it is selected, down. I used to just superimpose a phantom image of the button's down state over it when the timeline jumped to a selected frame. Is there an easier way to do this? Im no longer jumping to frames but instead loading movies, so this tactic doesnt work (and its a pain in the
$%#!)


Thanks for any advise. Much appreciated.

View Replies !    View Related
Button State?
Hi,

I have a button that has a different gfx for over, down and hit states.

I want to be able to have the button display one of these states when the user presses it and moves the mouse off.

How would I go about this?

View Replies !    View Related
Button State
Hi All,

Is it possible to disable a particular button state in the run time. i.e., A button having over, down state, when moves from frame 1 to 2 the down state should be disabled and when it comes back to frame 1 it should be enabled, I can't have two buttons for that and it got to be the same button

Hope its clear!!

Thanks in Advance

View Replies !    View Related
3 State Button
I would like to create a button (or perhaps a mc that acts like a button?) that has three states :

1. a normal "off" state

2. a highlighted "rollover" state (which amounts to putting a white square graphic behind the first, normal button)

3. an engaged, "clicked" state (with an additional black border around the white square rollover state) that remains a different button is clicked -- unlike the 'down' frame in a button symbol, which only remains WHILE the mouse is down.

Is it possible to do all of this via actionscript ?

I should say that I have about 30 of these to do, so I'd REAALLLLY like to find a way to do it with code.

View Replies !    View Related
Keep Button In Down State?
Hi all, I have a basic button question. (almost posted on the newbie board

I simply would like to have my button clicked on (downstate) and stay there until clicked again.

I haven't added any code, just using the standard button rollover feature.

thanks in advance... Laurel

View Replies !    View Related
[F8] Button Over State
www.majesticsales.com theres a button in the nav called "Specials" can anybody help me tweak it so it doesnt pop on and off when i pass by it, or stay on after i roll off of it!...

Specials is inside of a movie clip with an invisible button
onrollover on specials it gotoAndPlay's frame 5 where those 2 sub buttons show
rollout to gotoAndPlay frame 1

Thanks

View Replies !    View Related
[F8] Button State
how do i change a button state once a user clicks on it and i would like it to be different so you know what section you are in but i want to do it in action script and not in the time line

View Replies !    View Related
[F8] Down Button State Help
I created a button with a rollover state that makes an object tilt. I then want to animate a symbol shooting out of the tilted rollover object to occur by clicking. Currently, the only way the animation will play all the way through is if the user holds down the mouse button. Is there any way for the animation to play with a single click?

View Replies !    View Related
[F8] Down Button State Help
I created a button with a rollover state that makes an object tilt. I then want to animate a symbol shooting out of the tilted rollover object to occur by clicking. Currently, the only way the animation will play all the way through is if the user holds down the mouse button. Is there any way for the animation to play with a single click?

View Replies !    View Related
Button State
in my program i have a map of a building which consists of various buttons. Each of these button represent a different room. When the user clicks on a button they are taken to a new room (a new 360 panorama). I'd like the button which they clicked on to remain in an up state until they click on another button. Does anyone know how i could go about doing this?

Any help would be really appreciated, thanks!

View Replies !    View Related
Button On State?
Hey guys,

First of all I'd like to thank everyone who's helped me so far in getting on board with AS3. It's been a tough transition for me from AS2, but I've really been enjoying it and am really stoked about the results I'm getting.

That said, here's another thing I can't seem to figure out: the button on state. I've done everything in actionscript, some of it not so clean simply because I'm just not there yet, but everything is so much smoother in terms of execution so I'm trying to stick with it. What happens in this file is that when a button is clicked, the little arrow to the left shows up. But I also want the over state of the button to become the on state (i.e., the lined darker color).

The button code is just spread across three frames in a movieClip with stop and easing scripts. The main timeline code is here:


ActionScript Code:
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;

//ANIMATION STUFF
content_mc.visible = false;

var redBoxTweenY:Tween = new Tween(redbox_mc, "y", Strong.easeOut, -110, 0, 20, false);
var bluBoxTweenY:Tween = new Tween(blubox_mc, "y", Strong.easeOut, 526, 106, 20, false);
bluBoxTweenY.addEventListener(TweenEvent.MOTION_FINISH, nextTween);


function nextTween(e:TweenEvent){
    content_mc.visible = true;
    var contentFade:Tween = new Tween(content_mc, "alpha", None.easeNone, 0, 1, 20, false);
    bluBoxTweenY.removeEventListener(TweenEvent.MOTION_FINISH, nextTween);
}


//NAVIGATION
manifesto_mc.buttonMode = true;
manifesto_mc.addEventListener(MouseEvent.ROLL_OVER, navOver);
manifesto_mc.addEventListener(MouseEvent.ROLL_OUT, navOut);
manifesto_mc.addEventListener(MouseEvent.CLICK, contentManifesto);

team_mc.buttonMode = true;
team_mc.addEventListener(MouseEvent.ROLL_OVER, navOver);
team_mc.addEventListener(MouseEvent.ROLL_OUT, navOut);
team_mc.addEventListener(MouseEvent.CLICK, contentTeam);

partners_mc.buttonMode = true;
partners_mc.addEventListener(MouseEvent.ROLL_OVER, navOver);
partners_mc.addEventListener(MouseEvent.ROLL_OUT, navOut);
partners_mc.addEventListener(MouseEvent.CLICK, contentPartners);

tech_mc.buttonMode = true;
tech_mc.addEventListener(MouseEvent.ROLL_OVER, navOver);
tech_mc.addEventListener(MouseEvent.ROLL_OUT, navOut);
tech_mc.addEventListener(MouseEvent.CLICK, contentTech);

accolades_mc.buttonMode = true;
accolades_mc.addEventListener(MouseEvent.ROLL_OVER, navOver);
accolades_mc.addEventListener(MouseEvent.ROLL_OUT, navOut);
accolades_mc.addEventListener(MouseEvent.CLICK, contentAccolades);



function navOver(e:MouseEvent):void {
    e.currentTarget.gotoAndPlay("OVER");
}

function navOut(e:MouseEvent):void {
    e.currentTarget.gotoAndPlay("OUT");
}

function contentManifesto(e:MouseEvent):void {
    var myTween1:Tween = new Tween(content_mc, "x", Strong.easeInOut, content_mc.x, 280, 1, true);
    var myTween2:Tween = new Tween(arrows_mc, "alpha", None.easeNone, 0, 1, 1, true);
    arrows_mc.x = 6;
    arrows_mc.y = 12;
}

function contentTeam(e:MouseEvent):void {
    var myTween1:Tween = new Tween(content_mc, "x", Strong.easeInOut, content_mc.x, -270, 1, true);
    var myTween2:Tween = new Tween(arrows_mc, "alpha", None.easeNone, 0, 1, 1, true);
    arrows_mc.x = 6;
    arrows_mc.y = 30;
}

function contentPartners(e:MouseEvent):void {
    var myTween1:Tween = new Tween(content_mc, "x", Strong.easeInOut, content_mc.x, -820, 1, true);
    var myTween2:Tween = new Tween(arrows_mc, "alpha", None.easeNone, 0, 1, 1, true);
    arrows_mc.x = 6;
    arrows_mc.y = 48;
}

function contentTech(e:MouseEvent):void {
    var myTween1:Tween = new Tween(content_mc, "x", Strong.easeInOut, content_mc.x, -1370, 1, true);
    var myTween2:Tween = new Tween(arrows_mc, "alpha", None.easeNone, 0, 1, 1, true);
    arrows_mc.x = 6;
    arrows_mc.y = 66;
}

function contentAccolades(e:MouseEvent):void {
    var myTween1:Tween = new Tween(content_mc, "x", Strong.easeInOut, content_mc.x, -1920, 1, true);
    var myTween2:Tween = new Tween(arrows_mc, "alpha", None.easeNone, 0, 1, 1, true);
    arrows_mc.x = 6;
    arrows_mc.y = 84;
}

I've also attached the FLA. If anyone has any suggestions or even pointers on a better way to do this, that'd be awesome!

Thanks, guys.

View Replies !    View Related
Button Hit State
hey guys, quick question. I have an mc that is over a button on the mainstage. I have the rollover and rollout script that makes the MC play. Im having problems with the script that makes the mc go to the last frame if the user clicks on the button.

I have tried this,
on release { _root.mc1 (gotoAndStop (8);
}

But as soon as I rollout, the mc plays backwards to frame one.
Ive tried also to remove the rollover script in frame 8, but for some reason this didnt work either??
How can I get the MC to stop at frame 8 with an on release script?
Thanks,
Josh

View Replies !    View Related
Button Dwn State
Hi,

I am having some trouble with my buttons. THe way my navigation is set up is that the buttons are all placed accross the top and then when clicked the playhead moves to a frame with the content on it.

Currently my code is like

on (press) {
_root.gotoAndPlay(17)
}

I want to add some code so that it still does the same thing but the down state stays down until another one is clicked.

Ive looked through some previous threads but cant seem to get a simple bit of code to do this,

any sugesstions?

View Replies !    View Related
HOW DO I KEEP A BUTTON IN DOWN STATE
I have five buttons. I need to program these buttons so that when I click on the button, the information in the down state stays up until another button is pressed. When another button is pressed the information from that down state will stay displayed until I hit another button. PLease help asap!

View Replies !    View Related
Button State
I am creating a three page site (Home, About us, Contact Us) . My buttons (which are movieclips with Event listeners) have roll over, roll out, and button down states. All work properly. I am using the SWF as navigation for HTML site. Here is what I want to do.

I want to use the same SWF on all three pages.
This is an example of what I want to do, on the "Home" page I want to click the "About Us" button (which goes to the mouse down state), and I want the "About Us" page to load and the "About Us" button to be displayed in the button down state on this page. I want this functionality for all buttons on every page using only 1 swf file.

I have seen this done in actionscript 2 (in a template I purchased) using only 1 swf file in html and was wondernig if it could be done in actionscript 3. In the html (in the template) I noticed some extra text embedded the swf. It looked like this...

"<param name="movie" value="flash/header_v81.swf?button=2">"

In the .fla file (using actionscript 2) there is a buton (movieclip) with an instance name of "item2". There is also actionscript on another layer on the main time right after all the buttons load that shows this...

"_root["item"+_root.button].gotoAndPlay("s1");
_root.link=_root.button;"

Inside of the movieclip there is actionscript on a layer that says
"p=2"


I am new to this. and I only have experience with actionscript 3 (very little experience at that).

Basically, I need somewhat specific instructions on how to write actionscript 3 and html code to accomplish what this actionscript 2 code does.

I have heard of two ways of doing this (Flashvars and SWF Object). But all the examples are concerning loading text externally from HTML. And I am not sure if this will do what I am trying to do.


I hope I have given enough info.
Any help would be greatly appreciated.





























Edited: 08/24/2008 at 05:17:49 AM by ampped80

View Replies !    View Related
Button Over STATE
Hi,

Is there a way to have the over state of a button paused when the user is viewing that section?

For example:
I have four buttons all with over states, if the user is in section "3" is it possible to "freeze" that buttons over state while they are in that section? The only way I know how to do this is by creating four frame labels on the main timeline:

LABELS: 1, 2, 3, 4

Thus when the user is on label 3 of the time line, button 3 is merely the graphic representation of button 3's over state.

There must be a better way??

Cheers,
S ^^

View Replies !    View Related
5th Button State
What is the 5th (or more) button state used for?

View Replies !    View Related
Button Down State
Hey Folks,

Just wondering if anyone knows how to make a down state for a button.

Basically, I am making a gallery. There's my index page, and then I load my gallery pages into an empty movie clip on the index page.

I want the buttons to stay ina down state when the user clicks on them...

Any suggestions?

Please & Thanks!!

View Replies !    View Related
Button State
Ok, this might have been asked before, so if it has, just send me to that thread etc.

If not, my question is this: How do I keep a movieclip button to stay in it's hit state after it has been pressed?

For example - Say I have a button that has white text on it, but when you click it, it turns black. Well when you go to that particular section, or click on that button, how do I keep the text black?

Thanks in advance!

Boon.

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved