A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: Barney's tut

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Posts
    138
    Stickman has provided a pretty nice tut on the Barney's navigation technique. http://www.the-stickman.com/tutorial...eys_menu.shtml

    I've downloaded and studied a bit.

    I understand most all of it except when it comes to getting an additional scene to come into view.

    I've found in the code where to add the "number" of scenes and have even made the additional scene button move the menus aside to make space for a "scene 6" (there are 5 given scenes in the tut), but I can't seem to get that 6th scene to physically show up visually. Stickman has an ActionScript calling the separate scenes into view as opposed to one long strip with markers.

    You can see what I've got happening here: http://www.zdezign.com/TESTING/BarneyTUT.htm

    Of course, I've already created the additional scene graphics, basically just duplicated and changed numbers.
    I've placed the additional scene and its sub menu graphics in line with the ones provided in the tut.

    In short, I've gotten it to work with information for the additional scene, it's just that the additional scene itself doesn't slide into view when I press the "scene 6" button. I'm sure it's something obvious I've overlooked, I just can't put a finger to it.

    Has anyone tried this one?

    Thanks for any guidance here.

  2. #2
    Senior Member
    Join Date
    Dec 2000
    Posts
    164
    try changing the variable "box_number" to 6 rather then 5.

    does this help?

    ~MOose

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    138

    Yup, did that.

    SpasticMoose, thanks for the response.

    I did change that variable, and actually that variable refers to the smaller menus inside the larger menus. At least that's my understanding.

    So I have:

    box_x = 50;
    box_y = "50";
    box_number = 6; //<<<<This is the smaller inside menus you see
    line_y = getProperty("/line", _y);
    in_menu = 1;
    Box_RollBack = 0;
    Speed_box = 1.5;
    Speed_menu = 4;
    Current_menu = 1;
    Current_position = 0;
    menu_width = 500;
    menu_number = 6; //<<<<<<This is the BIG MENUs you see
    menu_totalwidth = menu_width*menu_number;
    setProperty ("/menu_1", _x, 0);
    setProperty ("/menu_1", _y, 0);
    tolerance = 1;
    counter = 1;
    while (Number(counter)<=Number(box_number)) {
    setProperty ("box_" add counter, _x, Number(((counter-1)*menu_width))+Number(box_x));
    setProperty ("box_" add counter, _y, box_y);
    set ("box_" add counter add ":in_menu", 1);
    counter = Number(counter)+1;
    }

    Infact, this, according to Stickman, is where he calls the 5 menus. But when I add that 6th one (its MC, its button, and the additional number in the control script), the overall movie slides to where the 6th MC should be, but doesn't call it up visually. So. it's just white there.

    I can see no other referrence to the given number of MCs to be called up into this loop.

    I know it's staring me in the face, I just need another set of eyes to point it out to me. heheh

    Just in case this heps anyone out there, the above code is on the frame of the control script. The code below is inside the control script symbol itself, first frame:

    // *** Move menus
    if (/:menu_rollback eq 1) {
    if (Number(/:menu_difference)<Number(/:tolerance) and Number(/:menu_difference)>Number((0-/:tolerance))) {
    /:menu_rollback = 0;
    /:current_position = (/:destination_menu-1)*/:menu_width;
    counter = 1;
    while (Number(counter)<=Number(/:menu_number)) {
    setProperty ("/menu_" add counter, _x, Number((0-/:current_position))+Number(((counter-1)*/:menu_width)));
    setProperty ("/menu_" add counter, _y, 0);
    counter = Number(counter)+1;
    }
    /:current_menu = /:destination_menu;
    } else {
    /:current_position = /:current_position-(/:menu_difference/(/:speed_menu));
    counter = 1;
    while (Number(counter)<=Number(/:menu_number)) {
    setProperty ("/menu_" add counter, _x, Number((0-/:current_position))+Number(((counter-1)*/:menu_width)));
    setProperty ("/menu_" add counter, _y, 0);
    counter = Number(counter)+1;
    }
    }
    /:menu_difference = /:menu_difference-(/:menu_difference/(/:speed_menu));
    }
    // *** Move boxes
    if (/:Box_RollBack eq 1) {
    counter = 1;
    while (Number(counter)<=Number(/:box_number)) {
    if (eval("/box_" add counter add ":in_menu") eq 1) {
    current_x = ((getProperty ("/box_" add counter,_x)) - ((counter-1)*/:menu_width)) - (0-/:current_position);
    box_difference = current_x-/:box_x;
    setProperty ("/box_" add counter, _x, Number((Number((Number((0-/:current_position))+Number(((counter-1)*/:menu_width))))+Number(/:box_x)))+Number((box_difference//:speed_box)));
    }
    counter = Number(counter)+1;
    }
    }


    The above code is heavier than I can really grasp right now, still learning ActionScript, but may be the answer is there?

    Thanks alot, though, for the reply SpasticMoose. Maybe you can see it sooner or later. If so, please let me know.

    Thanks again.

  4. #4
    Senior Member
    Join Date
    Dec 2000
    Posts
    164
    hmm, i could take some wild guesses like last time.. but i think id progress further if i could actually see the code.

    if you dont mind my e-mail is: spasticmoose@hotmail.com

    unless you really dont wanna send, in that case i suppose i could take a few more wild guesses =]

  5. #5
    Senior Member
    Join Date
    Jan 2001
    Posts
    138

    Heck, I don't mind.

    I don't mind at all since the code is basically exactly like that from Stickman's original tutorial: http://www.the-stickman.com/tutorial...ys_menu.shtml.

    Instead of emailing it, I'll just post it for download that way anyone else who may want to see where I'm at can.

    You can get the file here:
    http://www.zdezign.com/TESTING/OBbarneys6menu1.fla

    Let me know if you have trouble downloading it and I will send it to you after all.

    Thanks again for the continued help.

    I'm curious though, if you don't have Flash on your system, how is this .fla going to help?

  6. #6
    Senior Member
    Join Date
    Dec 2000
    Posts
    164
    k, i cracked the code =D

    after searching through the AS for a while i thought "what if it has nothing to do with the code?" because it was flawless.

    Theres 2 things you must do, first, open up the instance panel, Window > Panels > Instance. Then, when that is up click on menu 6, you will see the original name on the upper part and below that you will see the Behavior part, and below that there is an empty text box with which you should put "menu_6" that is case sensitive so be careful, all the other menus do this but with diff. number. Do the same thing for box 6.

    Now, second step, i might have just screwed this up when i was trying to find the problem.. but edit box 6 and move the upper left corner to the center of the MC (where you see the +) make sure this is in edit mode tho, if you cant see the + then move the menu up a lot, it should appear somewhere =)

    does this make sense??

    also, i noticed that your boxes stick to your menues rather then moving above them at a different rate, do you want to fix this too?

    ~MOose

    btw: why wouldn't i have flash on my system? =)

  7. #7
    Senior Member
    Join Date
    Jan 2001
    Posts
    138

    Smile Woohoo!!

    Nice thinking!!

    Sorry about the "not having Flash" reference. I've been posting this problem on other boards and got you confused with someone else. Sorry.

    You can be satisfied knowing that of all the boards I've posted this on, you're the only one to figure it out! Yay.

    Yes, I would like to know how to make the smaller boxes "float" better at a different rate.


    Woohoo, what bonus! I really appreciate your insight and help.

    Looking forward to the box "float" solution. Thanks.

  8. #8
    Senior Member
    Join Date
    Dec 2000
    Posts
    164
    this ones even easier..

    if i remember correctly..

    goto actions for the first frame on the MC controller. There are 2 parts, Move menus and Move boxes. On the part in Move boxes there is a line thats really long towards the bottom, at the end of this line you will see //:(forget whats here exactly)
    but after the 2 slashes everything will be pink, inbetween each slash type Number( and then after the variable its calling add another ) or just one on the end.

    get it?

    hope that helps =)

    ~MOose

  9. #9
    Senior Member
    Join Date
    Jan 2001
    Posts
    138
    OK, I believe this is the string you were referring to:

    setProperty ("/box_" add counter, _x, Number((Number((Number((0-/:current_position))+Number(((counter-1)*/:menu_width))))+Number(/:box_x)))+Number((box_difference//:speed_box)));

    I put a number 2 in between the two slashes to make it look like this:

    setProperty ("/box_" add counter, _x, Number((Number((Number((0-/:current_position))+Number(((counter-1)*/:menu_width))))+Number(/:box_x)))+Number((box_difference/2/:speed_box)));

    But it had no effect on the "float" feel. Am I not placing the number in the correct place?

    Thanks.


  10. #10
    Senior Member
    Join Date
    Dec 2000
    Posts
    164
    i guess im getting pretty lazy these days.. =)

    you had the right position but i musta said something awkward to get you to think i meant "put a 2 in there"

    instead of:
    setProperty ("/box_" add counter, _x, Number((Number((Number((0-/:current_position))+Number(((counter-1)*/:menu_width))))+Number(/:box_x)))+Number((box_difference/2/:speed_box)));


    try this:
    setProperty ("/box_" add counter, _x, Number((Number((Number((0-/:current_position))+Number(((counter-1)*/:menu_width))))+Number(/:box_x)))+Number((box_difference/Number(/:speed_box))));


    did it do the trick?

    ~MOose




  11. #11
    Senior Member
    Join Date
    Jan 2001
    Posts
    138
    Well of course it did the trick you steely-eyed Flash master.

    I have two last questions for you since you obviously have this script down.

    1. Where do I adjust the "float" rate for the boxes? Is it the (((counter-1)*/:menu_width))))? Changing the -1 to something else?


    2. How would you add more boxes to the give menu?

    If these questions are too much right now, don't sweat them.

    Just figured if anyone was going to be able to tell me, it would be you.

    I consider myself lucky already with the help you've given me. Thanks so much.

  12. #12
    Senior Member
    Join Date
    Jan 2001
    Posts
    138

    Sorry

    I just figured the first question out. Forgot about there being a speed_box option in the control script frame.

    Still would like to know how to add more little boxes to a given menu.

    I suppose I can simply design them into the given MENU mc, but then I'd lose the "float" factor.


    Anyway, if it's not too involved I'd like to know, otherwise, no biggie.

    Again, thanks much for the guidance here.

  13. #13
    Senior Member
    Join Date
    Jan 2001
    Posts
    138

    Doh.

    I just figured the first question out. Forgot about there being a speed_box option in the control script frame.

    Still would like to know how to add more little boxes to a given menu.

    I suppose I can simply design them into the given MENU mc, but then I'd lose the "float" factor.


    Anyway, if it's not too involved I'd like to know, otherwise, no biggie.

    Again, thanks much for the guidance here.

  14. #14
    Senior Member
    Join Date
    Dec 2000
    Posts
    164
    The thing about making a 2nd menu is that your breaking the flow of the code, all of the boxes want to be at 50 _x and with a second i assume you will change that..

    this one shouldnt be too bad, you just need an if statement asking if the counter is at a certain number or not.. if the number is the same as the 2nd box then you need to add however much to the _x position

    do you get what im saying??

    gl

    ~MOose

  15. #15
    Senior Member
    Join Date
    Jan 2001
    Posts
    138

    Ummm

    I don't completely grasp that.

    Where would the if statement go?

    I understand the purpose, and why you need the if statement, I'm just not sure again where to put it.

    In the control script?

  16. #16
    Senior Member
    Join Date
    Dec 2000
    Posts
    164
    in the control MC, first frame under the part that says

    //***Move boxes

    =)

  17. #17
    Senior Member
    Join Date
    Jan 2001
    Posts
    138

    Zzzzzzzzzzzzzzzzz

    I'm zoning. 6 hours of sleep in two days. Not healthy. I'm crashing.

    I'm sure what you're saying is clear, it's just that my AS is turning to mush.

    I'll catch you on the flip side.

    Thanks for all your help so far.

  18. #18
    Houseguy
    Join Date
    Apr 2000
    Posts
    173
    I know this has`nt to do with this menu .. but anyway .. does anyone of you guys know how to get diffrent images instead of just the same movieclip..
    (you could use it to Barneys also in that case )

    http://www.were-here.com/forum/tutor...nus/index.html


  19. #19
    Senior Member
    Join Date
    Jan 2001
    Posts
    138

    ekvall

    Yeah, I tried using that tutorital for my own site. Wanted to have my portfolio items on a sliding menu like that.

    Problem was, as you found out, that particular script utilizes a very nifty way of using duplicated MCs. A nice script, but like you, I couldn't figure out how to work in unique graphics. In my case, I wanted thumbnails of my illustration work to slide by. Each one a different image.

    I can't help on on that tut, but if anyone can SpasticMoose can.

    However, on this Barney's tut, it's very, very simple.

    If you've downloaded the tut and open it up you'll see Stickmans 5 MCs there. Those MCs can easily be a unique image or scene. Same with the smaller box menus inside the larger menu.

    Thanks to SpasticMoose, I now know how to add an unlimited amount of these unique scenes to this movie.

    Now, I'm really pushing this script, and SpasticMoose (heheh), in trying to add additional small menus to each individual larger Menu. That's where I hit a wall.

    SpasticMoose, as you read, suggested an if statement, but me being pretty green to AS, I'm having a hard time writing that statement in. *sigh*

    Anyway, hope this babble helped you.

  20. #20
    Senior Member
    Join Date
    Dec 2000
    Posts
    164

    this ones even easier =)

    hows this?

    [swf width="250" height="150" background="#FFFFFF"]http://www.spasticmoose.com/OBbarneys6menu1[1].swf[/swf]

    i basically made a box and called it '5b' but set the variable name to 'box_7' but the center of all the other menus line up with the upper left corner. So i took this one and dragged it a few hundred pixels to the left. This way it doesnt complicate the actionscript and it works fine, but i wouldnt suggest doing this with a ton of menus because it gets more and more difficult each time.. but too many menus wouldnt look too good imo =)

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