12 Replies Latest reply on Jul 9, 2009 11:34 AM by kglad

    Buttons Going Cr@zy when you mouse-over!!

    flashQman

      I'm having a really annoying issue that I can't seem to figure out why it's happening.  I setup navigation buttons for a site I'm working.  Using Action Script 2.0 and Caurina Tweener effects.  I've set it up so the buttons shoot out when you mouse over.  The problem is when you hold your cursor to the outer edge of the button it starts jumping rapidly.  I can't seem to figure out why this is or how to stop it.  I'm thinking about maybe putting a stop action when you mouse-out but I can't seem to get that to wrok either.  I might be soing something wrong with that code.  Ifsomeone could please look over my code and let me know what you think the problem is I would really appreciate it.

      import caurina.transitions.*; function _color_splitter(p_value):Array { var nArray:Array = new Array(); if (p_value == null) {   // No parameter passed, so just resets the color   nArray.push({name:"_color_ra", value:100});   nArray.push({name:"_color_rb", value:0});   nArray.push({name:"_color_ga", value:100});   nArray.push({name:"_color_gb", value:0});   nArray.push({name:"_color_ba", value:100});   nArray.push({name:"_color_bb", value:0}); } else {   // A color tinting is passed, so converts it to the object values   nArray.push({name:"_color_ra", value:0});   nArray.push({name:"_color_rb", value:AuxFunctions.numberToR(p_value)});   nArray.push({name:"_color_ga", value:0});   nArray.push({name:"_color_gb", value:AuxFunctions.numberToG(p_value)});   nArray.push({name:"_color_ba", value:0});   nArray.push({name:"_color_bb", value:AuxFunctions.numberToB(p_value)}); } return nArray; } var eIOE = eIOE; var curBtn:Number = 1; var whichNav = nav.red.homeRedTxt; var lastSec = mobHome; var curMiniBtn = null; var category:Boolean = true; buildIn(); //checkIt(); navBuild(); nav.red.homeRedTxt._visible = true; Tweener.addTween(blackOver,{_autoAlpha:0}); Tweener.addTween(vidPlay,{_autoAlpha:0}); function allTitles() { nav.red.contactUsRedTxt._visible = false; nav.red.abouttheRedText._visible = false; nav.red.whatWeveRedTxt._visible = false; nav.red.homeRedTxt._visible = false; } nav.home._visible = false; function buildIn() { Tweener.addTween(mobHome,{_rotation:100, _scale:50, _x:116, _y:1131}); Tweener.addTween(mobHome.logo,{_alpha:0, _y:-306, _x:-406}); //Tweener.addTween(mobHome.mobWater,{_alpha:8, _y:-10, _x:}); Tweener.addTween(mobHome.titleCopy,{_alpha:0, _y:308, _x:-62}); Tweener.addTween(mobHome.bodyCopy,{_alpha:0, _y:346, _x:115}); Tweener.addTween(mobHome.bracket1,{_alpha:0, _x:-277}); Tweener.addTween(mobHome.bracket2,{_alpha:0, _x:646}); // // Tweener.addTween(mobHome,{_rotation:0, _scale:100, _x:520, _y:327, time:1.5, transition:eIOE}); Tweener.addTween(mobHome.logo,{_alpha:100, _y:-260, time:1, transition:eIOE}); Tweener.addTween(mobHome.mobWater,{_alpha:30, _y:-10, time:1, transition:eIOE, delay:.4}); Tweener.addTween(mobHome.titleCopy,{_alpha:100, _y:228, time:1, transition:eIOE, delay:.6}); Tweener.addTween(mobHome.bodyCopy,{_alpha:100, _y:270, time:1, transition:eIOE, delay:.8}); Tweener.addTween(mobHome.bracket1,{_alpha:100, _x:-248, time:1, transition:eIOE, delay:1.1}); Tweener.addTween(mobHome.bracket2,{_alpha:100, _x:480, time:1, transition:eIOE, delay:1.1}); } //switch function checkIt() { switch (curBtn) {   case 1 :    trace("you pressed home");    Tweener.addTween(lastSec,{_rotation:-140, _x:-330, _y:-641, _autoAlpha:0, _scale:50, time:1.5, transition:eIOE});    homeOut();    navBuildOut();    //    Tweener.addTween(mobHome,{_autoAlpha:100});    buildIn();    nav.red.homeRedTxt._visible = true;    nav.home._visible = false;    lastSec = mobHome;    break;   case 2 :    trace("you pressed about");    Tweener.addTween(lastSec,{_rotation:-140, _x:-330, _y:-641, _autoAlpha:0, _scale:50, time:1.5, transition:eIOE});    aboutOut();    navBuildOut();    //    Tweener.addTween(about,{_autoAlpha:100});    buildAbout();    Tweener.addTween(nav.red.abouttheRedText,{_autoAlpha:100, delay:.4});    nav.red.abouttheRedText._visible = true;    nav.about._visible = false;    lastSec = about;    break;   case 3 :    trace("you pressed what we've done");    Tweener.addTween(lastSec,{_rotation:-140, _x:-330, _y:-641, _autoAlpha:0, _scale:50, time:1.5, transition:eIOE});    whatWeveOut();    navBuildOut();    //    Tweener.addTween(whatWevePage,{_autoAlpha:100});    buildWhatWeve();    Tweener.addTween(nav.red.whatWeveRedTxt,{_autoAlpha:100, delay:.4});    nav.red.whatWeveRedTxt._visible = true;    nav.whatWeve._visible = false;    lastSec = whatWevePage;    break;   case 4 :    trace("you pressed contact us");    Tweener.addTween(lastSec,{_rotation:-140, _x:-330, _y:-641, _autoAlpha:0, _scale:50, time:1.5, transition:eIOE});    contactusOut();    navBuildOut();    //    Tweener.addTween(contactUsPage,{_autoAlpha:100});    buildContact();    Tweener.addTween(nav.red.contactUsRedTxt,{_autoAlpha:100, delay:.4});    nav.red.contactUsRedTxt._visible = true;    nav.contactus._visible = false;    lastSec = contactUsPage;    break;   case 5 :    trace("you pressed client");    getURL("http://www.review.mobscene.com", "_blank");    break; } } nav.home.onRelease = function() { curBtn = 1; checkIt(); }; nav.about.onRelease = function() { curBtn = 2; checkIt(); }; nav.whatWeve.onRelease = function() { curBtn = 3; checkIt(); }; nav.contactus.onRelease = function() { curBtn = 4; checkIt(); }; nav.clientLog.onRelease = function() { curBtn = 5; checkIt(); }; //NAV BUILD OUT / BUILD IN  ------ function navBuildOut() { nav.home.enabled = false; nav.about.enabled = false; nav.whatWeve.enabled = false; nav.contactus.enabled = false; nav.clientLog.enabled = false; Tweener.addTween(nav.red,{_rotation:-45, _x:-553, _y:-337, time:1.5, transition:eIOE, onCompelete:function(){allTitles}}); Tweener.addTween(nav.home,{_rotation:-45, _x:-421, _y:-138, time:1.5, transition:eIOE}); Tweener.addTween(nav.about,{_rotation:-45, _x:-426, _y:-97, time:1.5, transition:eIOE, delay:.1}); Tweener.addTween(nav.whatWeve,{_rotation:-45, _x:-413, _y:-36, time:1.5, transition:eIOE, delay:.2}); Tweener.addTween(nav.contactus,{_rotation:-45, _x:-410, _y:18, time:1.5, transition:eIOE, delay:.33}); Tweener.addTween(nav.clientLog,{_rotation:-45, _x:-414, _y:101, time:1.5, transition:eIOE, delay:.4, onComplete:makeGray}); allTitles(); allVis(); navBuild(); } function navBuild() { Tweener.addTween(nav,{_rotation:90, _x:-216, _y:952}); Tweener.addTween(nav.red,{_rotation:90, _x:-349, _y:702}); Tweener.addTween(nav.home,{_rotation:90, _x:-268, _y:553}); Tweener.addTween(nav.about,{_rotation:90, _x:-284, _y:622}); Tweener.addTween(nav.whatWeve,{_rotation:90, _x:-276, _y:656}); Tweener.addTween(nav.contactus,{_rotation:90, _x:-274, _y:703}); Tweener.addTween(nav.clientLog,{_rotation:-45, _x:-220, _y:742}); allTitles(); Tweener.addTween(nav,{_rotation:0, _x:193, _y:390, _color:null, time:.7, transition:eIOE}); Tweener.addTween(nav.red,{_rotation:-360, _x:-43, _y:-135, _color:null, time:1.5, transition:eIOE, onCompelete:function(){allTitles}}); Tweener.addTween(nav.home,{_rotation:-360, _x:-174, _y:19, _color:null, time:1.5, transition:eIOE}); Tweener.addTween(nav.about,{_rotation:-360, _x:-174, _y:72, _color:null, time:1.5, transition:eIOE, delay:.1}); Tweener.addTween(nav.whatWeve,{_rotation:-360, _x:-170, _y:126, _color:null, time:1.5, transition:eIOE, delay:.2}); Tweener.addTween(nav.contactus,{_rotation:-360, _x:-170, _y:179, _color:null, time:1.5, transition:eIOE, delay:.33}); Tweener.addTween(nav.clientLog,{_rotation:-360, _x:-170, _y:232, time:1.5, transition:eIOE, delay:.4}); Tweener.addTween(nav.clientLog,{_color:null, time:1, transition:eIOE, onComplete:makeThemGo}); } function makeThemGo() { nav.home.enabled = true; nav.about.enabled = true; nav.whatWeve.enabled = true; nav.contactus.enabled = true; nav.clientLog.enabled = true; } function makeGray() { Tweener.addTween(nav.home,{_color:0x626262}); Tweener.addTween(nav.about,{_color:0x626262}); Tweener.addTween(nav.whatWeve,{_color:0x626262}); Tweener.addTween(nav.contactus,{_color:0x626262}); Tweener.addTween(nav.clientLog,{_color:0x626262}); } function allVis() { nav.home._visible = true; nav.about._visible = true; nav.whatWeve._visible = true; nav.contactus._visible = true; nav.clientLog._visible = true; } // --------- //ROLLOVER FUNCTIONS // home nav.home.onRollOver = function() { var my_sound:Sound = new Sound(); my_sound.attachSound("over"); my_sound.start(); Tweener.addTween(this,{_x:-138, _y:0, _scale:120, time:0.6, transition:eIOE}); Tweener.addTween(this.shadow1,{_x:18, _y:10, _scale:80, time:0.6, transition:eIOE}); Tweener.addTween(nav.about,{_y:80, time:0.4, transition:eIOE}); Tweener.addTween(nav.whatWeve,{_y:136, time:0.4, transition:eIOE}); Tweener.addTween(nav.contactus,{_y:189, time:0.4, transition:eIOE}); Tweener.addTween(nav.clientLog,{_y:242, time:0.4, transition:eIOE}); Tweener.addTween(this.innerText,{_x:151, _y:-127, _scale:90, time:0.4, transition:eIOE}); }; nav.home.onRollOut = function() { homeOut(); }; function homeOut() { Tweener.addTween(nav.home,{_x:-174, _y:19, _scale:100, time:0.4, transition:eIOE}); Tweener.addTween(nav.home.shadow1,{_x:2, _y:2, _scale:100, time:0.6, transition:eIOE}); Tweener.addTween(nav.about,{_y:70, time:0.4, transition:eIOE}); Tweener.addTween(nav.whatWeve,{_y:126, time:0.4, transition:eIOE}); Tweener.addTween(nav.contactus,{_y:179, time:0.4, transition:eIOE}); Tweener.addTween(nav.clientLog,{_y:232, time:0.4, transition:eIOE}); Tweener.addTween(nav.home.innerText,{_x:28, _y:-38, _scale:100, time:0.4, transition:eIOE}); } // about the mob nav.about.onRollOver = function() { var my_sound:Sound = new Sound(); my_sound.attachSound("over"); my_sound.start(); Tweener.addTween(this,{_x:-124, _y:40, _scale:120, time:0.6, transition:eIOE}); Tweener.addTween(this.shadow1,{_x:18, _y:10, _scale:80, time:0.6, transition:eIOE}); Tweener.addTween(nav.home,{_y:10, time:0.4, transition:eIOE}); Tweener.addTween(nav.whatWeve,{_y:136, time:0.4, transition:eIOE}); Tweener.addTween(nav.contactus,{_y:189, time:0.4, transition:eIOE}); Tweener.addTween(nav.clientLog,{_y:242, time:0.4, transition:eIOE}); Tweener.addTween(this.aboutTheMobtxt,{_x:119, _y:-104, _scale:90, time:0.4, transition:eIOE}); }; function aboutOut() { Tweener.addTween(nav.about,{_x:-170, _y:69, _scale:100, time:0.4, transition:eIOE}); Tweener.addTween(nav.about.shadow1,{_x:2, _y:2, _scale:100, time:0.6, transition:eIOE}); Tweener.addTween(nav.home,{_y:19, time:0.4, transition:eIOE}); Tweener.addTween(nav.whatWeve,{_y:126, time:0.4, transition:eIOE}); Tweener.addTween(nav.contactus,{_y:179, time:0.4, transition:eIOE}); Tweener.addTween(nav.clientLog,{_y:232, time:0.4, transition:eIOE}); Tweener.addTween(nav.about.aboutTheMobtxt,{_x:66, _y:-66, _scale:100, time:0.4, transition:eIOE}); } nav.about.onRollOut = function() { aboutOut(); }; //what weve done nav.whatWeve.onRollOver = function() { var my_sound:Sound = new Sound(); my_sound.attachSound("over"); my_sound.start(); Tweener.addTween(this,{_x:-80, _y:70, _scale:120, time:0.6, transition:eIOE}); Tweener.addTween(this.shadow1,{_x:18, _y:10, _scale:80, time:0.6, transition:eIOE}); Tweener.addTween(nav.about,{_y:69, time:0.4, transition:eIOE}); Tweener.addTween(nav.contactus,{_y:189, time:0.4, transition:eIOE}); Tweener.addTween(nav.clientLog,{_y:242, time:0.4, transition:eIOE}); Tweener.addTween(this.innerText,{_x:115, _y:-107, _scale:90, time:0.4, transition:eIOE}); }; function whatWeveOut() { Tweener.addTween(nav.whatWeve,{_x:-170, _y:126, _scale:100, time:0.4, transition:eIOE}); Tweener.addTween(nav.whatWeve.shadow1,{_x:2, _y:2, _scale:100, time:0.6, transition:eIOE}); Tweener.addTween(nav.about,{_y:70, time:0.4, transition:eIOE}); Tweener.addTween(nav.contactus,{_y:179, time:0.4, transition:eIOE}); Tweener.addTween(nav.clientLog,{_y:232, time:0.4, transition:eIOE}); Tweener.addTween(nav.whatWeve.innerText,{_x:76, _y:-78, _scale:100, time:0.4, transition:eIOE}); } nav.whatWeve.onRollOut = function() { whatWeveOut(); }; //contactUS nav.contactus.onRollOver = function() { var my_sound:Sound = new Sound(); my_sound.attachSound("over"); my_sound.start(); Tweener.addTween(this,{_x:-87, _y:123, _scale:120, time:0.6, transition:eIOE}); Tweener.addTween(this.shadow1,{_x:18, _y:10, _scale:80, time:0.6, transition:eIOE}); Tweener.addTween(nav.home,{_y:15, time:0.4, transition:eIOE}); Tweener.addTween(nav.about,{_y:64, time:0.4, transition:eIOE}); Tweener.addTween(nav.whatWeve,{_y:118, time:0.4, transition:eIOE}); Tweener.addTween(nav.clientLog,{_y:237, time:0.4, transition:eIOE}); Tweener.addTween(this.innerText,{_x:115, _y:-107, _scale:90, time:0.4, transition:eIOE}); }; nav.contactus.onRollOut = function() { contactusOut(); }; function contactusOut() { Tweener.addTween(nav.contactus,{_x:-170, _y:179, _scale:100, time:0.4, transition:eIOE}); Tweener.addTween(nav.contactus.shadow1,{_x:2, _y:2, _scale:100, time:0.6, transition:eIOE}); Tweener.addTween(nav.home,{_y:19, time:0.4, transition:eIOE}); Tweener.addTween(nav.about,{_y:70, time:0.4, transition:eIOE}); Tweener.addTween(nav.whatWeve,{_y:126, time:0.4, transition:eIOE}); Tweener.addTween(nav.clientLog,{_y:232, time:0.4, transition:eIOE}); Tweener.addTween(nav.contactus.innerText,{_x:50, _y:-58, _scale:100, time:0.4, transition:eIOE}); } //client Log In nav.clientLog.onRollOver = function() { var my_sound:Sound = new Sound(); my_sound.attachSound("over"); my_sound.start(); Tweener.addTween(this,{_x:-80, _y:173, _scale:120, time:0.6, transition:eIOE}); Tweener.addTween(this.shadow1,{_x:18, _y:10, _scale:80, time:0.6, transition:eIOE}); Tweener.addTween(nav.home,{_y:15, time:0.4, transition:eIOE}); Tweener.addTween(nav.about,{_y:67, time:0.4, transition:eIOE}); Tweener.addTween(nav.whatWeve,{_y:121, time:0.4, transition:eIOE}); Tweener.addTween(nav.contactus,{_y:174, time:0.4, transition:eIOE}); Tweener.addTween(this.innerText,{_x:121, _y:-108, _scale:90, time:0.4, transition:eIOE}); }; nav.clientLog.onRollOut = function() { Tweener.addTween(this,{_x:-170, _y:232, _scale:100, time:0.4, transition:eIOE}); Tweener.addTween(this.shadow1,{_x:2, _y:2, _scale:100, time:0.6, transition:eIOE}); Tweener.addTween(nav.about,{_y:71, time:0.4, transition:eIOE}); Tweener.addTween(nav.home,{_y:19, time:0.4, transition:eIOE}); Tweener.addTween(nav.whatWeve,{_y:126, time:0.4, transition:eIOE}); Tweener.addTween(nav.contactus,{_y:179, time:0.4, transition:eIOE}); Tweener.addTween(this.innerText,{_x:52, _y:-61, _scale:100, time:0.4, transition:eIOE}); }; // function buildAbout() { mobHome.video.myDisplay.pauseVideo("splashVideo/HJNTIY_Tips_30.flv"); mobHome.video.myDisplay.pauseVideo("splashVideo/SVTF02_NCM.flv"); Tweener.addTween(about,{_alpha:0, _rotation:0, _scale:50, _x:-17, _y:1133}); Tweener.addTween(about.logo,{_alpha:0, _y:-306}); Tweener.addTween(about.mainAboutCopy,{_alpha:0, _y:-26}); Tweener.addTween(about.aboutTitle,{_alpha:0, _y:-141}); Tweener.addTween(about.streetScene,{_rotation:0, _alpha:0, _y:302, _x:-69}); // // Tweener.addTween(about,{_alpha:100, _rotation:0, _scale:100, _x:540, _y:400, time:1.5, transition:eIOE}); Tweener.addTween(about.logo,{_alpha:100, _y:-326, time:1, transition:eIOE}); Tweener.addTween(about.mainAboutCopy,{_alpha:100, _y:-53, time:1, transition:eIOE, delay:.4}); Tweener.addTween(about.aboutTitle,{_alpha:100, _y:-141, time:1, transition:eIOE, delay:.6}); Tweener.addTween(about.streetScene,{_rotation:0, _alpha:100, _y:172, _x:-69, time:1, transition:eIOE, delay:.8}); } var aboutPress = about.mainAboutCopy.mobAboutTxt; //ABOUT INNER CONTENT CODE about.mainAboutCopy.aboutThe.onRelease = function() { Tweener.addTween(aboutPress,{_alpha:0, time:.4}); aboutPress = about.mainAboutCopy.mobAboutTxt; Tweener.addTween(about.mainAboutCopy.txtLine,{_x:-320, time:1}); Tweener.addTween(about.mainAboutCopy.mobAboutTxt,{_alpha:100, time:1.4}); }; about.mainAboutCopy.whatDo.onRelease = function() { Tweener.addTween(aboutPress,{_alpha:0, time:.4}); aboutPress = about.mainAboutCopy.create; Tweener.addTween(about.mainAboutCopy.txtLine,{_x:-178, time:1}); Tweener.addTween(about.mainAboutCopy.create,{_alpha:100, time:1.4}); }; about.mainAboutCopy.whoAre.onRelease = function() { Tweener.addTween(aboutPress,{_alpha:0, time:.4}); aboutPress = about.mainAboutCopy.creds; Tweener.addTween(about.mainAboutCopy.txtLine,{_x:-39, time:1}); Tweener.addTween(about.mainAboutCopy.creds,{_alpha:100, time:1.4}); }; //BUILD CONTACT US function buildContact() { mobHome.video.myDisplay.pauseVideo("splashVideo/HJNTIY_Tips_30.flv"); mobHome.video.myDisplay.pauseVideo("splashVideo/SVTF02_NCM.flv"); Tweener.addTween(contactUsPage,{_alpha:0, _rotation:90, _scale:50, _x:450, _y:941}); Tweener.addTween(contactUsPage.fishLogo,{_alpha:0, _x:-223, _y:-147, _rotation:30}); Tweener.addTween(contactUsPage.contactCopy,{_alpha:0, _x:-10, _y:250, _rotation:30}); // // Tweener.addTween(contactUsPage,{_alpha:100, _rotation:0, _scale:100, _x:240, _y:248, time:1, transition:eIOE}); Tweener.addTween(contactUsPage.fishLogo,{_alpha:100, _scale:100, _rotation:0, _x:-122, _y:-170, time:1, transition:eIOE}); Tweener.addTween(contactUsPage.contactCopy,{_alpha:100, _scale:100, _rotation:0, _x:151, _y:84, time:1, transition:eIOE, delay:.4}); } //BUILD WHAT WEVE function buildWhatWeve() { mobHome.video.myDisplay.pauseVideo("splashVideo/HJNTIY_Tips_30.flv"); mobHome.video.myDisplay.pauseVideo("splashVideo/SVTF02_NCM.flv"); Tweener.addTween(whatWevePage,{_alpha:0, _x:450, _y:941, _rotation:0, _scale:50}); // Tweener.addTween(whatWevePage,{_alpha:100, _rotation:0, _scale:100, _x:322, _y:207, time:1}); }