OnRollOver / onRelease

I guess the easiest way to explain what I want to do is by
showing you what I've done so far:
here
Three things happen on this:
-when you rollover the thumbnails the "experience" that it
relates to lights up at the bottom.
-when you click on an "experience" the thumbnails that have
that experience light up.
-when you hit "reset" no thumbnails are selected.
My problem occurs when you choose an "experience" (and
selected thumbnails light up and others are disabled).
If you RollOver the selected thumbnails that correspond to
that "experience" they return to their original state (i.e.,
alpha=40).
I want them to stay on alpha=100 until the user presses
another "experience" or hits "reset."
My code is really long (not great at Flash, so not sure if it
could be shorter), but the same for each category of buttons.
Here's an example for one of the "experience" buttons:
interact_btn.onRelease = function(){
read_btn._alpha = 40;
see_btn._alpha = 40;
watch_btn._alpha = 40;
listen_btn._alpha = 40;
interact_btn._alpha = 100;
r1_btn._alpha = 40;
r2_btn._alpha = 40;
r3_btn._alpha = 40;
r4_btn._alpha = 40;
s1_btn._alpha = 40;
s2_btn._alpha = 40;
w1_btn._alpha = 40;
w2_btn._alpha = 40;
w3_btn._alpha = 40;
w4_btn._alpha = 40;
l1_btn._alpha = 40;
l2_btn._alpha = 40;
i1_btn._alpha = 100;
i2_btn._alpha = 100;
i3_btn._alpha = 100;
i4_btn._alpha = 100;
r1_btn.enabled = false;
r2_btn.enabled = false;
r3_btn.enabled = false;
r4_btn.enabled = false;
s1_btn.enabled = false;
s2_btn.enabled = false;
w1_btn.enabled = false;
w2_btn.enabled = false;
w3_btn.enabled = false;
w4_btn.enabled = false;
l1_btn.enabled = false;
l2_btn.enabled = false;
i1_btn.enabled = true;
i2_btn.enabled = true;
i3_btn.enabled = true;
i4_btn.enabled = true;
Here's an example for one of the thumbnails:
r1_btn.onRollOver = function(){
this._alpha = 100;
read_btn._alpha = 100;
r1_btn.onRollOut = function(){
this._alpha = 40;
read_btn._alpha = 40;
Thanks for your help.

create a variable...
var allowRollOut = true;
When you click one of the links at the bottom, set that
variable to... = false;
allowRollout = false;
Inside your rollOut function...
r1_btn.onRollOut = function(){
if(allowRollOut){
this._alpha = 40;
read_btn._alpha = 40;
And set it back to true with whatever resets things.
That's just a general solution offering, though it may be all
you need. I can't tell from what I know of what you showed.

Similar Messages

  • Changing onRollOver etc

    Hi there,
    My application has some different states and depending upon
    the state i want the onRollOver, onRelease and onRollOut of my
    movie clips to either be doing something or doing nothing. The
    doing something part is fine, but if I switch to want them to do
    nothing they are still making the little hand appear over them. How
    would I remove this.
    I am guessing making them use AS2 events would be one way,
    but my application doesn't really call for this, is there a way to
    do it?
    Thankyou,
    Nathan Wallis

    If I could, I would like to get further clarification on
    this. I tried using the useHandCursor = false as you suggested in
    some code containing dynamic mc's. Where in the code would you
    place this? Is it part of the mc function? at the top? I just cant
    get it to work.
    Thanks

  • Problem with onRelease and onRollOver

    onRelease doesn't do anything in the following.
    background._visible = false;
    area.onRollOver = function() {
    background._visible = true;
    background.onRollOut = function() {
    background._visible = false;
    background.item.onRelease = function() {
    trace('ok');
    I've tried using delete this.onRollOver, but that didn't seem
    to do much either in this case. How would I go about accomplishing
    what I want?

    even easier then, just ace the tween, and use the _visible
    property to turn it off and on in the postition you set it. The
    trick is to make certain that it's part of the main menu tab, so
    that the hitTest checks all of the area of that menu section, if it
    does not register a hit, then it will close up. This lets the other
    buttons in the sub-mc recieve event notifications, like kg was
    saying above.

  • OnRollOver = onRollOut equivalent

    I'm looking to condense some code on a photo gallery I'm
    working on where I disable the next or previous buttons if there
    isn't a next or previous image to present. I wanted to break away
    from the standard multiple line approach...
    nextBTN_mc.onRollOver = function() {
    this.gotoAndStop(1);
    nextBTN_mc.onRollOut = function() {
    this.gotoAndStop(1);
    nextBTN_mc.onRelease = function() {
    this.gotoAndStop(1);
    or
    nextBTN_mc.onRollOver = function() {
    this.gotoAndStop(1);
    nextBTN_mc.onRollOut = nextBTN_mc.onRollOver;
    nextBTN_mc.onRelease = nextBTN_mc.onRollOver;
    Once upon a time (and I'm not sure where), I saw someone post
    a one line solution to this. Something like (but not):
    nextBTN_mc.onRollOver([{'onRollOut', 'onRelease'}]) =
    function() {
    this.gotoAndStop(1);
    The syntax on the above is of course wrong but the solution I
    saw once was similar to this. The "([{'onRollOut', 'onRelease'}])"
    (or similar) may have been after the function parameters and there
    is probably an operator that I'm forgetting/missing. I've played
    around with it and searched the net but can't seem to get it to
    work or find it.
    Anyways, if anyone out there knows the solution, I'd really
    appreciate a response. It was a very clever, clean and condensed
    solution and I'd love to find it again.
    Take care,
    sej

    sej,
    > Hey blemmo,
    >
    > Thanks for the response. That's pretty cool solution.
    > I never thought of that one.
    blemmo's reply is a good one, and I often use that approach
    when dealing
    with two or three assignments at a time. When it gets up to
    five or more --
    purely arbitrary numbers -- I also like to use a for() loop
    and the array
    access operator.
    http://www.quip.net/blog/2006/flash/actionscript-20/reference-objects-dynamically
    var buttons:Array = new Array("btnA", "btnB", "btnC");
    for (var n:Number = 0; n < buttons.length; n++) {
    this[buttons[n]].onRelease = function() {
    // instructions here
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Movieclip onRelease

    Hi everyone
    my problim is:
    I change my cursor with othe movielip and i want, when i
    rollOver to movieclip wich one has function release, my cursors's
    movieclip make something.
    How to catch wich movieclip has onRelease function?
    Thanks

    if you wanted to add this function to all MCs you could do
    something like that, maybe, not sure if you can prototype an 'on'
    handler. But doing it with a prototype you would still need to add
    the prototype call to each MC/button. However, if all the
    MC/buttons are within another MC you could do something like this
    (where MC is the name of the 'master' container):
    for(var name in MC) {
    if(typeof (MC[name]) == 'movieclip') {
    MC[name].onRollOver = function() {
    //the cursor change code here and other functions
    you can use 'this' instead of 'MC' but it would apply to all
    MCs throughout the doc.

  • OnRelease Behaviour

    Hi, ive been building a fairly large flash app and have
    realised that i cant click on my movieclip buttons more than once
    without first moving the mouse.
    When i test the swf locally i can repeatedly click on my
    movieclips and fire the onRelease handler over and over. As soon as
    i view the swf in a browser ( IE or firefox ) i find that i have to
    move the mouse between clicks.
    I tried to isolate the cause by building a seperate fla with
    a moviclip with onRelease onRollOver and onRollOut handlers but
    this worked fine both locally and in the browser. Next i copied the
    movieclip into a new layer in my original app and the movieclip
    inherited the clicking issue when running in the browser.
    When i first rollover the movieclip the hand symbol appears,
    when i click I see the normal arrow cursor appear whilst i am still
    holding the mouse button down. When i release the button the hand
    cursor reappears but clicking then only works once i move the
    mouse.
    Im using Flash 8 and publishing as a Flash 8 movie. My
    browsers have flash player 9 installed.
    Anybody have any ideas as to what might be happening here, im
    fairly puzzled.
    Thanks

    It is a strange behaviour because a second ago it happened on
    the version online and now it doesnt happen anymore.
    If you try
    http://www.geretti.com/help/weird.swf
    it works just fine, if you compile it it doesnt.
    It's not just a problem that occurs within the flash 8
    editor, but it happens online too of course. But the weird.swf
    doesnt have that issue when used online or outside flash 8. I tried
    this on several different computers and connections, but not on MAC
    environment

  • Problems Overriding setInterval with Button onRelease

    Hi.
    I'm successfully jumping between playing Frame 1 and Frame 2
    using the functions below and setIntervals ...
    ( The following code is in Frame 1 main timeline ... )
    stop();
    / / this advances to the next frame
    var myInterval:Number;
    function proceed() {
    nextFrame();
    clearInterval(myInterval);
    myInterval = setInterval(proceed,15000);
    // The code below is in Frame 2 of the main timeline
    stop();
    // the following function goes back a frame
    var myInterval:Number;
    function receed() {
    clearInterval(myInterval);
    prevFrame();
    myInterval = setInterval(receed,9000);
    Everything gets all jacked up when I try and add a button to
    escape the flipping between Frame 1 and 2 and jump to Frame 5. My
    button is in frame 1. The following script is on Frame 1 of main
    Timeline and instead of going to Frame 5 when the button is pressed
    it just goes to the Next Frame (not overriding setInterval??)
    //FLASH GLOSSY BUTTON
    //designed and developed by [email protected]
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    //functions used for the event handlers
    function over(){
    var myTween:Tween = new
    Tween(this.btn_mask,"_alpha",Strong.easeOut,this.btn_mask._alpha,50,2,true);
    function out(){
    var myTween:Tween = new
    Tween(this.btn_mask,"_alpha",Strong.easeOut,this.btn_mask._alpha,0,2,true);
    function press(){
    this._y +=3;
    this._x +=3;
    // Want to go to Frame 5 on release of button ...
    function release(){
    this._y -=3;
    this._x -=3;
    clearInterval(myInterval);
    gotoAndPlay("5");
    function releaseoutside(){
    var myTween:Tween = new
    Tween(this.btn_mask,"_alpha",Strong.easeOut,this.btn_mask._alpha,0,2,true);
    this._y -=3;
    this._x -=3;
    //button1 events
    btn1.onRollOver = over;
    btn1.onRollOut = out;
    btn1.onPress = press;
    btn1.onRelease = release;
    btn1.onReleaseOutside = releaseoutside;
    Any suggestions?
    Sincerely,
    Paul Cross

    unless your frame is labeled with the string 5, you should
    use:
    gotoAndStop(5).
    and if it is labeled with the string 5 you should change it.
    it's problematic to use flash names that start with a
    number.

  • OnRelease, loops, level10 v level10.button ???

    After looking at some of the previous onRelease/for loop
    topics, I'm still stuck. I have 26 buttons for 26 letters in the
    alphabet. The buttons are defined on the stage already (they look
    like they're drawn in chalk, oh boy!). I'd like to do a loop to set
    onRelease for all the buttons. Each button's instance name is a
    single alphabetic character, which I thought I could use to
    identify which button was pressed ("A", "B", "C"...). So I set up
    this loop:
    for (var thing in this) {
    if (this[thing] instanceof Button) {
    // the alphabet button names are one character long
    if (this[thing]._name.length == 1) {
    this[thing].onRelease = function():Void {
    // thought the button name, which is a letter, would be
    passed as arg
    letterPressed(this._name);
    Unfortunately, the "this" in on release is at level10, not at
    the button level (it's at _level10, not _level10.A, _level10.B,
    etc). It's as if the onRelease was not called in the main timeline,
    and no longer knows what button called it. It's the same as if I
    directly selected the button in the flash editor, and called
    on(release) in the actions panel.
    By the way, I did try setting an id into the button within
    the loop, but that doesn't help, since "this" doesn't point to the
    right thing.
    If I overtly set onRelease like this:
    A.onRelease = function() { trace(this._name)}
    I get "A", which is what I want. So.....how can I set these
    in a loop, but have the onRelease behave like it's set in the
    timeline (which it is), and not as if it's set down in the button?
    It would be really handy if I could use the for loop, and not have
    to call 26 separate onReleases. Any help would be appreciated.
    Thank you.

  • Try this blur tween, onRollOver and RollOut..

    Hello,
    I ff you roll over the first button (red one) ..it will
    increase in size and decrease in Size when roll out.
    This goes well, but when you do it to soon, the startsize is
    to big. Is there a way to get the value of the current
    size when use the RollOut function?
    Also the blur value when tracing this does not work very well
    on the rollout. Sometimes it jumps from 10 to 0 ..
    it should work from 10, to 9, 8, 7,6,5,4,3,2,1,0 ..
    Can someone take a look at this code? I am not sure if i am
    doing it the right way.
    If you place 3 movieclips on your stage and call there
    instance names:
    rood_mc
    oranje_m;
    groen_mc
    and copy this code :
    import flash.filters.BlurFilter;
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var sizeknop:Number = 200;
    var sizeknopstart:Number = 100;
    var speedknop:Number = 2; // 30 frames per seconden.
    var seconden:Boolean = true; // flase = gebruik frames
    p/seconden
    rood_mc.onRollOver = function() {
    var tweenSizeY:Object = new Tween(rood_mc, "_yscale",
    Strong.easeOut, sizeknopstart, sizeknop, speedknop, seconden);
    var tweenSizeX:Object = new Tween(rood_mc, "_xscale",
    Strong.easeOut, sizeknopstart, sizeknop, speedknop, seconden);
    var tweenBlur:Object = new Tween(oranje_mc, "blur",
    Strong.easeOut, 0, 10, 2, true);
    tweenSizeX.onMotionChanged = function() {
    blurwaarde = Math.round(oranje_mc.blur);
    //trace(blurwaarde);
    oranje_mc.filters = [new BlurFilter(blurwaarde, blurwaarde,
    1)];
    blauw_mc.filters = [new BlurFilter(blurwaarde, blurwaarde,
    1)];
    rood_mc.onRollOut = function() {
    var tweenSizeY:Object = new Tween(rood_mc, "_yscale",
    Strong.easeOut, sizeknop, sizeknopstart, speedknop, seconden);
    var tweenSizeX:Object = new Tween(rood_mc, "_xscale",
    Strong.easeOut, sizeknop, sizeknopstart, speedknop, seconden);
    var tweenBlur:Object = new Tween(oranje_mc, "blur",
    Strong.easeOut, 10, 0, 2, true);
    tweenSizeX.onMotionChanged = function() {
    blurwaarde = Math.round(oranje_mc.blur);
    trace(blurwaarde);
    oranje_mc.filters = [new BlurFilter(blurwaarde, blurwaarde,
    1)];
    blauw_mc.filters = [new BlurFilter(blurwaarde, blurwaarde,
    1)];

    Thanks Sulemaan !
    It's working!

  • Playing different Movie Clips onRollover?

    I have several buttons that I would like to play different
    movie clips
    onrollover on the stage. So if button 1 is rolled over it
    plays a clip
    in the lower right corner and when rolled off it stops and if
    button 2
    is rolled over it does the same.
    How is this done?
    Thanks!

    This is the code I am currently using to play and stop a
    movieclip:
    myPlay_btn.addEventListener(MouseEvent.CLICK, playMc);
    myStop_btn.addEventListener(MouseEvent.CLICK, stopMc);
    function playMc(e:MouseEvent):void{
    my_mc.play();
    function stopMc(e:MouseEvent):void{
    my_mc.stop();
    1. How do I drag my movie clips onto the stage, but not have
    them
    display until the button is rolled over?
    2. Would this code just be applied for each button and
    modified from
    CLICK to OnRollover?
    Thanks!!!!
    kglad wrote:
    > assign a rollover listener to button 1 and in its
    listener function apply the play() method to your right corner
    movieclip. likewise for button 2.

  • Simple onRollOver code no longer works?

    I'm really starting to hate AS3. I'm a basic user and I was
    BASCIALLY just starting to get the hang of AS2 when Adobe had to go
    start changing things with AS3.
    grrrr...
    so now:
    mc.onRollOver = over
    function over() {
    this.gotoAndPlay(2)
    No longer works. I'm being told that I need to
    addEventListener('mouseOver',callback_handler)
    I tried throwing that in (not fully understanding it) and now
    the animation for my mc just plays repeatedly nonstop.
    Help?

    I have constructed a simple example below to try and help you
    mate, ignore all the button building bit if you don't need it, it
    is for the example only... Go through it and try and impliment into
    your workings, to be honest, events in AS3 are easier than AS2,
    just gotta get your head around it.
    Simply attach you event listener to your mc, state the event
    object type i.e mouse event, then property i.e. MOUSE_OVER, then
    the event handler, the method with all the functionality to run on
    mouse over...
    Hope it helps,
    Simon

  • Questions about buttons: onRelease and on(release)

    I have been experimenting with buttons lately and am trying to use a function that uses the release mouse event. I was a little confused at first, since I found some tutorials that used onRelease() and some that used on(release) {...can somebody explain the differences to these and how to use either of them?

    if you're using as2, both onRelease and on(release) can be used.  on(release) is attached to the button or movieclip (highly undesirable) and onRelease is attached to a frame using the button/movieclip's instance name:
    // if your objects instance name is your_btn:
    your_btn.onRelease=function(){
    // code here
    if you're using as3, neither will work.

  • Dynamicaly create onRelease event

    Hello,
    I got a problem with dynamicaly assigning the onRelease event on my buttons.
    I got about 45 buttons and I don't want to create 300 lines of code just to create each of the onRelease events on them so I thought about using a loop (for) to pass through them and assigning the onRelease event. This is what I got and thought would work:
    for (var s = 1; s <= _global.NB_SECTIONS; s++) // NB_SECTIONS = 42
        this["btnSalle" + s].onRelease = function(){
            trace(s); // Returns 43
            _global.CURRENT_SECTION = s;
            _root.gotoAndStop("salle");
    Unfortunately, it does go to "salle" (which is a frame), but the CURRENT_SECTION variable is always set to 43! I can't understand why it would give me 43 on any of the section buttons I click (which ranges from 1 to 42). Any idea how I could make this work? I don't like having too much codes in my Flash (I've been using a hell load of loops to make it cleaner).
    Thanks!

    The value of s is not assigned to the buttons, variable is coded into the functions and the function use the value of s at its current value when clicked, not when you assign it in the function.
    If those are button symbols, then you can use their _name(s) to determine the value you are looking for since the _name(s) carry the value you want...
    for (var s = 1; s <= _global.NB_SECTIONS; s++) // NB_SECTIONS = 42
        this["btnSalle" + s].onRelease = function(){
            trace(String(this._name).substr(8));
            _global.CURRENT_SECTION =  Number(String(this._name).substr(8));
            _root.gotoAndStop("salle");
    If they are movieclips used as buttons, then you could assign the s value to a variable ofeach movieclip and use that variable in the functions.

  • Animated drop-down menu buttons won't respond onRelease

    I created a drop-down menu movie clip. Within it are multiple
    buttons which change their alpha values. I'm having an impossible
    time of getting the buttons to respond to an onRelease from the
    maintimeline.
    for instance:
    stop();
    _root.menu_mc.print_btn.onRelease = function(){
    gotoAndStop("print1");
    _root.menu_mc.illustration_btn.onRelease = function(){
    gotoAndStop("illustration1");
    I can't place any code directly on the buttons because later
    in the timeline the actionscript needs to change for the same
    buttons:
    stop();
    _root.menu_mc.print_btn.onRelease = function(){
    gotoAndStop("print2");
    _root.menu_mc.illustration_btn.onRelease = function(){
    gotoAndStop("illustration2");
    }

    i don't think so. Sorry for my ignorance, but the code you
    see is basically the only code I have in the movie.
    menu_mc is located directly on the maintime line. Inside of
    menu_mc are the buttons. If I place a button instance inside of
    menu_mc (and there are not multiple instances of it) I can use an
    onRelease and it works fine.
    I can create an invisible button, place it over the animated
    button and get the onRelease to work, however, since the buttons
    are rollovers, I loose the animation with the invisible button
    covering them up. I can't seem to target multiple instances of the
    same button in the movieclip. is there any way around this?

  • Can we make array of movieclip and use as onrelease function

    var gold:Array = [g1,g2,g3,g4,g5,g6,g7,g8,g9,g10,g11,g12,g13,g14,g15,g16,g17,g18,g19,g20];
    and
    gold.onRelease=function(){
              if(gold._visible==1){
              this.gotoAndStop(2);
              updateScore(500);
              this.enabled=false;

    var gold:Array = [g1,g2,g3,g4,g5,g6,g7,g8,g9,g10,g11,g12,g13,g14,g15,g16,g17,g18,g19,g 20];
    and
    for(var i:Number=0;i<gold.length;i++){
    gold[i].onRelease=function(){
      // it's not clear what you want to do here for each element of gold.

Maybe you are looking for

  • How do I disable context menu hiding?

    When I use many of the javascript rich sites on the 'net, they often have suggestions on the right click menu. Each time I want use anything 'new' (like spelling corrections) in the right click menu (context menu) I have to click "Show All". This suc

  • Dreamweaver Trial Not Functioning

    Hello there. I just downloaded a trial version for Dreamweaver 8 and when I open it, it quits without telling me anything. What could be wrong? I'm using a MacBook Intel-based 10.4 OS Version. Please help.

  • Fontagent Pro 4.0.2 is very slow on importing fonts

    Everytime I try to import fonts into Fontagent, I have to wait a looong time. Importing 16 fonts with about 162 files took about 15(!) minutes. Furthermore, if FAP is unable to import a certain font, it does not display a warning message. Instead it

  • "not on this ipod" missing from ios 6

    Did iPod Touch 4th gen really lose the ability to download previously purchased songs from the Purchased > Not on this iPod screen? The screen is just gone now. in IOS 5 there was a Purchased button at the bottom of the ios iTunes app, now the only P

  • What is grn (goods receipt note report )

    ho to all abap gurus what is goods receipt  note. can u give some theoritical description on this . and pls give coding for grn report pls its urgent points will be rewarded definitely   plsssssssssss and tell the tables reqd and explain th  function