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

Reply via email to