Tell target

Recently I’ve learned of the ‘tell target’ command and I think it’s great, but I have a problem. I decided to use the command as the main use of the navigation bar. When you click one of the navigation buttons, the corresponding movieclip is displayed. I have about 13 different movie clips that are linked to the navigation. Now my problem is the arrangement of the clips. They’re all in the exact same position and are all the same size, so that when one is played, the previous is covered up. I can’t figure out how to get the clips that are below other clips to play above the first clips (I hope that made sense). I don’t know if there is a ‘stop playing’ command that I can use that will allow the clips below to seem as though they were above. If anyone understands this and can help, let me know.

Welcome to Kirupa! Hope you enjoy here, and get all your questions answered :slight_smile:

**second: **

Forget about Tell targets, they are deprecated in flash MX.
you can change the stacking order of your movieclips or just make the others movies invisible to show the desired movieclip.

take a look at this fla and tell me if you understood, if not, post your questions here and I´ll be glad to answer.
=)

also you could use swapDepths()

example:


_root.myButton1.onRelease = function() {
     depth ++
     _root.myMC1.swapDepths(depth)
     _root.myMC1.play()
}
_root.myButton2.onRelease = function() {
     depth ++
     _root.myMC2.swapDepths(depth)
     _root.myMC2.play()
}
// and so on ...

Guig0 …
where’s the fla? :stuck_out_tongue:

forgot the fla.:frowning:

Here it is :stuck_out_tongue:

*Originally posted by kax *
**also you could use swapDepths()

example:


_root.myButton1.onRelease = function() {
     depth ++
     _root.myMC1.swapDepths(depth)
     _root.myMC1.play()
}
_root.myButton2.onRelease = function() {
     depth ++
     _root.myMC2.swapDepths(depth)
     _root.myMC2.play()
}
// and so on ...

**

Yeah, this is what I mean by **change the stacking order of your movieclips **:slight_smile:

what the … ?? lol :stuck_out_tongue:

I really need to read carefully … :-\

you saved me a lot of time writing that code :stuck_out_tongue:

how does tellTarget work? i really don’t know…and what is it’s use?

it works like it sounds… it TELLS a TARGET (movie clip, button, etc) to do something… but as it was mentioned tellTarget is no more… it used to be like this:

tellTarget(“thingy”){
do.all.this.stuff;
}

Now it has been more simplified and streamlined to this:

_root.thingy(stuff follows)…

i see…so i’ve been using it all along…stup!d me… hhehehe… tnx ryall…

Alright, we fixed the problem of being able to see the animation. Now my only thing is I keep messing up when tell the target to play. For instance, if the ‘mcblue’ of your FLA was a movieclip animation, how would you tell it to play once you made it visible (given the fact that all the targets, including ‘mcgreen’ and ‘mcred’ are stopped)?

Thanks a lot for you help. I would really be stuck without your help.

I’ll take Guig0’s example …

if you want to play mcBlue and stop mcGreen and mcRed … add this actions to you your button


on (release) {
     _root.mcBlue.gotoAndPlay(1)
     _root.mcGreen.stop()
     _root.mcRed.stop()
}

I must say that stopping mcGreen and mcRed is completely useless … because who cares if they’re playing … you can’t see them anyway

Alright, I see how that would start and stop the clips, but how do you start and stop them while also only making ‘mcblue’ able to be visible.

What I’m looking at is the original:

on (press) {
_root.mcBlue._visible = true;
_root.mcGreen._visible = false;
_root.mcRed._visible = false;

and then the start stop commands:

on (release) {
_root.mcBlue.gotoAndPlay(1)
_root.mcGreen.stop()
_root.mcRed.stop()
}

And I need both of those put together. I want ‘mcblue’ to start playing, and I want ‘mcgreen’ and ‘mcred’ to be not visible.

sorry …

I’d use it like this:


// button to play mcBlue
on (press) {
     _root.mcBlue._visible = true
     _root.mcGreen._visible = false
     _root.mcRed._visible = false
     _root.mcBlue.gotoAndPlay(1)
     _root.mcGreen.stop()
     _root.mcRed.stop()
}
// button to play mcGreen
on (press) {
     _root.mcBlue._visible = false
     _root.mcGreen._visible = true
     _root.mcRed._visible = false
     _root.mcBlue.stop()
     _root.mcGreen.gotoAndPlay(1)
     _root.mcRed.stop()
}
// button to play mcRed
on (press) {
     _root.mcBlue._visible = false
     _root.mcGreen._visible = false
     _root.mcRed._visible = true
     _root.mcBlue.stop()
     _root.mcGreen.stop()
     _root.mcRed.gotoAndPlay(1)
}

[size=1][EDIT]
I repeat … I’d remove the stop actions[/size]

Awesome, that’s what I needed. Now I’m curious though, I want to know how the changing depths works using the same principal (and don’t worry about the stops, you’re right, theyre pointless).

there’s a tut about swapDepths() in the tutorials section
I think it’s called changing stacking order or something like that (-:

[size=1][EDIT]
here’s the link
http://www.kirupa.com/developer/actionscript/swapdepth.asp[/size]

for taking over and help sadclown on my abscence. :slight_smile:

My computer is broken, and can only go online at work :evil: