Copy link to clipboard
Copied
So I have made a game, with a dinosaur, and when you bite into something I want there to be bloodsplatter. I've animated the bloodsplatter and the first image is the Class for it. But when I press space It wont change, I can only trace words in the splash function. The other images are snippets from the dinosaur class. Help is very much appreciated, because I am quite new to AS3.
Copy link to clipboard
Copied
that will cause the your blood instance to play. if that's what you want, use the trace function to confirm that if-branch is executing and splash() is executing.
p.s. your not following naming convention which will cause more and more problems if you ever work with anyone else or continue to seek help from others.
your class name should be BloodClass and your instance blood. you have just the opposite.
Copy link to clipboard
Copied
when I put a trace in splash() it works, but it wont play when I put play(); there
why is that?
Copy link to clipboard
Copied
you may have lost scope. use the trace function, eg
trace(this)
Copy link to clipboard
Copied
still won't play, I've tried so many things but I can only play it from inside the class.
Copy link to clipboard
Copied
what's the trace show?
Copy link to clipboard
Copied
[object blood]
Copy link to clipboard
Copied
again, use the trace to continue debugging.
eg, start an enterframe loop that checks your instances currentFrame property.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now