[Flashcoders] hitTest unreliability

2009-04-29 Thread Mendelsohn, Michael
Hi list...

[AS2] If I moderately rapidly move the mouse in and out of a ScrollPane 
component, a hitTest on movieclips contained within the ScrollPane won't always 
evaluate correctly.  I can't figure out why it's so unreliable, working only 
about 65% of the time.

The ScrollPane contains a bunch of movieclips, each with the onRollOut function 
attached:

if(this._parent.hitTest(_root._xmouse, _root._ymouse)==false){
O.UI.firstLevelMenu.flmSP.content.topicSynopsis.removeMovieClip();
}

Any thoughts?
- Michael M.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] hitTest unreliability

2009-04-29 Thread Paul Steven
If possible then perhaps increasing the frame rate, the theory being that
there will be more tests going on and less likely the mouse has moved
outside the hit area before the test is performed. I guess increasing the
frame rate may not be an option. 

Hope that helps

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Mendelsohn,
Michael
Sent: 29 April 2009 14:29
To: Flash Coders List
Subject: [Flashcoders] hitTest unreliability

Hi list...

[AS2] If I moderately rapidly move the mouse in and out of a ScrollPane
component, a hitTest on movieclips contained within the ScrollPane won't
always evaluate correctly.  I can't figure out why it's so unreliable,
working only about 65% of the time.

The ScrollPane contains a bunch of movieclips, each with the onRollOut
function attached:

if(this._parent.hitTest(_root._xmouse, _root._ymouse)==false){
O.UI.firstLevelMenu.flmSP.content.topicSynopsis.removeMovieClip();
}

Any thoughts?
- Michael M.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] hitTest unreliability

2009-04-29 Thread allandt bik-elliott (thefieldcomic.com)
my guess is that you're actually passing over the whole clip you're
hitTesting against in the time it takes for the frame to go by - you could
try saving the previous mouseposition and the current mouseposition and then
testing to see if the path between them crosses your clip

On Wed, Apr 29, 2009 at 2:29 PM, Mendelsohn, Michael 
michael.mendels...@fmglobal.com wrote:

 Hi list...

 [AS2] If I moderately rapidly move the mouse in and out of a ScrollPane
 component, a hitTest on movieclips contained within the ScrollPane won't
 always evaluate correctly.  I can't figure out why it's so unreliable,
 working only about 65% of the time.

 The ScrollPane contains a bunch of movieclips, each with the onRollOut
 function attached:

 if(this._parent.hitTest(_root._xmouse, _root._ymouse)==false){
O.UI.firstLevelMenu.flmSP.content.topicSynopsis.removeMovieClip();
 }

 Any thoughts?
 - Michael M.

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] hitTest unreliability

2009-04-29 Thread Mendelsohn, Michael
Thanks for the responses.  I think this is probably the solution because when I 
set the framerate to 1fps, it always errorred.

Thanks
- MM


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] hitTest vs onRollOver/onRollOut

2006-05-22 Thread phaedrus
Thanks a bunch for the info! I'm surprised to hear that the hitTest actually
performs better, although I agree that the things I may have to add will
more than balance it out. 

Basically, I'm trying to grow my own button class which has disabled and
on/off states in addition to rollover and press.  I'd like to be able to use
hitTests rather than rollover and rolloff because I frequently run into
situations where I want to put a button inside a movie which itself may have
rollover or rolloff event handlers and the event doesn't reach my button.

I like the hit test approach, but if there was a significant performance
concern, I was going to have to consider another way of going about it.

I've found some AS2.0 classes at
http://www.senocular.com/flash/actionscript.php which may do part of what I
need.  The main trick now is to figure out how to make a nice packaged
component that allows a designer to modify the look without having to do too
much work.

I hope to figure out how to deliver them similar to Elvis Mehmedovic's work
(http://chq.emehmedovic.com/) where all the elements are readily available
in the flash movie for tweaking if necessary.

- phaedrus

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tyler Wright
Sent: Friday, May 19, 2006 11:02 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] hitTest vs onRollOver/onRollOut

phaedrus,

You will find that, in the beginning, the hitTests will use up less
processor (better performance). The examples you have below, for example.
However, if you program all the logic you'd need to behave exactly as the
other method (keeping track of all the details, etc) you'll quickly begin to
match the performance and it may end up not being worth the time and bugs
anymore. I still want to build a hitTest solution, mostly for my own
enjoyment, that will at least have equal performance if not better. But it
becomes harder for other developers to work with non-standard inventions,
cool as they may be, and eventually people just get frustrated with your
code.

