rollover issues [renamed]

March 20, 2010 - 4:30 pm
  • interested in a little help with an issue of having a MC onRollover function which the movie clip would then slide in and display buttons however my buttons have no function after I set the onRollover function for soundtab_mc.


    /////code for slide in effect

    soundtab_mc.onRollOver = over;
    soundtab_mc.onRollOut = out;

    function over() {
    this.gotoAndPlay(6);
    }
    function out() {
    this.gotoAndPlay(11);



    /////these are buttons within the MC called soundtab_mc

    this.soundtab_mc.play_mc.onPress = function() {
    _parent.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
    soundtab_mc.onPressHandler()
    };

    this.soundtab_mc.stop_mc.onPress = function() {
    _parent.sound_mc.sound_obj.stop();
    soundtab_mc.onPressHandler()
    };

    this.soundtab_mc.next_mc.onPress = function() {
    (song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
    _parent.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
    soundtab_mc.onPressHandler()
    };

    this.soundtab_mc.prev_mc.onPress = function() {
    (song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
    _parent.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
    };



    Thanks in advance for any ideas.


  • Im going to dive into this but can you explain the coding so I can grasp this.

    I understand that on function it starts to track the accounts if mouse moves off and on goto and play when on. and after reading in some forums about deletingonEnterframe event to not hog end user computer down but i think that was cleared up by using setInterval instead, correct? so not necessary?

    Also after a button is clicked once within soundtab_mc buttons become disabled if rollOver occurs again. do i need to create another handle for that? to revert it back?


  • okay so this will be a little MC on Maintime line I just cut the whole thing out and made into little .swf so I could up load. I am now having issues with it jumping to frame 15 on rollOver not sure why. and my dam MCbuttons are still not firing. any help is appreciated. thanks.


  • Wierd file says unexpected file format. I am using Flash 8 so dont know why its acting wierd. I will try working with the code you posted. Thanks so much for helping me out on this issue. I have literately been stuck for days on this. A huge CHEERS to you bro.


  • soundtab_mc.play_mc.onRelease = function() {
    this.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
    this.enabled = 0;
    soundtab_mc.stop_mc.enabled = 1;
    //set d to true, so the tab slides back
    d = 1;
    };
    soundtab_mc.stop_mc.onRelease = function() {
    this.sound_mc.sound_obj.stop();
    this.enabled = 0;
    soundtab_mc.play_mc.enabled = 1;
    //set d to true, so the tab slides back
    d = 1;
    };
    soundtab_mc.next_mc.onRelease = function() {
    (song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
    _root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
    //set d to true, so the tab slides back
    d = 1;
    };
    soundtab_mc.prev_mc.onRelease = function() {
    (song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
    _root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
    //set d to true, so the tab slides back
    d = 1;
    };
    ?

    scotty(-:


  • that worked dude.....................................OMG dude you are the shiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiitttttttttttttt tttttt i just have change some things with buttons now and BLAMO. You have taught a great lesson today, i googled some stuff on setInterval and reading about it now thanks for the enlighting. Muchos gracias amigo. I will buy you many beers at the pub if and when I cross the pond that lies between us. YEEYUH SCOTTY ON IT LIKE WHUT. Cheers.


  • what im trying to is have sound on a site have it load and then instead of always having buttons visable have them on a tab that says "sound controls" and when users rollOver it it will slide in and have buttons slide in with it. The music plays fine, and the buttons did work before i decided i wanted to get creative and have them within another MC and have that slide in with them onRollover. thanks for any suggestions.


  • no problem :thumb:


  • If you have rollover actions on the parent ma, all rollover actions of the nested mcs/buttons are 'deleted'. For the parent mc (soundtab) use hitTest() instead.

    scotty(-:


  • I'm not sure, but I think the moment you use the .enabled attribute, Flash sees that instance as a button, please correct me if I'm wrong.
    Without a fla I think the code should read something like:
    startTracking = function () {
    soundtab_mc.onEnterFrame = function() {
    if (this.hitTest(_root._xmouse, _root._ymouse)) {
    this.gotoAndPlay(15);
    delete this.onEnterFrame;
    }
    };
    };


    scotty(-:


  • okay scotty I have implemented using hittest and I am still having some issues with this thing. I have tried doing this dam thing so many ways now and I am near my end as to why I cant get this thing to work. This is my first time using hittest and having buttons within a MC. I have looked at all the forums on kirupa, googled for it and all I come up with is stuff on creating games something that has no relation what I am trying to do with this. soooooo any ideas as to why here is my new code:



    /////code for slide in effect
    var startTracking = function() {
    soundtab_mc.onEnterFrame = function() {
    if(!hitTest(_xmouse,_ymouse,true)) {
    soundtab_mc.enabled = true;

    delete this.onEnterFrame;
    this.gotoAndPlay(15);
    }
    }
    }

    /////code for buttons
    soundtab_mc.play_mc.onRelease = function() {
    this.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
    };
    soundtab_mc.stop_mc.onRelease = function() {
    this.sound_mc.sound_obj.stop();
    };
    soundtab_mc.next_mc.onRelease = function() {
    (song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
    _root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
    };
    soundtab_mc.prev_mc.onRelease = function() {
    (song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
    _root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
    };


    The tab slides in now. and when you attempt to click on a button within MC it doesnt do anything and then the icon for clicking turns into normal cursor. Any ideas? Thanks for the tip I think I am closer and once I grasp this I will throw a party and your invited. Sincerely stumped. MT


  • daaaaaaaaaaaaaaam you are about to have 13K in posts. I just noticed that. Showing alot of love on Kirupa.


  • soundtab_mc.onRollOver = over();
    soundtab_mc.onRollOut = out();

    I donno, but functions should have parenthesis at the end shouldnt they?


  • lmao :lol:


  • The buttons aren't working because the moment you assign the onrelease action they aren't defined yet. I've put them all in frame one, the tween aren't changed.
    For the hitTest code, in this case it's better to use setInterval
    var d = 1;
    function startTracking() {
    if (soundtab_mc.hitTest(_root._xmouse, _root._ymouse) && d) {
    d = 0;
    soundtab_mc.gotoAndPlay(2);
    }
    if (!soundtab_mc.hitTest(_root._xmouse, _root._ymouse)) {
    if (!d) {
    soundtab_mc.gotoAndPlay(15);
    d = 1;
    }
    }
    }
    var delay = setInterval(startTracking, 30);

    scotty(-:


  • gracias amigo. yeah I just recently added the button code all on the stop frame within movie and it worked to. Is your way better? or does it matter? I was looking at mad drop menus and tutorials and they were explaining to have it both ways. Cheers thanks again for the help.


  • weird... try the zip:)

    scotty(-:


  • so to clarify, on parent MC use hittest() to enable rollOver action I want and then on child MC buttons use standard procedure? You are the man been trying to work around this for a mintue. Gracias Amigo.


  • If you have all your code in 1 frame, you have a better view on what you're doing, for me at least, LOL

    scotty(-:







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about rollover issues [renamed] , Please add it free.