Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TellTarget & With Blues

Status
Not open for further replies.

skrause

Programmer
Feb 10, 2001
18
US
Folks:

I have a movie with 5 MC's called out on the main timeline. Each MC has an animation that plays on mouseover, which work perfectly. What I would like to do is have each MC play in sequence (left-to-right) if the visitor does not mouseover.

The problem - I can not for the life of me get any MC's to play when asked to do so. The code, from the last frame in the main timeline:

stop ();
with ("_root.Button_Semi") {
gotoAndPlay (1);
}

What this does is play the main timeline over and over, instead of the first frame in the MC I want.

I have the MC instance named. Besides that, I am perplexed. I have not used the TellTarget/with action that much, so be gentle if I am committing a forehead-slapping mistake.

I am looking forward to your suggestions...

Thanks,
Steve

 
First in your Mc's insert an Action layer(first on top)

ie. first frame(label start) action STOP

second frame(label play)

last frame of animation action goto2 (not 1 it would stop playing in 2)


Code:
'then just use

tellTarget ("_root.my_mc") {
    gotoAndPlay ("play");
}
'and to stop it
tellTarget ("_root.my_mc") {
    gotoAndPlay ("start");

That's it....

Have Fun...Sharky99 >:):O>
 
Sharky,
The tellTarget action, although it still works, is deprecated in Flash 5, and the use of with() is encouraged... But that's another story!

Maybe Skrause's use of with doesn't work because of the "" in this action, but maybe, after labeling the frames as you suggested, this would:

stop ();
with (_root.Button_Semi) {
gotoAndPlay ("play");
}

In any case, in this situation, both of these actions (tellTarget & with) can be omitted and the syntax would then simply be:

_root.Button_semi.gotoAndPlay("play");


Regards,

wink4.gif
ldnewbie
 
Thanks for the tips OldNewBie ;o)


Have Fun...Sharky99 >:):O>

p.s I keep forgeting about the "with" X-)
 
Gentlefolk:

Thank you for the suggestions. It was actually another problem - I labeled the MC's correctly, but in the wrong keyframe...d'oh!!

Also, thanks for the tips on Frame Labeling and scripting of actions. The piece is working well now.

Have a lovely holiday!

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top