If it's just for you or you don't plan and building a full mouse-behavior
replacement, try experimenting with _dropTarget ... there's some
possibilities there ;)


good luck,
Tyler


On 5/17/06, phaedrus [EMAIL PROTECTED] wrote:

 Does anyone know if there is a performance difference between hitTest and
 onRollOver/onRollOut?

 For instance, if I had 100 movie clips on a lower-spec computer, would
 there
 be a notable processing difference between these two approaches:

 myMC.onMouseMove = function() {
 if(this.hitTest(_root._xmouse,_root._ymouse,true)) {
 trace(Roll Over);
 } else {
 trace(Roll Out);
 }
 }

 Or

 myMC.onRollOver = function() {
 trace(Roll Over);
 }
 myMC.onRollOut = function() {
 trace(Roll Out);
 }

 I've also got some concerns regarding using _root._xmouse (etc) based on
 the
 comments at:


http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/js/html/wwhelp.ht
 m?href=Part4_ASLR2.html
 but I've not yet looked to deeply into working around it (presumably by
 not
 using _root).  However, if anyone knows that the situation is
 unresolvable,
 that'd be good to know.

 - phaedrus


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] hitTest vs onRollOver/onRollOut

2006-05-22 Thread Tyler Wright

The main thing that can really add up in processor is the number of
MovieClips at the same level (sharing the same parent). You'll save
processor best if you don't have any on-event events as well, such as
onPress, etc. It's because Flash spends a lot on keeping up with it.

It's really fun to play with ... I had a system that used _droptarget to get
the topmost movieclip and dispatch events up it's parent chain much like AS3
does now. However, the processor was not too friendly, but I know I could do
a lot more viable solution now-days. Let us know how it goes!

Tyler

On 5/22/06, phaedrus [EMAIL PROTECTED] wrote:


Thanks a bunch for the info! I'm surprised to hear that the hitTest
actually
performs better, although I agree that the things I may have to add will
more than balance it out.

Basically, I'm trying to grow my own button class which has disabled and
on/off states in addition to rollover and press.  I'd like to be able to
use
hitTests rather than rollover and rolloff because I frequently run into
situations where I want to put a button inside a movie which itself may
have
rollover or rolloff event handlers and the event doesn't reach my button.

I like the hit test approach, but if there was a significant performance
concern, I was going to have to consider another way of going about it.

I've found some AS2.0 classes at
http://www.senocular.com/flash/actionscript.php which may do part of what
I
need.  The main trick now is to figure out how to make a nice packaged
component that allows a designer to modify the look without having to do
too
much work.

I hope to figure out how to deliver them similar to Elvis Mehmedovic's
work
(http://chq.emehmedovic.com/) where all the elements are readily available
in the flash movie for tweaking if necessary.

- phaedrus

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tyler
Wright
Sent: Friday, May 19, 2006 11:02 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] hitTest vs onRollOver/onRollOut

phaedrus,

You will find that, in the beginning, the hitTests will use up less
processor (better performance). The examples you have below, for example.
However, if you program all the logic you'd need to behave exactly as the
other method (keeping track of all the details, etc) you'll quickly begin
to
match the performance and it may end up not being worth the time and bugs
anymore. I still want to build a hitTest solution, mostly for my own
enjoyment, that will at least have equal performance if not better. But it
becomes harder for other developers to work with non-standard inventions,
cool as they may be, and eventually people just get frustrated with your
code.

If it's just for you or you don't plan and building a full mouse-behavior
replacement, try experimenting with _dropTarget ... there's some
possibilities there ;)


good luck,
Tyler


On 5/17/06, phaedrus [EMAIL PROTECTED] wrote:

 Does anyone know if there is a performance difference between hitTest
and
 onRollOver/onRollOut?

 For instance, if I had 100 movie clips on a lower-spec computer, would
 there
 be a notable processing difference between these two approaches:

 myMC.onMouseMove = function() {
 if(this.hitTest(_root._xmouse,_root._ymouse,true)) {
 trace(Roll Over);
 } else {
 trace(Roll Out);
 }
 }

 Or

 myMC.onRollOver = function() {
 trace(Roll Over);
 }
 myMC.onRollOut = function() {
 trace(Roll Out);
 }

 I've also got some concerns regarding using _root._xmouse (etc) based on
 the
 comments at:



