-
ok, i have a trapezoid shape,
i also have a MC that i need to be able to drag around, within this trapezoid. my code is on the MC, its something like this.
Code:
onClipEvent (mouseDown) {
startDrag ("", true);
}
onClipEvent (mouseUp) {
stopDrag ();
if (this.hitTest(_root.zone)) {
stopDrag ();
}
}
'zone' is the shape outside the trapezoid, that i want to contain the MC.
its not happening, what am i doing wrong, is this even possible???....im probably just being stupid, can anyone help me?
Tom
-
You can constrain a drag within the "startDrag()" option
constrain it to a rectangle area
fairly easy to set
hope this helps
gilesb
-
For the trapezoid shape, add these actions:
onClipEvent(mouseOver) {
what_is_bing_dragged.stopDrag();
}
Change what_is_bing_dragged to the instance of what is being dragged.
Might work, might not.
-
gilesB - i know about the constraining to a square, but i need to constrain it to a trapezoid.
NerdInside- on clIpinside(mouseover) isnt a real handler. so i tried this.....
i put this code on the MC -
Code:
onClipEvent (mouseDown) {
startDrag ("", true);
}
onClipEvent (mouseUp) {
stopDrag ();
if (this.hitTest(_root.zone)) {
stopDrag ();
}
}
and i put this on the trapezoid MC
Code:
onClipEvent (enterFrame) {
if (_root.rock.hitTest._root.zone) {
stopDrag ();
}
}
nothing....absoulutley nothing....what am i doing....
....
-
Put this on the trapezoid MC:
onClipEvent (mouseMove) {
what_is_bing_dragged.stopDrag();
}
Sorry.
-
no,
still doesn't work......
baffled...
-
onClipEvent (mouseDown) {
startDrag ("", true);
}
onClipEvent (mouseUp) {
stopDrag ();
}
onClipEvent (mouseMove) {
if (this.hitTest(_root.zone)) {
stopDrag ();
}
}
How about that?
-
mmmmm...kinda works.
but not quite.
its really jerky, don't think it likes the code.
if you drag it, it doesn't go into the shape, but if you click inside the shape, it appears inside the shape.
check it out.
http://<br />
<a rel="nofollow" hre....swf</a><br />
-
It is using hitTest so it will use the code once it hits the movie clip, not whats inside the movie clip (anywhere the MC is, not just what the MC is displaying). Or as is to my understanding.
-
mmm. im confused.
i know it supposed to stop when it hits the MC, thats what i want. but still..its not working.
check out this swf..
http://www30.brinkster.com/mallrat68/test.swf
or the .fla is here
http://www30.brinkster.com/mallrat68/test.fla
?????
am i missing something
-
You have the dot inside the MC, so it is already hitting.
-
yes, but the first swf, where the dot was outside the MC, didn't work either, the drag worked, and the hitTest stopped the draggable MC entering the trapezoid, but if you clicked inside the trapezoid, the MC would enter it. also the draggable MC was really jerky.
-
Thats because of the code. On mouseDown, start drag. That means on moseDown anywhere start the drag. Its better to convert it to a button, then use on(press) on(release) and you can still use the last code but place it on the MC of what you are hittesting.
-
ok so now, ive got this.
on the draggable button, i have this.
Code:
on (press) {
startDrag (this);
}
on (release) {
stopDrag ();
}
and on the MC that i dont want it to enter, i have this
Code:
onClipEvent (mouseMove) {
if (this.hitTest(_root.zone)) {
stopDrag ();
}
}
but it does nothing...doesn't even drag now....
hmmm...confusing.
(thanks for all this help by the way)
-
You have to press on the button, and drag. It should work.
-
-
I can't download your fla
I have no idea what is going on.
-
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|