A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Please Help!!!

  1. #1
    Junior Member
    Join Date
    Jun 2008
    Posts
    5

    Please Help!!!

    hey guys.

    Please help me; I cannot figure out how to do this in Actionscript 3.0:

    Using movie clip buttons, how do you get the button to stay in the "mouse over" state after it has been clicked? I do not want the button to do anything at all after it is clicked.

    I found this online and it works perfectly for actionscript 2.0 but i need it in 3.0. anyone know how to do this in 3.0?


    Code:
    MovieClip.prototype.checkMe = function() {
        if (this._currentframe == 2) {
            this.btn.enabled = true;
            this.gotoAndStop(1);
        }
    };
    btn_mc1.btn.onRelease = function() {
               btn_mc1.btn.enabled = false;
        btn_mc2.checkMe();
        btn_mc3.checkMe();
    };
    btn_mc2.btn.onRelease = function() {
        btn_mc2.btn.enabled = false;
        btn_mc1.checkMe();
        btn_mc3.checkMe();
    };
    btn_mc3.btn.onRelease = function() {
        btn_mc3.btn.enabled = false;
        btn_mc2.checkMe();
        btn_mc1.checkMe();
    };
    Thank you!!!

  2. #2
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    Here you are
    If you need any explenation, I've subscribed to this thread, so I'll read anything you say anyway
    Last edited by florianvanthuyn; 07-23-2009 at 07:44 AM.
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

  3. #3
    Junior Member
    Join Date
    Jun 2008
    Posts
    5
    Wow. Thank you so much. It works perfect. Thank you so much!!!!!!! I have been trying to go this for about two weeks.

    i check out your website its pretty good man.

    thanks again.

  4. #4
    Junior Member
    Join Date
    Jun 2008
    Posts
    5
    another question.

    i want each button to go to another "page" (i guess it would be another frame) and i want to be able to go back and forth between pages no matter what page i am on. I have been able to for example get "button a" to go to "page 2" but when i select "button 2" to bring me back to "page 1" i get an error.

    let me know if that makes sense.
    thanks again!

  5. #5
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    Tadaaa!
    Last edited by florianvanthuyn; 07-23-2009 at 07:44 AM.
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

  6. #6
    Junior Member
    Join Date
    Jun 2008
    Posts
    5
    cool. it works. what part of the code is telling it to go to the the different "pages".

    thanks alot!!!

  7. #7
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    Well, if you look inside of the "content" MC, you'll see four labeled frames, the names I gave those frames are used in the script on the main timeline in the "actions" layer.

    It's this line that will make the "content" mc switch frames:

    content.gotoAndStop(e.currentTarget.name);

    The "currentTarget.name" will be the instance name of the button, so "one", "two" or "three".
    The "e" is just the name of the variable declared when the function is called:

    function btnPress(e:MouseEvent):void
    {
    ...
    }
    Last edited by florianvanthuyn; 06-26-2008 at 02:07 PM.
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center