http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/js/html/wwhelp.ht
 m?href=Part4_ASLR2.html
 but I've not yet looked to deeply into working around it (presumably by
 not
 using _root).  However, if anyone knows that the situation is
 unresolvable,
 that'd be good to know.

 - phaedrus


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] hitTest vs onRollOver/onRollOut

2006-05-17 Thread phaedrus
Does anyone know if there is a performance difference between hitTest and
onRollOver/onRollOut?

For instance, if I had 100 movie clips on a lower-spec computer, would there
be a notable processing difference between these two approaches:

myMC.onMouseMove = function() { 
if(this.hitTest(_root._xmouse,_root._ymouse,true)) {
trace(Roll Over);
} else {
trace(Roll Out);
}
}

Or

myMC.onRollOver = function() {
trace(Roll Over);
}
myMC.onRollOut = function() {
trace(Roll Out);
}

I've also got some concerns regarding using _root._xmouse (etc) based on the
comments at:
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/js/html/wwhelp.ht
m?href=Part4_ASLR2.html
but I've not yet looked to deeply into working around it (presumably by not
using _root).  However, if anyone knows that the situation is unresolvable,
that'd be good to know.

- phaedrus



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] hitTest difference between attached mc and one placed on stage in authoring

2006-04-24 Thread Paul Steven
I am having problems making the hitTest function work with a movie clip
attached from the library

Basically I am making a game that involves a dolphin swimming up a river and
I want to detect when the dolphin hits the river bank.

The following works fine when the dolphin is placed on stage in authoring
mode

if(mcBanks.hitTest(mcDolphin._x, mcDolphin._y, true){

//doplhin has hit

}

See http://www.mediakitchen.co.uk/dolphin.html

Whereas when I attach the dolphin using attachMovie it does not work and
infact detects a collision at all times:

See See http://www.mediakitchen.co.uk/dolphin_new.html

Any ideas why this should not work when the dolphin is attached.

Here is a link to the fla incase you should want to see the code

http://www.mediakitchen.co.uk/dolphin_new.zip

Any advice much appreciated

Thanks

Paul

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] hitTest difference between attached mc and one placedon stage in authoring

2006-04-24 Thread Bernard Visscher
Hi Paul,

The problem is that you attach it as Player_Object and refer to it as
mcDolphin.

Changing:
if (game_mc.bg_mc.hitTest(game_mc.mcDolphin._x, game_mc.mcDolphin._y, true))
{
Into:
if (game_mc.bg_mc.hitTest(game_mc.Player_Object._x,
game_mc.Player_Object._y, true)) { 

Solves the problem.

Greetz,

Bernard

 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] Namens Paul Steven
 Verzonden: maandag 24 april 2006 16:37
 Aan: Flashcoders mailing list
 Onderwerp: [Flashcoders] hitTest difference between attached 
 mc and one placedon stage in authoring
 
 I am having problems making the hitTest function work with a 
 movie clip attached from the library
 
 Basically I am making a game that involves a dolphin swimming 
 up a river and I want to detect when the dolphin hits the river bank.
 
 The following works fine when the dolphin is placed on stage 
 in authoring mode
 
 if(mcBanks.hitTest(mcDolphin._x, mcDolphin._y, true){
 
 //doplhin has hit
 
 }
 
 See http://www.mediakitchen.co.uk/dolphin.html
 
 Whereas when I attach the dolphin using attachMovie it does 
 not work and infact detects a collision at all times:
 
 See See http://www.mediakitchen.co.uk/dolphin_new.html
 
 Any ideas why this should not work when the dolphin is attached.
 
 Here is a link to the fla incase you should want to see the code
 
 http://www.mediakitchen.co.uk/dolphin_new.zip
 
 Any advice much appreciated
 
 Thanks
 
 Paul
 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training 
 http://www.figleaf.com http://training.figleaf.com
 

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] hitTest difference between attached mc and oneplacedon stage in authoring

2006-04-24 Thread Paul Steven
Thanks Bernard - well spotted! I discovered this too but unfortunately this
is only a test movie to try and work out why my main game movie is not
working.

With the test movie - I can replicate the problem if I move the game_mc
movie clip across to the left. Currently it is positioned with an x position
of -105.6

However if you move the game_mc over to the left so it is -235.6 then the
collision detection stops working. I believe the problem with my main movie
is something to do with this.

Any ideas?

Thanks

Paul

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Bernard
Visscher
Sent: 24 April 2006 17:00
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] hitTest difference between attached mc and
oneplacedon stage in authoring


Hi Paul,

