Is it a tellTarget problem?

i have 2 button which are map of country.
when i roll over them, their flag will appear on the button. and the flag disappear when rollout.

when i click button A(said USA) the USA flag appear on it and stay there.
when i click button B(said UK) the UK flag appear on it and stay there, but the USA flag will disappear.

how can i do this?

do i have to use tellTarget or other AS command?

may be i describe the problem unclear, sorry.

Any help will be appreciated.

thanks.

What is the code you are currently using?

And tellTarget isn’t used anymore. It is now replaced with the dot syntax like _root.yourMC.gotoAndPlay(1)

i just using ordinary button command like on(release) currently.

i just don’t know how to call the mc inside a button.

thanx for remind me about the tellTarget:) i already get used to it.

hmm, I think tellTarget is still the simplest code, but I’m shwishing to _root. !

To answer your question:

It is perfectly possible with tellTarget (I won’t explain how to do it with _root) :slight_smile:

Anyway:

Here’s the code for button 1 USA:
on(release) {
tellTarget ("/America") {
GotoandStop (2) ;
}
tellTarget ("/UK") {
GotoandStop (1) ;
}
}

Code for button 2 UK:
on(release) {
tellTarget ("/UK") {
GotoandStop (2) ;
}
tellTarget ("/America") {
GotoandStop (1) ;
}
}

In this example you have an Movieclip (instance “America”), in that MC you have in frame 1 a flag, and in 2 no flag
And you have an MC (instance “UK”), with 2 frames, one with flag and one without), notice that frame 1 must be without flag and don’t forget the “stop ()”

Is this what you like? :-\

yeah, that’s the common to call a mc.
but if the mc is in the rollover of button?
when on (release)the mc should appear on the button not other place, the flag is stick on the button in this case.
just like when i rollover it.
but the different is when rollout, the flag will disappear, when on release the flag stay there.
ordinary telltarget won’t work.
And thanx for replying , Didius!

Are you sure it won’t work with tellTarget? If you give you button an instance name it must? I think. Wait i’m going to make something, hold on! :sleep:

ahh, what the hell, have you already fond your answer? else I’ll do my best to find it =)

Well tellTarget is replaced by with what I said on a button too.

on (release) {
_root.myMc.gotoAndPlay(2);
}

Why are you targeting a movie clip inside a button?

I think you can only do that in the different button states.

Why don’t you use a movie clip as a button since you can use button handlers on a movie clip in MX?

ok, i attach a file to show what i want to do.
in the file, when you roll over the button, an image will appear slowly, it disappear when you roll out.
i want the image to stay there after i click the button.
so, how can i do it?

Something like this?

its some sort like this, really thanx for helping