Newbie over his head

Hey this is a really helpfull site you have here, but i’m quite new to flash, did a bit of work a couple of years ago but nothing major, now im back and trying to create a menu… I’ve done all the relevant tutorials but cant put the neccessary components together, here is what im trying to create using Flash MX.

A sidebar Menu with a Button, when the user moves the mouse over the button it moves to the right, to reveal a word, which is a link to the webpage on my site. - I know I can get this effect with the “Advanced Rollover” tutorial but I just cant seem to make it work - if anyone can explain, or lead me in the right direction it would be greatly appreciated, thnx.

  • John

Hey, I attached a .zip file with what I think you are trying to do.

There is probably an easier, more efficient way to do it then what I did, but my mind is not thinking straight today with AS.

I hope this at least points you in the right direction though. If you have any questions, don’t hesitate to ask:)

OK thx very very much for your file, and yes thats exactly what I want to do, i’m not an expert at disecting files to find out how it was done, but I’ve done as much as I can, I can figure out the “movie” part, that is the block moving from left to right and back again. However i’m still struggling when it comes to putting that movie over my “button”, and turning my button into a hyperlink. I also don’t understand how, or why there is a page with “Up, Over, Down and Hit” in Layer 1 for the “button”. If I can just understand the basics of how it all works I’ll be able to do it, if there are any tutorials that are relevant I wont have to take up your time :slight_smile: - thx for your help tho m8

  • John

Ok, I will see if I can explain my file.

<B>Layer “Actions”</B> -


//mouse over movie clip to reveal button
_root.slideMc.onRollOver = function() {
	this.gotoAndPlay(2);
};

This allows the movie clip to slide away when your mouse rolls over it.

Layer “MC” - Contains the movie clip that you want to slide away. Frame one of the clip contains a stop() action so it stays over the button. The actions in layer “actions” make this clip play frame 2 - 10 (where the next stop() is located). This tween slides the clip away from over the button.

Layer “Button” -


// when mouse rolls off button, close movie clip to hide
on (rollOut) {
	_root.slideMc.gotoAndPlay(11);
}

These actions are applied to the button tell the movie clip in layer “MC” to play frame 11 through to the next stop() (which is contained in frame 1). This tween slides the movie clip back over the button. It is activated with the mouse rolls off of the button.

Explaining Buttons - Although buttons are slowly being fazed out for dynamic event handlers (the actions I used in layer “actions”), I recommend you start with learning buttons.

To create a button, draw a rectangle (or any shape you want your button to be), select it, then hit F8 and choose the radio button option for “Button”.
Frame
Up - What your button will look like when the mouse is not on it.
Over - What your button will look like when the mouse rolls over it.
Down - What your button will look like when you click it.
Hit - Used mainly for invisible buttons, just insert a keyframe here if you want it to be filled up.

To apply a link to your button that would look like this…


on (release) {
    getURL("www.yoursite.com", "_blank");
}

This tells the button that after you press it it should open up www.yoursite.com in a new window. To open in the same window change “_blank” to “_self”.

If you have anymore questions, don’t hesitate to ask:)

Well I’ve tried for 2 days straight now and still can’t do it… the tutorials make no sence, the problem is you have to goto 4 different tutorials and you have to figure out how they go together (“creatoing the movie clip”, “naming a movie”, “Advances Rollovers” and “tell target”). What I need is a step-by step intruction on one page. I know im being a pain in the butt here but I really want to learn how to do this! -

The main problem I am having is I dont know what to name things, like my movie clip, or my buttons, I finally managed to get the “Advanced Rollovers” tutorial to work for me but I cant use that knowlage to any benefit because it doesnt tell me how to insert the movie I made onto my buttons layer, or how to edit my movie and see my buttons at the same time, so I can make sure they are alligned.

I tried to understand your last message, and believe it or not im quite a smart guy, but I just cant get it through my head, I have no idea how the layers work together, or how to get my movie working on top of my buttons.

I think I could get the “Advanced Rollovers” tutorial changed to what I want to do if I understood a few points-

  1. Layers- The “buttons” layer I think I understand, but the “actionclip” layer im totaly lost on, I dont know how to get the little “instance: movie_actions” circle into my design, or how to work it.

  2. the code does make sence to me, at least the tutorial code does, I dont undertstand the code you told me, thats why im using the tutorials as examples, because I seem to be getting a little bit somewhere lol. anyway I managed to get the animation to occur over my button, but it just played once and that was it, the mouse had nothing to do with it, and I did have a “stop” at the start of my movie.

Im giving myself real headaches with this, your answers have helped alot but im just having a real hard time understanding it all, pls dont give up on me lol, im determined to get this right!!!

  • Thx again for all your time, John

I am not giving up until you get this thing working:P

I am going to try and write up a tutorial in HTML and place a link here. I hope to have that by tonight. I don’t want to take up so much space in my post.

Possibly by the time I finish someone will present a simpler way. I am still braindead here, I know there has to be a simpler way, I just can’t think of it. AHHHHHHH!

Ok, I had some spare time so I finished sooner than expected.

Hidden RollOver Button Tutorial

That is a link to the tutorial I wrote up. I am pretty sure it states every step I took in making the file I sent you.

