Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

subtracting land mass from a movieclip

0 views
Skip to first unread message

Mike

unread,
Nov 19, 2000, 3:00:00 AM11/19/00
to
hi there
just wondering if it was possible to delete areas from a movieclip.
ie. i have created an abstract landscape inside a movie clip which detects
the collision of a moving point, a 'bomb,' when the bomb strikes the
landscape, i want it to 'blow up' a certain radius of the landscape, so when
the next detection occurs the landscape area has been altered. kind of like
an eraser
is this possible in flash? or does anyone know of a similar example, or have
any ideas for a work around?

check out the example code www.yoyocreative.co.uk/example/bomb.swf

thanks in advance

Robin Nicholl

unread,
Nov 19, 2000, 3:00:00 AM11/19/00
to
Mike

I'm certainly no expert at this sort of thing, but I think you may have to try building your "landscape" from a collection of named instances of a Movie Clip. That way, when the "bomb" (which would also need to be a named instance of a Movie Clip) hits a piece of the landscape it can communicate with it, telling it to disappear or whatever.

I think you'd need to test for the _x and/or _y properties of the bomb relative to the same properties of each piece of landscape. Something like:

If ( GetProperty("/bomb",_x) > (GetProperty("/target",_x) - (GetProperty("/target",_width) / 2)) and
GetProperty("/bomb",_x) < (GetProperty("/target",_x) + (GetProperty("/target",_width) / 2)) and
GetProperty("/bomb",_y) > (GetProperty("/target",_y) - (GetProperty("/target",_height) / 2)) and
GetProperty("/bomb",_y) > (GetProperty("/target",_y) + (GetProperty("/target",_height) / 2)) )
Set Property ("/target", Alpha) = GetProperty("/target", Alpha) / 2
End if

... called on a loop in the "target" clip's timeline would continually test whether the bomb was inside the target, and then fade out the target once it was.

Of course, this would require quite a lot of individually named clip instances to work, and each instance of the target would have to check for the presence of the bomb inside its own boundaries, so you'd need to name them dynamically somehow. This sort of thing will be a lot easier if you're using Flash 5... apart from anything else, at least you'd be able to see all of an Action Script at once instead of fiddling around inside those pathetically small windows!

Any help?

Robin


Mike wrote:

--
Robin Nicholl

Studio Alias Limited

Visit us online at: www.studioalias.com

--
This e-mail is confidential and intended solely for the addressee. Neither the message nor any attachments may be read, copied, used or stored in any way by anyone other than the addressee. If you received it in error, please contact Studio Alias Limited on +44 (0)1865 858560.

Internet communications are not secure and therefore Studio Alias Limited does not accept legal responsibility for the contents of this message or any attachments. Views or opinions expressed are solely those of the author and do not necessarily represent those of Studio Alias Limited unless otherwise specifically stated.

chris Henden

unread,
Nov 20, 2000, 3:00:00 AM11/20/00
to
What's wrong with placing a mask in the correct position using actionscript?

chris


Hamish

unread,
Nov 20, 2000, 3:00:00 AM11/20/00
to
cheers robin
i thought that might actually be the case. i just didnt want the landscape
to appear all 'square & rectangley' i was after a more 'organic' look, but
nevermind, i have an idea to change the landscape to castles instead which
should look alright made up from individual bricks.
i was also worried about slowing the swf down, with so many calculations in
each quick explosion,
if it has to detect for up to 1000 individual bricks.
does anyone know, would a calculation like that cause a noticable 'stall'
guess i'll just have to try it.


Hamish

unread,
Nov 20, 2000, 3:00:00 AM11/20/00
to
yeah. that might just work. i shall try it out.
cheers!


"chris Henden" <ch...@kode.co.uk> wrote in message
news:8vb6hh$1i2$1...@misc.macromedia.com...

0 new messages