;

PDA

Click to See Complete Forum and Search --> : [CS3] Error #1010


Race Bannon
12-18-2007, 05:54 PM
Hopefully this will be an easy question. Im trying to use a button (that is in lower level movie clip) to gotoAndStop() a movie clip in another lower movie clip. think my problem is in the path to the other clip (but I used the “insert target mode’ to get the relative path)


This is what I have on the button

stop();
function clickButton(evt:Event):void {
trace("the " + evt.target.name + " button was clicked");
gotoAndPlay(2);
this.shore_cable.gotoAndPlay(1);

}
Connect_Shore.addEventListener(MouseEvent.MOUSE_DO WN,clickButton);}

I also have a “Trace(this name);” on the movie clip “shore_cable” that I want to control
The below shows that the button was clicked and that the shore_cable is a correct movie clip.

I do not get a compiler error but the animation does not work and I get this the output note:

shore_cable

the Connect_Shore button was clicked

TypeError: Error #1010: A term is undefined and has no properties.
at controlpanel_test_fla::Shore_button_3/clickButton()

any ideas? anyone? thank you in advance for your consideration
p.s. i did a search and found a lot of information on the #1010 but i could not figure out my problem :(

samac1068
12-18-2007, 07:05 PM
I'm not a guru but I'm not understanding your code. your evt.target.name is "Connect_Shore" but you are trying to goto and play "shore_cable". Where did shore_cable come from and was is appropriately declared within the function.

What is the gotoAndPlay(12) assigned to....remember object oriented so you've got to identify who....been learning that little tid bit the hard way.

Not tested but since evt.target already know what what pressed, just use it to change the frame evt.target.gotoAndPlay(1) or something like that.

Just a thought.

Race Bannon
12-18-2007, 07:15 PM
shore cable is the animation that is in another lower level movie clip. I want that movie clip to play (i was trying to use) "this.shore_cable.gotoAndPlay(1);" that is what is giving me the #1010

The gotoAndPlay(2) is connected to the button

does that make sence, thank you for looking at it

samac1068
12-18-2007, 07:18 PM
Okay, is shore_cable a global class or something added within a function? You are using AS 3.0?

Race Bannon
12-18-2007, 07:22 PM
Yes AS3

Global class is probbly my problem; i do not know what that is.
shore_cable is a movie clip and i thought that was enough.

Race Bannon
12-18-2007, 07:25 PM
do i need to call out
var shore_cable = movie clip

in order to make it be connectable?

samac1068
12-18-2007, 07:37 PM
private var shore_cable:MovieClip();

But in a global area inside the class function. Basic the global area is any area NOT within a function

package {

///global area

public class example {

///global area

private function example2 {
///NOT GLOBAL
}
}
}

Race Bannon
12-19-2007, 01:06 PM
I guess I’m to new to understand packaging. I bought a book last night on AS3 and I hope that will help me understand it better. I'm reading it now.

Would the "package" go in the "parent" movie clip? or does it matter and do I need to declare var shore_cable:MovieClip(); it is a "child" movie clip but i figured because it was a movie clip and i used "this.shore_cale.cable.gotoAndPlay(1)" it should find the child clip?

thank you again for your time in trying to help the helpless :)