I hope it helps you out more, if you have any questions about it, or the subject in general, I am here:)

<U>A Little Note</U>
Please note that I did it without using the tellTarget command because tellTarget has been deprecated (fazed out) as of Flash MX, so I didn’t want you to get used to using tellTarget just to end up not being able to use it in the future.

Also, I didn’t include how to have the button be a link or how to use the Up, Over, Down and Hit states, but if you want to know, I can write up another tutorial, or try to explain it here.

OK thanks to your tutorial I finally managed to get it working! and I got my hyperlink to work also… we’re actually getting there lol.

There is just one more thing I noticed, with both our menus (the example you sent me and the one I made) there is one major error, when the user puts the mouse over the button, the pannel will slide, but if the user then moves the mouse off the button to the right hand side, the button will stay “open” (will not slide back) - is there anyway to solve this problem? - Also moving the mouse up and down over the button at a fast rate will have the same effect…

Other than that it works perfectly, thx for everything you’ve done to help me, I really appreciate your efforts!

  • John

Ok, I updated the tutorial with the slide off to the right problem fixed. I didn’t rewrite the whole tutorial, I just added to Step 3.

Hidden onRollOver Button Tutorial

As for the problem of speeding over the button, can’t seem to fix that for some reason. Maybe I need a break or something, this is such an easy problem and I can’t fix it. Argh!

Well I’ll give you some time to think about it… my menu is going well, just started to put the real thing together now, and obviously have a few more questions :slight_smile:

  • is there anything I have to do if I want more than 1 button, im pretty sure I have it worked out, just go from frame 21-30 on rollover, and so on, for all my buttons. Also the buttons I am making will be linking to a page on my website, i’ll prob use a frame system in my HTML, so how do I set up my flash button to link to diff pages?

thx once again for the help m8

I definitely need to let my mind clear. I have a lot on it right now:(

To open up html pages in another frame it would look something like this…


getURL("mypage.html","frameName");

mypage.html = the name of your HTML file.
frameName = The name of the frame you want your HTML file loaded into.

As for multiple buttons, you can use the same exact movie clip you used on your first button, just drag a copy of it out from the library onto the movie where you want it. Give it a new instance name and voila. Of course, it isn’t that easy yet, I have to rework the tutorial again. Argh…haha. I can’t do that tonight though, I will do it tomorrow (Sunday).

That sounds like a good idea, I know my brain is fried, I could do with a break lol, sorry to hear you’ve got problems on your mind… I dont want you to feel like im rushing you. I can work on my HTML for a while. hope your doing better asap.

  • John

Note: I just re-made my menu with your new code, and it didnt fix the error when the user rolls off the button to the right, im sure I got the code right…

(yes I know this is my 3rd post lol) but I had a thought, the error we have been discussing, I think the reason is the sliding image is a button, yes I know thats what I said in my first post, but I dont want the slider to do anything but slide, I think the computer is counting the real button, and the slider as a button, therefore, when the mouse goes over the slider, it re-starts the animation… there must be a simple way to edit it so that the slider is not a button. any ideas?

  • John

Haha, you are not rushing me. Don’t worry.

THe new code I added into my tutorial reads the movie clip as a button, but when you rollover it, it disables it as a button so it closes when you go off to the right side. It works completely fine with me, tried, tested, and true.

Hmmm, I will see if I can develop another way to make this effect. A less complex way.

that would be very helpful, I tried your new code again and im afraid it had no effect, if you want I can e-mail you the .fla file as it is so far, perhaps you can spot the mistake?

  • John

You can post the .fla right here in your next post as a .zip file as an attachment, but if you would feel more comfortable to send it to me in then you can contact me at…

[email protected]

OK check your e-mail… appreciated…

Hey, I was looking at your file, and besides the fact that this button thing is being a pain in the arse, and I realized you said you will be doing frames, so I have a suggestion on changing the button.

My Suggestion: Fading buttons to reveal text instead of sliding ones. This should be much easier than this slide one, and it will allow you to have a small frame, allowing more area for your main text.

If you want to do this instead I will be able to whip up a .fla and try to write a tutorial.

By the way, I wrote something wrong on my tutorial, which is why your button wasn’t working. The enable action on Frame 10 was supposed to be set to “false” instead of “true”…Sorry about that.

You know I have been thinking about the same things, and in fact I already made a version of my menu with fading animations instead of sliding, it worked fine and I undertsand your point about having a larger main body for the actual website, but I really want to try and implement this sliding design, but if that does’nt work I’ll try something different.

As for the error in your script, I knew there must have been one, I looked for it but as im quite new to Flash I didnt spot it, but no matter I have it sorted now, I’m gunna try and get the rest of my buttons working tonight, I’ll send ya a copy of the final version if you want, just to prove it was all worth it lol, im sure its not gunna be the best youve ever seen but I think it’ll make for a good start.

Well once I’m done with this project you’ll prob hear from me some more, but perhaps one day i’ll be on here answering other ppls questions lol…

you’ve been a great help to me over the past few days, not much I can do to thank you, of course I’ll stick a link to your site on my webpage when its done… btw, are you in anyway associated with Kirupa? or do you just answer questions on here?

  • John