PDA

View Full Version : steam train smoke help please


tedo
06-08-2003, 10:33 AM
I have an expanding smoking stack on my train, and I have a movie clip of the steam coming out. I would like to write some actionscript that ensures that steam_clip is located just a few pixels above stack_clip when the appropriate button is pressed. Advice much appreciated.

pixelwit
06-08-2003, 10:11 PM
Turn your smokestack into a movieclip and name it something like "Stack_mc". Make sure Stack_mc's registration point is near the top of the stack. Name your smoke clip something like "Smoke_mc" and be sure its registration point is near the bottom of where the smoke starts. Then create an eterFrame event that looks something like this:onEnterFrame = function(){
Smoke_mc._x = Stack_mc._x;
Smoke_mc._y = Stack_mc._y;
}Now wherever Stack_mc goes, Smoke_mc will follow.

-PiXELWiT
http://www.pixelwit.com

tedo
06-09-2003, 11:49 PM
Thanks very much indeed. This is the code that worked for me:

onClipEvent(enterFrame) {
_root.smoke1._x = _root.smokey_stack._x;
_root.smoke1._y = _root.smokey_stack._y;
}

pixelwit
06-10-2003, 03:21 AM
Glad to have helped.

-PiXELWiT
http://www.pixelwit.com