Groups | Blog | Home
all groups > flash actionscript > march 2005 >

flash actionscript : TellTarget not working?


GhettoFabFlah
3/20/2005 3:33:07 PM
Hey everyone, long time no...eh........ type......... whatever. Ooookay anyway
i have a quick question about using tellTarget. I have used it previously and
it worked fine, but this time it says it cant find the target. I have the right
instance names and everything but i cant seem to get it to work. i'll post the
full actionscript at the bottom of this post. Anyway what i want is for when i
click the movie clip (which is inside another movieclip) it makes another one
((instance name of mds)) to gotoAndPlay(603). but it doesnt work. heres what i
have for it so far. (all the sounD stuff isnt whats wrong. THat's working
fine). onClipEvent (load) { set('sounD', 'On'); } on (release) { if (sounD
== 'On') { tellTarget ('_root.mds') { gotoAndPlay(603); } set('sounD',
'Off'); } else if (sounD == 'Off') { set('sounD', 'On'); tellTarget
('_root.mds') { gotoAndPlay(57); } } } If anywone knows what im doing
wrong, please help. Skittles! Kieth Ragner
kglad
3/20/2005 3:49:11 PM
if mds is on the _root timeline when that code is executed, you should have no
problem. if you have mouse handler code attached to a parent movieclip of the
movieclip that has your shown code, that code won't execute.
GhettoFabFlah
3/20/2005 4:07:07 PM
hmmmmmm... still not working. mds is on the root timeline and there is no mouse
handler code (which means on(release) stuff right?) attached to a parent
movieclip. whenever i try clicking it it says Target not found:
Target='_root.mds' Base='_level0.instance81.instance83' I'm not sure whats
going on, but if anyone knows, please help. PS. the root timeline means the
main timeline right? i'm just making sure im not that much of a novice:)
GhettoFabFlah
3/20/2005 5:03:53 PM
Wow its official, I know nothing of actionscript. Ok, so i learned that _root
means the timeline it's in, not the main 1, so thats not what ii wanted. but
_parent doesnt work either, eeven though it should. soooooooo, does anyone know
whats wrong? remeber the movieclip this code is inside another movie clip. mds
is on the main time line. do i need like _parent._parent.mds or something?
whatever im rambling... Skittles! Kieth Ragner
fasterthanlight
3/20/2005 5:48:24 PM
Actually, you've got it wrong.

_root. targets the main timeline
kglad
3/20/2005 8:49:40 PM
_root refers to the main timeline in the _level in which it's executed. to
find the path to mds, put the following code on mds' timeline:

trace(this);

the absolute path to mds will be revealed in your output panel.
GhettoFabFlah
3/21/2005 1:47:22 AM
ok thank you guys so much. I know ive bitten off more than i can chew (which is
sad since this seems really easy) anyway i put the tracethis thing on mds's
timeline and it said _level0.instance94. So i put tellTarget('_level10.mds'),
But it's still not working. Anywon? Tootles! Kieth Ragner
kglad
3/21/2005 2:03:31 AM
flash targets your movieclips based on their instance name, not their library
name. so, if you look at your _root timeline that contains your movieclip with
library name mds and you click on it, in the properties panel there's a space
for your movieclip's instance name. it's currently blank. type mds and your
code will work.

alternatively, you can leave it blank and refence that movieclip by using
_level0.instance94. flash automatically names object instances for you, if you
fail to apply a name. (you've apparently failed to apply instance names to
quite a few objects because flash starts naming at instance1 and works its way
up.)
GhettoFabFlah
3/21/2005 10:16:07 PM
Oh great i just figured it out. I did have it's instance name mds, but i was
saying telltarget('_parent.mds'). I changed it to _level0.mds and it worked.
Thank you guys everyone who helped SOOOOo much. kglad you have helped me so
much. I'm Super! Thanks for Asking!' Kieth Ragner
AddThis Social Bookmark Button