USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 6/22/06 02:49 PM
Sign-Up: 11/03/05
Posts: 792
onClipEvent (enterFrame) { if (this.hitTest(_root.Scorpion)) { _root.victim.Play(); } }
Thats the code on victim. If the Scorpion hits it then it stays idle instead of playing an animation of its second frame. How come?
Posted at: 6/22/06 02:53 PM
Sign-Up: 06/21/06
Posts: 73
At 6/22/06 02:49 PM, Re2deemer wrote: onClipEvent (enterFrame) { if (this.hitTest(_root.Scorpion)) { _root.victim.Play(); } } Thats the code on victim. If the Scorpion hits it then it stays idle instead of playing an animation of its second frame. How come?
Wouldn't know, double-checked your instance names?
try changing _root.victim. to just this.
Also, it is obvious you can count well.
Posted at: 6/22/06 02:56 PM
Sign-Up: 03/24/00
Posts: 615
Like he said..try: onClipEvent (enterFrame) { if (this.hitTest(_root.Scorpion)) { this.Play(); } }
does that work?
Posted at: 6/22/06 03:01 PM
nope...I'm getting confused already. There has to be a mistake, but I can't freakin find it...
Posted at: 6/22/06 03:02 PM
Sign-Up: 11/30/05
Posts: 1,281
If the animation is on a movie clip on the second frame, change the play to a gotoAndStop(2).
Posted at: 6/22/06 03:03 PM
Ok....I replaced the Play() with gotoAndStop() and it worked :D
Posted at: 6/23/06 07:44 AM
Oh yeah...almost forgot hte second question...
Hoq can I make so, that on MC follows another, so that they have exactly same x and y all the time
Posted at: 6/23/06 07:47 AM
Sign-Up: 08/12/05
Posts: 2,160
At 6/23/06 07:44 AM, Re2deemer wrote: Oh yeah...almost forgot hte second question... Hoq can I make so, that on MC follows another, so that they have exactly same x and y all the time
onClipEvent(enterFrame){ this._x=_root.thing._x this._y=_root.thing._y; }
exactly the same x and y.
yey?
Posted at: 6/23/06 09:54 AM
no dice... I want camFrame to follow Manta I don't know why but applying this code to camFrame and replaceing thing with Manta didnät work
Posted at: 6/23/06 09:56 AM
Posts: 57
The first code didn't work because AS is case sensitive. I'm suprised that none of these other pro scripters picked up on that. It's play(), not Play(). As for the second one, RBC's should work fine.
Posted at: 6/23/06 09:58 AM
At 6/23/06 09:54 AM, Re2deemer wrote: no dice... I want camFrame to follow Manta I don't know why but applying this code to camFrame and replaceing thing with Manta didnät work
dont know why?! you may be doing something wrong. put this on cam frame and see if it works. by the way does "Manta" have a capital letter? ill put it without but remember capitals matter. so change it if it does. onClipEvent(enterFrame){ this._x=_root.manta._x this._y=_root.manta._y; }
Posted at: 6/23/06 10:09 AM
yeah, it was my bad...I forgot to give the Manta an instance name. Worked perfectly, thx!!!
BTW, Manta is with a capital letter, because it is an hover vehicle from UT2004.
Posted at: 6/23/06 10:14 AM
At 6/23/06 10:09 AM, Re2deemer wrote: yeah, it was my bad...I forgot to give the Manta an instance name. Worked perfectly, thx!!! BTW, Manta is with a capital letter, because it is an hover vehicle from UT2004.
It's considered bad form to start names with capitals in scripting :P
Posted at: 6/23/06 10:15 AM
Sign-Up: 01/07/05
Posts: 1,350
At 6/23/06 10:09 AM, Re2deemer wrote: BTW, Manta is with a capital letter, because it is an hover vehicle from UT2004.
That's a bad reason, because script doesn't ammend by such reasons. It's easier to just do everything lowcase.
Posted at: 6/23/06 10:46 AM
what the hell??? why does it matter to you if manta is written with a capital letter?
Posted at: 6/23/06 10:57 AM
At 6/23/06 10:46 AM, Re2deemer wrote: what the hell??? why does it matter to you if manta is written with a capital letter?
Well not to me, I'm just trying to help here. In before you get a large flash with hundreds of lines of codes. You'll thank me for having everything easily typable, because one mistake in the caps (which is very easily made), and you'll get confused big time and irritated to search trough all of the code.
Posted at: 6/23/06 10:58 AM
Sign-Up: 09/29/04
Posts: 157
Its not necessarily a bad thing, it's just not a generally good idea, since if you forget something is capitalized, you could end up wasting a long time trying to figure out what is wrong with your code. Experienced scriptors keep everything lowercase.
All times are Eastern Standard Time (GMT -5) | Current Time: 08:05 AM
<< Back