Groups | Blog | Home
all groups > flash actionscript > april 2004 >

flash actionscript : How do i do this


Devistator
4/13/2004 8:28:18 PM
I have a car at the bottom of the screen moving left and right due to the
function on the key board. However when you move the car right and it come in
contact with the object i want the object that the car image has just touched
to chage, so the image changes into a moving movie clip, how would i do this
thanks for your help in advance!!!
loudmouth72
4/13/2004 8:48:05 PM
You probably have to set up a hitTest- what this does is check if one mc has
hit another and then something happens. There are alot of tutorials on this
subject -- check out kirupa.com

loudmouth72
Devistator
4/13/2004 9:58:26 PM
mandingo
4/13/2004 11:29:32 PM
As loudmouth has said, you first detect that the two objects have collided with

this.onEnterFrame = function(){
if(a_mc.hitTest(b_mc)){
b_mc.gotoAndStop("collided");
b_mc._x +5;
}
}
or whatever actions you want. That indicates that you have a frame labelled
"collided" in your b_mc and if a hits b, then b would change and move to the
right by 5px.

I haven't tested that code, so it may be slightly out... has been a while
since I coded that sort of thing.

cheers,
AddThis Social Bookmark Button