The problem is that you attach it as Player_Object and refer to it as
mcDolphin.

Changing:
if (game_mc.bg_mc.hitTest(game_mc.mcDolphin._x, game_mc.mcDolphin._y, true))
{
Into:
if (game_mc.bg_mc.hitTest(game_mc.Player_Object._x,
game_mc.Player_Object._y, true)) {

Solves the problem.

Greetz,

Bernard

 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Namens Paul Steven
 Verzonden: maandag 24 april 2006 16:37
 Aan: Flashcoders mailing list
 Onderwerp: [Flashcoders] hitTest difference between attached
 mc and one placedon stage in authoring

 I am having problems making the hitTest function work with a
 movie clip attached from the library

 Basically I am making a game that involves a dolphin swimming
 up a river and I want to detect when the dolphin hits the river bank.

 The following works fine when the dolphin is placed on stage
 in authoring mode

 if(mcBanks.hitTest(mcDolphin._x, mcDolphin._y, true){

 //doplhin has hit

 }

 See http://www.mediakitchen.co.uk/dolphin.html

 Whereas when I attach the dolphin using attachMovie it does
 not work and infact detects a collision at all times:

 See See http://www.mediakitchen.co.uk/dolphin_new.html

 Any ideas why this should not work when the dolphin is attached.

 Here is a link to the fla incase you should want to see the code

 http://www.mediakitchen.co.uk/dolphin_new.zip

 Any advice much appreciated

 Thanks

 Paul

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] hitTest difference between attached mc andoneplacedon stage in authoring

2006-04-24 Thread Paul Steven
Here is the test movie to illustrate the problem

http://www.mediakitchen.co.uk/dolphin_new.html

I have stopped the scrolling to make it easier to see the problem. It is
detecting a hit when the dolphin is not touching a river bank.

Do I need to do some sort of localToGlobal conversion?

Thanks

Paul

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Paul
Steven
Sent: 24 April 2006 17:55
To: Flashcoders mailing list
Subject: RE: [Flashcoders] hitTest difference between attached mc
andoneplacedon stage in authoring


Thanks Bernard - well spotted! I discovered this too but unfortunately this
is only a test movie to try and work out why my main game movie is not
working.

With the test movie - I can replicate the problem if I move the game_mc
movie clip across to the left. Currently it is positioned with an x position
of -105.6

However if you move the game_mc over to the left so it is -235.6 then the
collision detection stops working. I believe the problem with my main movie
is something to do with this.

Any ideas?

Thanks

Paul

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Bernard
Visscher
Sent: 24 April 2006 17:00
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] hitTest difference between attached mc and
oneplacedon stage in authoring


Hi Paul,

The problem is that you attach it as Player_Object and refer to it as
mcDolphin.

Changing:
if (game_mc.bg_mc.hitTest(game_mc.mcDolphin._x, game_mc.mcDolphin._y, true))
{
Into:
if (game_mc.bg_mc.hitTest(game_mc.Player_Object._x,
game_mc.Player_Object._y, true)) {

Solves the problem.

Greetz,

Bernard

 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Namens Paul Steven
 Verzonden: maandag 24 april 2006 16:37
 Aan: Flashcoders mailing list
 Onderwerp: [Flashcoders] hitTest difference between attached
 mc and one placedon stage in authoring

 I am having problems making the hitTest function work with a
 movie clip attached from the library

 Basically I am making a game that involves a dolphin swimming
 up a river and I want to detect when the dolphin hits the river bank.

 The following works fine when the dolphin is placed on stage
 in authoring mode

 if(mcBanks.hitTest(mcDolphin._x, mcDolphin._y, true){

 //doplhin has hit

 }

 See http://www.mediakitchen.co.uk/dolphin.html

 Whereas when I attach the dolphin using attachMovie it does
 not work and infact detects a collision at all times:

 See See http://www.mediakitchen.co.uk/dolphin_new.html

 Any ideas why this should not work when the dolphin is attached.

 Here is a link to the fla incase you should want to see the code

 http://www.mediakitchen.co.uk/dolphin_new.zip

 Any advice much appreciated

 Thanks

 Paul

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] hitTest difference between attached mcandoneplacedon stage in authoring

2006-04-24 Thread Paul Steven
OK I think I have cracked it! I was going in the right direction earlier
with the localToGlobal thing

This is what I have done to fix it

[code]
var myPoint = new Object();
myPoint.x = _parent.game_mc.player_mc._x;
myPoint.y = _parent.game_mc.player_mc._y;

trace (myPoint.x before =  + myPoint.x);
trace (myPoint.y before =  + myPoint.y);

_parent.game_mc.localToGlobal(myPoint);

trace (myPoint.x after =  + myPoint.x);
trace (myPoint.y after =  + myPoint.y);

if (_level0.game_mc.bg_mc.hitTest(myPoint.x, myPoint.y, 
true)) {
trace (HIT RIVER BANK );
}

[/code]

Thanks for all the help. What a waste of a day trying to fix one bug!!



Hi Paul,

The problem is that you attach it as Player_Object and refer to it as
mcDolphin.

Changing:
if (game_mc.bg_mc.hitTest(game_mc.mcDolphin._x, game_mc.mcDolphin._y, true))
{
Into:
if (game_mc.bg_mc.hitTest(game_mc.Player_Object._x,
game_mc.Player_Object._y, true)) {

Solves the problem.

Greetz,

Bernard

 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Namens Paul Steven
 Verzonden: maandag 24 april 2006 16:37
 Aan: Flashcoders mailing list
 Onderwerp: [Flashcoders] hitTest difference between attached
 mc and one placedon stage in authoring

 I am having problems making the hitTest function work with a
 movie clip attached from the library

 Basically I am making a game that involves a dolphin swimming
 up a river and I want to detect when the dolphin hits the river bank.

 The following works fine when the dolphin is placed on stage
 in authoring mode

 if(mcBanks.hitTest(mcDolphin._x, mcDolphin._y, true){

 //doplhin has hit

 }

 See http://www.mediakitchen.co.uk/dolphin.html

 Whereas when I attach the dolphin using attachMovie it does
 not work and infact detects a collision at all times:

 See See http://www.mediakitchen.co.uk/dolphin_new.html

 Any ideas why this should not work when the dolphin is attached.

 Here is a link to the fla incase you should want to see the code

 http://www.mediakitchen.co.uk/dolphin_new.zip

 Any advice much appreciated

 Thanks

 Paul

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] hitTest

2006-03-26 Thread riccardo.roasio
Is possible to use hitTest function to check if a particolar pixel is inside 
a run-time created shape?

Thanks
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] hitTest

2006-03-26 Thread Adrian Park
Hi Riccardo,

You can use the following form of hitTest for this:

MovieClip.hitTest (x, y, shapeFlag );

In your case, the MovieClip will be the movie clip in which you've drawn the
shape and x and y will be the coordinates of your pixel (in the global
coordinate space).

shapeFlag is an optional parameter - if set to 'true' the entire shape is
evaluated and if set to 'false' the shapes bounding box is evaluated.

HTH
Adrian P



On 3/26/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Is possible to use hitTest function to check if a particolar pixel is
 inside
 a run-time created shape?

 Thanks
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] hitTest

2006-03-26 Thread riccardo.roasio
It return me always true...is it possible???
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] hitTest

2006-03-26 Thread Adrian Park
Hi Riccardo,

I'd have to see a sample of your code and/or the .fla to work out exactly
what's happening. I'm going away for holiday for a week from tomorrow so
won't be able to help out with this. I hope someone else can help you out.

Good luck!

Adrian P


On 3/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 It return me always true...is it possible???
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] hitTest

2006-03-26 Thread riccardo.roasio
Here is my code :

this.createEmptyMovieClip(tempShape,20,1):
tempShape.lineStyle...
tempShape.moveTo(x1,y1):
tempShape.lineTo
...

this tempShape is a shape with a strange form...
i need to know if a particualr pixel hit this shape

for(i=0:in:i++)
{
for(y=0:ym:y++)
{

if(tempShape.hitTest(i,y,false)
{
//do something
}

}
}
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] hitTest

2006-03-26 Thread Yotam Laufer
Try this:

tempShape.hitTest(tempShape._x + i,tempShape._y + y,false)

I believe you need to check the coordinates as in the parent's scope.

Yotam.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

[Flashcoders] hittest

2006-03-16 Thread lieven.cardoen
If I do something like this :drop.hitTest(_root._xmouse,
_root._ymouse, true);

 

Does this always work, no matter where drop is created (in a movieclip
on position xy, on the root, ...)

 

Met vriendelijke groeten,
Lieven Cardoen
MULTIMEDIALOFT | POINT X
Engelse Wandeling 2 K18v | 8500 Kortrijk | T +32 (0)56/36.11.97

// communicatie bij voorkeur op [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 

 

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com