I posted a thread a few days ago regarding defining the Clickable area or Hit fram of a movie clip, the guy gave me some help-saying that I should use Movie.hitarea or something like that. I worked with it for a hours until I just gave up. He listed all of the stages I needed to take, but as it is I am a visual learner so I really couldn’t grasp how to make another mc and use it as the Hit stage of the button mc I have. So this time I have included a sample of what I intend on doing with my movie clip button. basically I just want it so that the user can rollover the button and roll off it, activating the effect I have created; however, this is not complete without defining the Hit area of the movie clip, nor do I know how to add a hyperlink within the mc. With buttons its different-its easier and rather self explanatory. If anyone could help me by looking at my example I would appreciate it.
-the shogunate (shogun8) :asian:
I’m sorry, I’m not quite understanding what it is you want to do with this fla?
:hr:
well this fla has nothing to do with my site; its just a small example of what I am trying to do with my buttons on my website. Rather than having a boring rollover which is esentially what a normal button is, I have decided to use a movie clip to make the roll overs more fluid, and I have done this. My problem is I don’t know how to define the clickable area on the mc in this example. I know how to do it with a button, but not with a movie clip. I am just trying to define the area around the button so I can add a hyperlink and make it work with the rest of my site. Another guy was helping me with this, but what he told me was really confusing. I just want to see it done on the example I have given. I am just a better visual learner I guess, and that’s how I have learned flash so far.
more specifically can you show me what this guy meant by applying the following to my example?
- make a movieclip that would act as the HIT or 4th frame of a button. Then, place it on the screen along with your movieclip “button” and give it an instance name. Then, set the hitArea property of your movieclip button to equal that new movieclip.
myButton_mc.hitArea = hitArea_mc;
Then myButton_mc is only active in the area occupied by hitArea_mc;
Check out this fla and tell me if this is what you are talking about? if you don’t want to be able to see the size of the hit area of course you could just remove the stroke on the box or make it the same color (black).
:hr:
That’s interesting, I had never heard of movieclip.hitArea before. I looked it up in the AS reference in flash and it says this:
myMovieClip.hitArea
Returns: A reference to a movie clip.
Property; designates another movie clip to serve as the hit area for a button movie clip. If the hitArea property does not exist or is null or undefined, the button movie clip itself is used as the hit area. The value of the hitArea property may be a reference to a movie clip object.
You can change the hitArea property at any time; the modified button movie clip immediately takes on the new hit area behavior. The movie clip designated as the hit area does not need to be visible; its graphical shape, although not visible, is hit-tested. The hitArea property can be read out of a prototype object.
So basically the other guy was telling you to do just this. Create a movie clip that you want to act as your hit area. So that when the mouse hits it it triggers the effect you want. Give it a name. Give your button a name. Then assign the first clip to be the hitArea of your second clip (the button):
//button movie clip hit area = the other movie clip
myButton_mc.hitArea = hitArea_mc;
Hope this helps you!
:hr:
That’s interesting, I had never heard of movieclip.hitArea before. I looked it up in the AS reference in flash and it says this:
myMovieClip.hitArea
Returns: A reference to a movie clip.
Property; designates another movie clip to serve as the hit area for a button movie clip. If the hitArea property does not exist or is null or undefined, the button movie clip itself is used as the hit area. The value of the hitArea property may be a reference to a movie clip object.
You can change the hitArea property at any time; the modified button movie clip immediately takes on the new hit area behavior. The movie clip designated as the hit area does not need to be visible; its graphical shape, although not visible, is hit-tested. The hitArea property can be read out of a prototype object.
So basically the other guy was telling you to do just this. Create a movie clip that you want to act as your hit area. So that when the mouse hits it it triggers the effect on the button that you want. Give it a name. Give your button a name. Then assign the first clip to be the hitArea of your second clip (the button):
//button movie clip hit area = the other movie clip
myButton_mc.hitArea = hitArea_mc;
Hope this helps you!
:hr:
Thats exactly what I want, thanks a lot. But now I have two questions and the first might sound extremely noob like but 1. How do you get the fill and the stroke to be invisible or no-fill/no-stroke. It seems like I can only do one or the other. I am actually going to put a picture behind the links and I don’t want either to show up. 2. How do I make this more button-like, meaning how do I add a hyperlink? Is there a Goto for a movie clip?
- :asian:
Now that I have been looking this over, I am not sure I understand how it quite works. It seems you didn’t use Move.hitarea like the other guy recommended. Can you explain how this works as well?
goto for a hyperlink is simply getURL(“www.websiteblahblah.com”, “_blank”). Use _blank if you want it to open in a separate window. You can also use _parent or _self I think too. Check out the reference guide in flash to be sure.
No I didn’t define the hitArea at all. All i did was draw a rectangle in the same movie clip as the text. I made the rectangle the same color as the background - black. I left the stroke as grey so you could see how big it was. You could remove it if you didn’t want to see it. If you are using a pic or some other thing then you’ll have to make that object a movie clip itself and in the properties change the alpha to 0. This will add a bit to the size/processing speed of your movie I’m told but if you aren’t using it a lot it shouldn’t hurt too much.
If you are still having problems post your fla with the pics as the background and I’ll see what I can do.
:hr:
I always do this method of hitTest, that a way, if the mouse leaves before the animation, it just reverses the animation
Okay now I understand. This is really helpful Here is an updated form of the miniclip. What I am trying to do now is get the movie clip button ( the bigger button you created) to go to the third frame of my movie. I can do this with a regular button with no problem but I don’t know how to do it with a mc. Obviously you can see I made a poor attempt at trying to get it to work. Could you help me out with this on my file?
- :asian:
:hr:
BAH
Wow… thanks lunatic. As for you Zao, I tried opening your button fla but it didn’t work. I would like to look at it though for a second opinion on what I am trying to do. Thanks to you both.
- :asian:
no prob :hr:
Mine is just a different variation of the hitTest animation, it makes for a smoother transition.
Here is the example in MX form.
still cannot open ur fla man…i’m using flash mx
The last one was in mx form…