|
-
XRave
Help with StopWatches in Flash
I am making a racing game and i made a MC timer, which times in seconds. I also created a frame by frame animation for it (20fps) and created 22 seconds. Now i placed the IstanceName: clock, and the MCname: clock.
Placed it onto the stage and gave the AS:
On(keyDown, <SPACE>) //something like that..
tellTarget("clock"){
Stop;
}
}
Did I do anything wrong? I pressed space in the game and it gaves me an output window saying that it cannot locate the (MC/Instance) clock and so didn't the clock stop.
Thanks for any posts i can find in this place.
//P.s. There a'int any tutorials...
//P.P.s So I can't get that AS
//P.P.P.s Should i use _Root.clock.Stop? It don't work..
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
Senior Member
Ooo i just learnt how to use tellTaget... You should ahve just looked at the help file sbut oh well... here is how to do it
make shore the instance of the MC is called clock 
onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE)) {
tellTarget ("_parent.clock") {
stop();
}
}
}
if you want i can try and help with any thing else
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
Senior Member
 Originally Posted by Gloo pot
Ooo i just learnt how to use tellTaget... You should ahve just looked at the help file sbut oh well... here is how to do it
so you learnt it... ok, but don't get use to it
 Originally Posted by Macromedia
tellTarget()
Deprecated since Flash Player 5. Macromedia recommends that you use dot (.) notation and the with statement.
use instead:
Code:
if (Key.isDown(Key.SPACE)) {
_parent.clock.stop();
}
Last edited by TeroLebe; 10-26-2005 at 02:37 PM.
-
XRave
oh cool... thanks everybody.
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
Senior Member
ooops didnt read that bit i just went straight to the example :P why do should i do it that way... i tested my way in flash 8 and it worked fine.... is it just just optimisation or somthing
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
Senior Member
it just makes it easier for you really in the long run, tellTarget can be a most frustrating way of doing things when they get bigger than the previously mentioned example.
-
Senior Member
I would not use tellTarget unless you are making Flash4 game.
-
Senior Member
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
XRave
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|