1120: Access of undefined property error AS3
Hi! I've been working on an interactive character animation for a school project and have been having some issues with it. I'm very new to Animate and was originally working with an HTML5 canvas. I was having issuses with some of my animations and music not playing, so my professor suggested I convert it to an ActrionScript3 file. That fixed those issues, but presented many more as I have to recode all of my animation.
The animation is a basic dress up game where the player can press start, click on an area to reveal a piece of clothing, click on the clothing to put it on the character, and then click a button that restarts the animation. I've been working with simple timeline animation, calling frames and frame labels to jump around, however when using code snippets to re-code my buttons I got an error saying, "1120: Acess of undefined property clothesRVL." My animation was working fine before I added an action to clothesRVL, and I suspect it's not working because I called a frame label and not a frame. I appreciate any help I could get with this as this is my final project and I'd like to get this working by tonight! I'll paste my current AS3 code and original Javascript code below:
JS Code ---
Frame 1:
var _this = this;
_this.stop();
var _this = this;
_this.Button2.on('click', function(){
_this.gotoAndStop(242);
});
var _this = this;
_this.blanketBTN.on('click', function(){
_this.gotoAndStop(251);
});
var _this = this;
_this.shirtBTN.on('click', function(){
_this.gotoAndStop(253);
});
var _this = this;
_this.clothesBTN.on('click', function(){
_this.gotoAndPlay('clothesRVL');
});
var _this = this;
_this.pantsBTN.on('click', function(){
_this.gotoAndStop(263);
});
var _this = this;
_this.drawerBTN.on('click', function(){
_this.gotoAndStop('drawer open');
});
var _this = this;
_this.socksBTN.on('click', function(){
_this.gotoAndStop('Socks On');
});
var _this = this;
_this.curtainBTN.on('click', function(){
_this.gotoAndStop('shoesRVL');
});
var _this = this;
_this.shoesBTN.on('click', function(){
_this.gotoAndPlay('Shoes On');
});
Frame 266:
this.stop();
Frame 361:
//
//var _this = this;
//_this.endBTN.on('click', function(){
//_this.gotoAndStop(1);
//});
AS3 Code:
Frame 1:
Button2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);
function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void
{
gotoAndStop(242);
}
blanketBTN.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);
{
gotoAndStop(251);
}
shirtBTN.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);
{
gotoAndStop(253);
}
clothesBTN.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame);
function fl_ClickToGoToAndPlayFromFrame(event:MouseEvent):void
{
gotoAndPlay(clothesRVL);
}
