PDA

View Full Version : paths in relation to buttons & movieclips


AM1
03-08-2003, 02:18 PM
Hi there,

I have movieclip (named Ckirk1) which has only actions in it, embedded into a button (named 7b), and this button is on the main timeline.

I am trying to get the actions in the movieclip (Ckirk1) to go to frame 4 on rollover, but the output screen continues to say it cannot find the movieclip.

This is the code I have on the button:

on (rollOver) {
tellTarget ("_root.7b.Ckirk1") {
gotoAndPlay (_root.7b.Ckirk1.4);
}


On frame 4 of the movieclip Ckirk1, I have this code:
tellTarget ("pic1") {
nextFrame ();
}

pic1 (a tweened image in a movieclip) and Ckirk1 are both on the Over State of button 7B


Could someone indicate how to fix this code?


Also, is the name you specify in paths, the name referring to the movieclip, or the name of an instance of that movieclip?

Many thanks for your help,

AM

Ricod
03-08-2003, 07:04 PM
I don't know about mx, but in 5 you couldn't really target buttons like that. Place the mc with the actions outside the button, and then target it. Also, don't use tellTarget. It's Flash 4 style coding and has become obsolete.

on(rollOver) {
_root.CKirk1.gotoAndPlay(4);
}
will send the mc "CKirk1" on the main timeline to frame 4 and play from there.

on (rollOver) {
tellTarget ("_root.7b.Ckirk1") {
gotoAndPlay (_root.7b.Ckirk1.4);
// it doesn't work like this. I suggest you read a few tutorials, like this one :
Tutorial 03 : Paths to Objects and Variables (http://www.actionscript.org/tutorials/beginner/paths/index.shtml)