USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 11/3/09 06:57 PM
Sign-Up: 06/08/09
Posts: 84
Well im makin a game what i want is that when my characters touches an item (instance name "point") Add 10, make the "point" dissapear AND create another point.
onClipEvent (enterFrame) { if (this.hitTest(_root.spaceship)) { _root.score.text += 10; unloadMovie(this); } }
Thats the code for adding the score and making it dissapear (right?) but how do i create another "point" in a different `lace
OMG ART! OMG FLASH! OMG MEANING OF LIFE!
Posted at: 11/3/09 07:05 PM
Sign-Up: 08/08/06
Posts: 4,539
At 11/3/09 06:57 PM, exzeta wrote: Thats the code for adding the score and making it dissapear (right?)
Eh, don't use unloadMovie, just use removeMovieClip(this).
but how do i create another "point" in a different `lace
Go learn about attachMovie. OR just move your current coin in a different place. EX:
onClipEvent (enterFrame) { if (this.hitTest(_root.spaceship)) { _root.score.text += 10; this._x = (put your new x here) this._y = (put your new y here) } }
Attaching a movie with attachMovie is the best solution though.
School Sux ! || As :Main || As3: Main || Animation: Main || Flash Tutorials ||
Posted at: 11/3/09 07:11 PM
At 11/3/09 07:05 PM, zrb wrote: Eh, don't use unloadMovie, just use removeMovieClip(this).
Ok i will try that
OR just move your current coin in a different place. EX: onClipEvent (enterFrame) { if (this.hitTest(_root.spaceship)) { _root.score.text += 10; this._x = (put your new x here) this._y = (put your new y here) } }
Thanks for the code
Posted at: 11/3/09 07:15 PM
Its glitchy that way ill try attach movie
Posted at: 11/3/09 07:17 PM
At 11/3/09 07:15 PM, exzeta wrote: Its glitchy that way ill try attach movie
Good ! And be sure to use removeMovieClip and not unloadMovie !
Posted at: 11/3/09 07:26 PM
Ill do but i need to know, why?
Posted at: 11/3/09 07:30 PM
At 11/3/09 07:26 PM, exzeta wrote: Ill do but i need to know, why?
I don't exactly remember why but I know it had something to do with performance.
Posted at: 11/3/09 07:37 PM
ok. I got a new problem now when the score adds it should go like this 10 20 30 40 50 But it goes like this 10 1010 101010
Help please?
Posted at: 11/3/09 07:39 PM
Sign-Up: 08/20/09
Posts: 115
Change Unload Movieclip to Remove Movieclip
Posted at: 11/3/09 07:41 PM
At 11/3/09 07:39 PM, Greg-SKA wrote: Change Unload Movieclip to Remove Movieclip
Allready did that
Posted at: 11/3/09 07:42 PM
Already told him that and that doesn't solve his current problem :\
Posted at: 11/3/09 07:45 PM
@Exzeta:
Put this on your main frame:
var Score:Number = 0; function onEnterFrame() { scores.text = Score }
And put this on your coin:
if (this.hitTest(_root.spaceship)) { _root.Score+=10 }
So change your textbox's instance to "scores" and put those codes in the right place :)
my code for adding the score is like this
if (this.hitTest(_root.spaceship)) { _root.score.text +=10; removeMovieClip(this);
What should i do?
Posted at: 11/3/09 08:03 PM
Sign-Up: 08/21/05
Posts: 2,373
At 11/3/09 07:30 PM, zrb wrote: At 11/3/09 07:26 PM, exzeta wrote: Ill do but i need to know, why?I don't exactly remember why but I know it had something to do with performance.
Yeah it does, using unload movie removes the contents of a movieclip and its custom properties but it does not remove the actual movieclip or its basic properties. Hence it can still be referenced and is taking up (only a little bit) of memory.
AS:Main
Posted at: 11/3/09 08:44 PM
Thanks my problems are solved now
All times are Eastern Standard Time (GMT -5) | Current Time: 04:34 AM
<< Back