A Flash Developer Resource Site

Results 1 to 16 of 16

Thread: [F8] Please help, I'm gonna commit suicide

  1. #1
    Senior Member
    Join Date
    Oct 2006
    Posts
    193

    [F8] Please help, I'm gonna commit suicide

    I have a problem with an horizontal drop menu, the menu is supposed to appear from left when I click on "menu" and hide again whien I click on "menu", It used to work fine till I've edited the differents buttons in the menu moviclip, please take a look, it's in the french part.


    here's the fla in rar

  2. #2
    Senior Member
    Join Date
    Oct 2006
    Posts
    193
    someone help me please!

  3. #3
    Senior Member
    Join Date
    Oct 2006
    Posts
    193
    it appears by itself, that's the problem in fact, sorry.

  4. #4
    Senior Mamba austriaman's Avatar
    Join Date
    Aug 2004
    Location
    Somewhere over the rainbow
    Posts
    472
    Delete all your code from the menudo-movieclip. Instead, put this on the corresponding frame:
    code:
    menudo.speed = 0;
    menudo.onRelease = function() {
    if (menudo._x>0) {
    menudo.speed -= 640/8;
    } else {
    menudo.speed += 640/8;
    }
    };
    menudo.onEnterFrame = function() {
    this._x += this.speed;
    // ease function
    this.speed *= 0.90;
    };


    And please - don't commit suicide.

  5. #5
    Senior Member
    Join Date
    Oct 2006
    Posts
    193
    thanks a lot, you saved my life!

  6. #6
    Senior Member
    Join Date
    Oct 2006
    Posts
    193

    hum!..this doesn't work actually :(

    I've made what you sais and the horizontal drop menu move correctly from right to left, but now the buttons that ares inside the menu does not work and they don't take me where I'm supposed to go.

    Could you have a last look....my life is still in danger.

    here's it is (in RAR)

  7. #7
    Senior Mamba austriaman's Avatar
    Join Date
    Aug 2004
    Location
    Somewhere over the rainbow
    Posts
    472
    Ok, delete the code I provided. Also delete the code you have on your menu button (instance of "Schalter"). Instead, assign an instance name to "Schalter" and paste this code into the frame that holds the Schalter-button:
    code:
    _root.menudo.speed = 0;
    instancenameofSchalter.onRelease = function() {
    if (_root.menudo._x>0) {
    _root.menudo.speed -= 640/8;
    } else {
    _root.menudo.speed += 640/8;
    }
    };
    _root.menudo.onEnterFrame = function() {
    this._x += this.speed;
    this.speed *= 0.90;
    };



    Sorry about that...

  8. #8
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693
    I couldn't find the menu, the english button didn't work and the francais button just led to an intro which kept looping infinitely...
    mmm signature

  9. #9
    Senior Member
    Join Date
    Oct 2006
    Posts
    193

    ouf!!

    God bless you!

  10. #10
    Senior Member
    Join Date
    Oct 2006
    Posts
    193

    check it! Do you think it's possible to....

    Hey! I've done it, there's still some thing to arrange about fonts but I want to ask you if you think it's possible to make that the buttons stay blue when you're in the selected section.

    exemple: click on french>reportages> pick any...do you see that the button "reportages" is blue just on rollover? Is it possible to make it stay blue when you're in reportages?

    here it is

  11. #11

  12. #12
    Senior Member
    Join Date
    Oct 2006
    Posts
    193
    Hi, thanks for being there, which source code should I provide to make each button change colo when I'm in a specific section? is it too difficult? what do u suggest?


    Panchoskywalker.

  13. #13

  14. #14
    Senior Member
    Join Date
    Oct 2006
    Posts
    193

    right...but...

    Thanks, I did it for "reportages" button, the thing is that there are also other buttons, so what can I do for that "reportages" go back to grey when I click on another button?

    check it

  15. #15
    Senior Mamba austriaman's Avatar
    Join Date
    Aug 2004
    Location
    Somewhere over the rainbow
    Posts
    472
    I guess arrays would be an option.
    What the following code basically does is telling each button to access its correlating element in a predefined array named "myArray":
    code:
    var myArray:Array = new Array("home", "reportages", "voyages", /* etc. */);
    function inArray(ar:Array, search:String) {
    for (var i in ar) {
    var obj = _root[ar[i]];
    if (ar[i] == search) {
    obj.gotoAndStop("blue");
    } else {
    obj.gotoAndStop("grey");
    }
    }
    }
    home.onRelease = function() {
    inArray(myArray, "home");
    };
    reportages.onRelease = function() {
    inArray(myArray, "reportages");
    };
    voyages.onRelease = function() {
    inArray(myArray, "voyages");
    };
    // etc.



    Further reading:
    http://www.kirupa.com/developer/actionscript/array.htm
    http://www.kirupa.com/developer/acti...lues_array.htm

    Hope this helps,
    aut.

  16. #16
    Senior Member
    Join Date
    Oct 2006
    Posts
    193

    interesting...

    Hi, I've tried withe two buttons "voyages" and "reportages", I still don't get that these buttons get grey when I click on the otherone.

    I've put this array in the frame label grey, blue and active. I don't know where does the variable change when I click on a button...do you think I'm doing well?

    I think I've have to ad some code in the active status, so it goes back to grey when the variable change.

    var myArray:Array = new Array("home", "reportages", "voyages", "recherche", "publications", "expo", "bio", "contact");
    function inArray(ar:Array, search:String) {
    for (var i in ar) {
    var obj = _root[ar[i]];
    if (ar[i] == search) {
    obj.gotoAndStop("blue");
    } else {
    obj.gotoAndStop("grey");
    }
    }
    }
    home.onRelease = function() {
    inArray(myArray, "home");
    };
    reportages.onRelease = function() {
    inArray(myArray, "reportages");
    };
    voyages.onRelease = function() {
    inArray(myArray, "voyages");
    };
    recherche.onRelease = function() {
    inArray(myArray, "recherche");
    };
    publications.onRelease = function() {
    inArray(myArray, "publications");
    };
    expo.onRelease = function() {
    inArray(myArray, "expo");
    };
    bio.onRelease = function() {
    inArray(myArray, "bio");
    };
    contact.onRelease = function() {
    inArray(myArray, "contact");
    };



    here's the site


    here's the fla

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