|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi im new to flash so naturally im having a few proplems that hopefully someone can help me with.
I have two movie clips that i want to associate with the same hitarea so when i roll over the hitarea it plays one and when i click it i want it to play the other but when i put in two variable's to associate the two clips with the hitarea they seem to cancell each other out, plus if i use two hitarea's instead and put them on top of each other they also cancell each other out. I hope this all make's sense to someone. Tks for any help Bryan. |
|
#2
|
|||
|
|||
|
Im pretty stupid, so im probably going to give you the wrong answer and make a fool of myself, but ill try and help anyway.
This is what i thought you could try (i just tried it there and it worked for me):: 1. Create your two movie clips as movie clip symbols in the library 2. Create a button, having your on area and hit areas what you want it to look like before, and the area to be. 3. Insert your movies into the "on" frame, and the, "down" frame. 4. Put the button in the main window place. 5. Export and watch. That worked for me, though i may have not explained it brilliantly, i hope it helps! Fish |
|
#3
|
|||
|
|||
|
No sorry thats not really what i was talking about by doing that it just changes the state of the button. What i want is to have two movie clips use the same hitarea, but invoke two differant actions depending on what you do. ie roll over or click.
If you look at the attachment i put up you will see what i mean. Behind the dot is an invisible hitarea and when you roll over it it plays the movie that expands the button.Now if you click on the blue screen it plays that movie.But what i want is to be able to roll over the dot to expand it and click the dot to play the other movieclip (ie. the blue screen) but you dont seem to be able to have two variables pointing to the same hitarea or have two hitareas sitting on top of each other. Sorry this is so long winded but hopefully it will give a better idea of what i mean. Tks again Bryan. |
|
#4
|
|||
|
|||
|
Could you try having two hit areas.. both in the same place?
Then it would trigger both and it would be like having one? Fish ps: like the two things, the look good when there not working together ![]() |
|
#5
|
|||
|
|||
|
no it doesnt work
|
|
#6
|
|||
|
|||
|
Hi, I'm just signing off so I havent checked your attachment.
Let's say everything is in the top layer of your movie (_root). You drag and drop your two movies from the library. We'll call them one and two, the instance names will be the same. Code:
hitter = _root.createEmptyMovieClip("hitArea", 1);
hitter.beginFill(0x00FF00, 100);
hitter.moveTo(0,0);
hitter.lineTo(100, 0);
hitter.lineTo(100, 100);
hitter.lineTo(0, 100);
hitter.lineTo(0, 0);
hitter.onRollOver = function ()
{
_root.one.gotoAndPlay(1);
};
hitter.onRelease = function ()
{
_root.two.gotoAndPlay("aNamedFrame");
};
The above is pretty straight forward but just in case...it creates a blank movie in _root. For this example I drew a box to give the new movie some dimensions. Then a couple of events are linked to it. One is for when the mouse rolls over it and the second is for when the mouse is clicked on it. As a sidenote putting two movies with events like above on top of each other will work like this...if the bottem movie is showing at all then only the part that shows will react to mouse events. If this is the case then all of the top movie will react to mouse events. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Hit Areas |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|