Hi there. First off I just want to say that I do NOT understand ActionScript, I am learning as i go. Also, my situation is not new, and I have seen threads simular to mine, but to be honest I don’t understand them.
Ok, I have created a animated MC Button and I uesed the Behaviors to control the OnRollOver, OnRollOut and OnRelease states
of the button. I also used an invisible button for better control of the MC button. I am also using screens,(Please note, if there
is a better or easier way to acheive the resulte I’m looking for or just using a different methade just let me know)
Here is what I would like the button to do. When the user clicks on it I would like the button to stay in the Down state, to repesent
that the user is on that page. Right now it only works if I click and drag away from the button, then it will stay on the Down state.
I also want it to go to a certen page or in my case, I’m using screens so I’d like it to go to a certen screen on Release.
I am really struggling with this. I have attached my .fla file of just the button. You can see a preview of this at Swfupload.com here:
http://www.swfupload.com/view/119043.htm
Here is my code:
on (rollOver) {
//Movieclip GotoAndPlay Behavior
this.home_btn.gotoAndPlay("over");
//End Behavior
}
on (rollOut) {
//Movieclip GotoAndPlay Behavior
this.home_btn.gotoAndPlay("out");
//End Behavior
}
on (release) {
// GoTo Screen behavior
if((this.home != undefined) && (this.home != null))
{
var screen = null;
var target = this;
while((screen == null) && (target != undefined) && (target != null))
{
if(target instanceof mx.screens.Screen)
{
screen = target;
}
else
{
target = target._parent;
}
}
if(screen instanceof mx.screens.Slide)
{
screen.gotoSlide(this.home);
}
}
// End GoTo Screen behavior
}
If more information is needed please let me know.
Thanks in advance,
zipper