holdaway
01-27-2006, 12:17 AM
I have been using a method for a while now for buttons to load a section. Let's say I have a button that is meant to load the home page. I will make a button (let's call it 'homePgBtn'), then place it in a movie clip called 'home'.
Then I write Actionscript on the button that says:
on(press){
_root.gotoAndPlay(this._name);
}
My question is, do I have to place a button in a movie clip for this to work? Is there a way that I can name a button so I don't have to make it inside a movie clip, which DOES have the ability to be named?
Perhaps, a basic question for some, but it's a puzzle that I have been wondering about for a while now.
Also, if I place this code on the root level in a function (where code really should be!) and then call the function from the button, it does not work. Why?
Then I write Actionscript on the button that says:
on(press){
_root.gotoAndPlay(this._name);
}
My question is, do I have to place a button in a movie clip for this to work? Is there a way that I can name a button so I don't have to make it inside a movie clip, which DOES have the ability to be named?
Perhaps, a basic question for some, but it's a puzzle that I have been wondering about for a while now.
Also, if I place this code on the root level in a function (where code really should be!) and then call the function from the button, it does not work. Why?