Copy link to clipboard
Copied
This is my code. It is inside a moviclip in a VR project
My issue is: clicking on the butons won't direct you to the correspondent frame (FLA attached). Instead, directing it any to frame smaller than 3 will stay at frame 0, directing it to frame 3 will result in displaying frame 1, and directing it to frame 4 will direct it to frame 3. It is driving me mad!
Any ideas? It couldn't be simpler than that.
{
var _this = this;
//Clicking on the specified symbol instance executes a function.
_this.bt0.addEventListener(AnEvent.CLICK, function() {
//Moves the playhead to the specified frame number in the timeline and and stops the movie
_this.gotoAndStop(0);
});
//Clicking on the specified symbol instance executes a function.
_this.bt1.addEventListener(AnEvent.CLICK, function() {
//Moves the playhead to the specified frame number in the timeline and and stops the movie
_this.gotoAndStop(1);
});
//Clicking on the specified symbol instance executes a function.
_this.bt2.addEventListener(AnEvent.CLICK, function() {
//Moves the playhead to the specified frame number in the timeline and and stops the movie
_this.gotoAndStop(2);
});
//Clicking on the specified symbol instance executes a function.
_this.bt3.addEventListener(AnEvent.CLICK, function() {
//Moves the playhead to the specified frame number in the timeline and and stops the movie
_this.gotoAndStop(3);
});
//Clicking on the specified symbol instance executes a function.
_this.bt4.addEventListener(AnEvent.CLICK, function() {
//Moves the playhead to the specified frame number in the timeline and and stops the movie
_this.gotoAndStop(4);
});
_this.stop();
}
(I would have attached it, but the forum gives me the message "The attachment's vrbug.fla content type (application/octet-stream) does not match its file extension and has been removed"
Copy link to clipboard
Copied
THe issue does not happen on a regular HTML5 Fla (replacing AnEvent with a regular listener -- which I also tried on the VR project)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now