A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: need help with some script for my menu

  1. #1
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159

    need help with some script for my menu

    alo ever'buddy!

    i'm trying to develop a cool navigation for my site, that involves several buttons, that scale up when you mouse over them, and also have a sorta "word bubble" appear (which has a description of the object you're mousing over).

    we've gotten close with this combo of scripts, as seen here:

    http://www.phausenentertainment.com/...ewmenu-001.swf

    however, within the script, it really only allows for one type of button -- meaning, they'll all look this same, as they do on that site.

    i'll need to have 10 or so buttons a page like this, and each of them need to look completely different (they'll all be about the same size and shape, but different colors and detail, etc).

    i'll also need to place each one by hand, rather than this script which places them a set distance apart, in a horizontal line (like, ill need one in the upper left and one iun the lower right, some on the sides, etc)

    any chance for some help?

    i have the fla file at the link below, incase you need to check it:

    http://www.phausenentertainment.com/...ewmenu-001.fla

    thanks!!
    i'm not new to action scripting. i'm just bad at it.

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Posts
    354
    Well the simple way of doing this would be to make 10 buttons and edit them so that you have a layer with your button on it. on the over part size your button up so it is bigger, then make another layer above this and put a key frame on over and make your bubble appear there with what ever information you want. then all you have to do is drag your bubbles onto the stage were you want them. Like I said this is the simple way of doing it.

  3. #3
    Senior Member
    Join Date
    May 2001
    Location
    Chandigarh
    Posts
    107
    I would agree wiht the above post. That is the way you will have to do it. The code written here is a generic one but what you want is something that is not generic.

    But what i am unhappy about the code written in the FLA is that they have used the onClipEvent(enterFrame) that eats up into the system memory. This could ahve been avoided by the use of code on a button itself.

    Warm regards,

    Pavan
    Pavan Kishore K. S.
    Lead Software Engineer,
    TATA Interactive Systems
    http://www.tatainteractive.com/

  4. #4
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159
    heya guys! thanks for the help on this -- its really buggin me!

    anyway, ive also been working on this in the meantime:

    the code on the spider-looking things (movie clip/buttons) looks like this:

    Code:
    onClipEvent (load) {
        fscommand("allowscale", "false");
        num = 4;
        e = 65;
        c._visible = 0;
        function g(v) {
            v.xF = v.x+random(20)-10;
            v.yF = v.y+random(20)-10;
        }
        for (i=1; i<=num; i++) {
            c.duplicateMovieClip("c"+i, i);
            d = this["c"+i];
            d._x -= e*(i-1);
            d.x = d._x;
            d.y = d._y;
        }
    }
    onClipEvent (enterFrame) {
        // encima -- variable
        tit = 0;
        for (i=1; i<=num; i++) {
            d = this["c"+i];
            // checar
            if (d.encima) {
                s = 180;
                _parent.tit.tit = "item"+i;
            } else {
                s = 100;
                tit++;
            }
            // mov randome
            difX = (d.xF-d._x);
            difY = (d.yF-d._y);
            if (difX<3 || difX>-3) {
                g(d);
            }
            d._x += difX/10;
            d._y += difY/10;
            d._xscale += (s-d._xscale)/5;
            d._yscale += (s-d._yscale)/5;
        }
        if (tit != num) {
            _parent.tit._visible = true;
            _parent.tit._x = _parent._xmouse;
            _parent.tit._y = _parent._ymouse;
        } else {
            _parent.tit._visible = false;
        }
    }

    if i edit the third line from "num = 4;" to just "num = 1;" i only get one button.

    then, back on the scene 1 stage, if i just copy and paste the "spider" and word bubble to another layer, i can place them whereever i want.

    however, when i create the swf -- the original spider button still works properly, but the new one doesnt work properly, as the word bubble is always there (and doesnt move with the cursor), as seen here:

    http://www.phausenentertainment.com/...ewmenu-002.swf


    if you could help me just figure out a way to get this newer spider's word bubble to act like the original one, then i could make multiple copies of the buttons (and just change the original design from a spdier to, say, a butterfly, a bird, and a tree, etc, etc)

    phew!

    thanks again for everything!
    i'm not new to action scripting. i'm just bad at it.

  5. #5
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159
    waitaminute...

    i think i got it!

    the original "word bubble" has an instance name of "tit" (i didnt name it! )

    so, i renamed the newer bubble "tit2" then i went thru the code on the new "spider" and changed every reference from "tit" to "tit2"

    when i did that, i got the following:

    http://www.phausenentertainment.com/...ewmenu-003.swf

    so now, all i have to do is edit the original spider picture for the second button, and ill have two different looking buttons (and, if i repeat the process 10 times, ill have 10 buttons).

    ill work on that in the meantime -- hopefully, our work here is done!!

    but, regardless, i just wanted to thank you both for the much-appreciated help!!!
    i'm not new to action scripting. i'm just bad at it.

  6. #6
    Senior Member
    Join Date
    May 2001
    Location
    Chandigarh
    Posts
    107
    But make sure you duplicate the movie clip before you make the changed for each button, otherwise you will loose the original graphics.

    all the best

    pavan
    Pavan Kishore K. S.
    Lead Software Engineer,
    TATA Interactive Systems
    http://www.tatainteractive.com/

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