PDA

View Full Version : How can I modify TellTarget Script



mrosoff
April 11th, 2004, 10:05 PM
As a newbie to Actionscript I'm hoping someone can take a moment and help with my question.

In the Advanced Rollovers tutorial found here at kirupa.com, I used the following actionscript on one of the buttons as instructed in the tutorial (it worked fine):

First Button

on (rollOver) {
tellTarget ("/rollover") {
gotoAndPlay ("1text");
}
}
on (rollOut) {
tellTarget ("/rollover") {
gotoAndPlay ("1back");
}
}

On Rollover this called the MovieClip called "Rollover" and played the embedded tween called 1text. The on rollout did the reverse.

What I would like to do is on rollover have an image or text box display instead of the tweened graphic and on rollout have the image disappear.

How can we change the actionscript to do this?

Thanks,
martin

Adam
April 11th, 2004, 10:22 PM
on (rollOver) {
tellTarget ("/rollover") {
gotoAndPlay ("1text");
}
}
on (rollOut) {
tellTarget ("/rollover") {
gotoAndPlay ("1back");
}
}

which is acually deprecated script from flash 4, and should be this:

on (rollOver) {
_root.rollover.gotoAndPlay ("1text");

}
on (rollOut) {
_root.rollover.gotoAndPlay ("1back");
}


is actually just going to frames labelled "1text" and "1back"...you can put whatever you need in those frame, you'll see in the movie clip that there are two frames that have red flags in them...these are the frames that are labelled...click in them and you should see at the bottom of your flahs program that they are called the aforementioned names....have a look and put something else in those frames, I think you'll see what I mean....

Adam

mrosoff
April 12th, 2004, 07:40 PM
Thanks for the reply.
I'll give it a try.
I think I've got it now.

martin


on (rollOver) {
tellTarget ("/rollover") {
gotoAndPlay ("1text");
}
}
on (rollOut) {
tellTarget ("/rollover") {
gotoAndPlay ("1back");
}
}

which is acually deprecated script from flash 4, and should be this:

on (rollOver) {
_root.rollover.gotoAndPlay ("1text");

}
on (rollOut) {
_root.rollover.gotoAndPlay ("1back");
}


is actually just going to frames labelled "1text" and "1back"...you can put whatever you need in those frame, you'll see in the movie clip that there are two frames that have red flags in them...these are the frames that are labelled...click in them and you should see at the bottom of your flahs program that they are called the aforementioned names....have a look and put something else in those frames, I think you'll see what I mean....

Adam