I have a layer with the big3 mouse events (down, move, up). This part works alright, but all my check boxes have stalled (they do not display the 'click here' finger, they don't respond to clicks, and when I double click, they turn gray and freeze all mouse functioning within the movie. Not sure if this is because of the mouse events or not.)
Clicking on this first layer creates a second layer that also has mouse events. Once this second layer is loaded, all mouse functioning is diverted to the layer (which is quite small) to the point that buttons don't even respond. I added mouse events to this layer because the first layer wouldn't respond to MouseUp if the mouse landed on one of the smaller layers.
I don't know much about how Flash works with mice. What I want is a movie with checkboxes and buttons and a part of the screen that will respond to mouse events. Should I add a single mouse element to the root?
I tried to make a sample movie for the check boxes, but I have to deconstruct my program bit by bit, which creates all kinds of errors.
As for the mouse getting blocked, that still happens. I moved the mouse listener to the root, and it is the only mouse element. When I click on a button, the mouse listener does not react, which is good. But when I click on a layer that has a smalltext on it, it also does not react, which is bad. How can I make a layer with paint and smalltext elements transparent to the mouse?
Hmm.. I'm not sure what was problem (your 1.st question..) but if you assign mouse action as an element for layer it catches events in whole movie... then if you add mouse onPress/onRelease as a feature events occur in that layer only (no outside press/release is catched).
As for 2.nd post.. I think all events are catched by your mouse listener.. so small text newer gets its own mouseclicks ???
I think you must desingn whole mouse event system with care, so events can be catched by right handlers!?
But if you manage to get sample done, I'll give it more detailed peek
I'll try to re-create the checkbox problem- it is clearly because of the mouse element because if I delete it, then the boxes work just fine.
I attached two movies here-
MouseTest1 shows a layer with a smalltext that is blocking the mousedown event to the root. Click around the movie on and off the box and you'll see what I mean.
MouseTest2 is the same thing with a second mouse listener on the layer. Now, every click gets send to this layer, whether it is on or off the layer.
Here's what I want to happen-
I have several buttons and checkboxes. One part of the screen responds to mouseOn,Move,and Down. If you click on this part of the screen (I'll call it the Screen), the movie will create a small graphic (which I'm using a layer for now) that has a smalltext on it. I need to be able to drag from this graphic/layer to the Screen. I also need to be able to drag from the Screen to the graphic/layer, and between graphics.
While dragging, the movie will draw a line between the start of the drag and the current mouse location, so I will need a MouseMove listener for each of these. How can I do this?
-This would be easy if I could make graphics/layers that are transparent to the mouse, so all mouse events are handled by the Screen.
MouseTest1 shows a layer with a smalltext that is blocking the mousedown event to the root. Click around the movie on and off the box and you'll see what I mean.
If you move mouse element down it catches layer clicks too..
Originally Posted by Sparky23
MouseTest2 is the same thing with a second mouse listener on the layer. Now, every click gets send to this layer, whether it is on or off the layer.
Same here, if you move mouse element down then root gets all clicks...
Originally Posted by Sparky23
Here's what I want to happen-
I have several buttons and checkboxes. One part of the screen responds to mouseOn,Move,and Down. If you click on this part of the screen (I'll call it the Screen), the movie will create a small graphic (which I'm using a layer for now) that has a smalltext on it. I need to be able to drag from this graphic/layer to the Screen. I also need to be able to drag from the Screen to the graphic/layer, and between graphics.
While dragging, the movie will draw a line between the start of the drag and the current mouse location, so I will need a MouseMove listener for each of these. How can I do this?
-This would be easy if I could make graphics/layers that are transparent to the mouse, so all mouse events are handled by the Screen.
Thats beyond my mouse experience... I'm not sure how to get get stuff from layer to another layer or "Screen",.. sure it is possible to drag whole layer or other element but how to draw line while doing that... I have to study the subject little more
Getting there.
The cloned layers won't be draggable themselves, rather, you can drag from a cloned layer, with a line drawn outward, and drop (mouseup) on either a second cloned layer or on the 'screen'
Actionscripting might be only real solution I think,.. or how you are dragging elements now??
I found one tutorial about dragging and dropping with AS3 and I extended it a bit to add somekind of line.
Basic idea is to call elements startDrag() when mouse is pressed and create onMove handler at same time. OnMove handler then draws the line in separate layer (clear, then draw..)
Then when mouse button is released on move handler is removed, elements onDrop is called and line layer is cleared.
I have no idea how you scripting skills are so I dunno if this is any help..
Anyway, modified tutorial code I found is attached to this post. (works only in flash9)
It might be possible to adopt this code to more 3dfa style but it takes some amount of thinking..
I couldn't get that movie to do anything, even in flash9.
I won't be dragging and dropping objects. I just need to keep track of the mouse position as it moves, clicks, and releases. The problem is, if the mouse handler is on the background, it doesn't register MouseUp over SmallText elements. If I put a second mouse handler on the SmallText, the background mouse handler gets ignored.