Skip to main content
Participating Frequently
August 20, 2018
Answered

Buttons stop working after publish!

  • August 20, 2018
  • 1 reply
  • 2562 views

Hello everyone,

I have a banner that has an animation rotation, then lands on a slide with two buttons. One button toggles visibility of a slide that expands to 600x250 - that slide also has a function as a hide button. The other button links to a website. It works brilliantly when I preview it in Animate, but when I publish it, BOTH buttons stop working. The visibility button and link button are both useless. Here is my code (Sorry, I just included everything!)

(function (cjs, an) {

var p; // shortcut to reference prototypes

var lib={};var ss={};var img={};

lib.ssMetadata = [

{name:"expanding_banner_atlas_", frames: [[1254,523,625,521],[1254,1137,199,89],[1252,0,625,521],[0,523,625,521],[627,523,625,521],[0,1046,625,521],[0,0,1250,521],[627,1046,625,521],[1254,1046,256,89]]}

];

// symbols:

(lib.antonioSanchez = function() {

this.spriteSheet = ss["expanding_banner_atlas_"];

this.gotoAndStop(0);

}).prototype = p = new cjs.Sprite();

(lib.BUY_TICKETS = function() {

this.spriteSheet = ss["expanding_banner_atlas_"];

this.gotoAndStop(1);

}).prototype = p = new cjs.Sprite();

(lib.cecileMclorin = function() {

this.spriteSheet = ss["expanding_banner_atlas_"];

this.gotoAndStop(2);

}).prototype = p = new cjs.Sprite();

(lib.christianMcbride = function() {

this.spriteSheet = ss["expanding_banner_atlas_"];

this.gotoAndStop(3);

}).prototype = p = new cjs.Sprite();

(lib.dianneReeves = function() {

this.spriteSheet = ss["expanding_banner_atlas_"];

this.gotoAndStop(4);

}).prototype = p = new cjs.Sprite();

(lib.django = function() {

this.spriteSheet = ss["expanding_banner_atlas_"];

this.gotoAndStop(5);

}).prototype = p = new cjs.Sprite();

(lib.expandedPanel = function() {

this.spriteSheet = ss["expanding_banner_atlas_"];

this.gotoAndStop(6);

}).prototype = p = new cjs.Sprite();

(lib.titleSlide = function() {

this.spriteSheet = ss["expanding_banner_atlas_"];

this.gotoAndStop(7);

}).prototype = p = new cjs.Sprite();

(lib.VIEW_SCHEDULE = function() {

this.spriteSheet = ss["expanding_banner_atlas_"];

this.gotoAndStop(8);

}).prototype = p = new cjs.Sprite();

// helper functions:

function mc_symbol_clone() {

var clone = this._cloneProps(new this.constructor(this.mode, this.startPosition, this.loop));

clone.gotoAndStop(this.currentFrame);

clone.paused = this.paused;

clone.framerate = this.framerate;

return clone;

}

function getMCSymbolPrototype(symbol, nominalBounds, frameBounds) {

var prototype = cjs.extend(symbol, cjs.MovieClip);

prototype.clone = mc_symbol_clone;

prototype.nominalBounds = nominalBounds;

prototype.frameBounds = frameBounds;

return prototype;

}

(lib.viewSchedule = function(mode,startPosition,loop) {

this.initialize(mode,startPosition,loop,{});

// Layer_1

this.instance = new lib.VIEW_SCHEDULE();

this.instance.parent = this;

this.instance.setTransform(-128,-44.5);

this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));

}).prototype = p = new cjs.MovieClip();

p.nominalBounds = new cjs.Rectangle(-128,-44.5,256,89);

(lib.titleSlide_1 = function(mode,startPosition,loop) {

this.initialize(mode,startPosition,loop,{});

// Layer_1

this.instance = new lib.titleSlide();

this.instance.parent = this;

this.instance.setTransform(-312.5,-260.5);

this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));

}).prototype = getMCSymbolPrototype(lib.titleSlide_1, new cjs.Rectangle(-312.5,-260.5,625,521), null);

(lib.link1 = function(mode,startPosition,loop) {

this.initialize(mode,startPosition,loop,{});

// Layer_1

this.shape = new cjs.Shape();

this.shape.graphics.f("rgba(214,214,214,0.4)").s().p("EgyxAqMMAAAhUXMBljAAAMAAABUXg");

this.shape._off = true;

this.timeline.addTween(cjs.Tween.get(this.shape).wait(3).to({_off:false},0).wait(1));

}).prototype = p = new cjs.MovieClip();

p.nominalBounds = null;

(lib.expanded_panel = function(mode,startPosition,loop) {

this.initialize(mode,startPosition,loop,{});

// Layer_1

this.instance = new lib.expandedPanel();

this.instance.parent = this;

this.instance.setTransform(-625,-260.5);

this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));

}).prototype = getMCSymbolPrototype(lib.expanded_panel, new cjs.Rectangle(-625,-260.5,1250,521), null);

(lib.django_1 = function(mode,startPosition,loop) {

this.initialize(mode,startPosition,loop,{});

// Layer_1

this.instance = new lib.django();

this.instance.parent = this;

this.instance.setTransform(-312.5,-260.5);

this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));

}).prototype = getMCSymbolPrototype(lib.django_1, new cjs.Rectangle(-312.5,-260.5,625,521), null);

(lib.dianne = function(mode,startPosition,loop) {

this.initialize(mode,startPosition,loop,{});

// Layer_1

this.instance = new lib.dianneReeves();

this.instance.parent = this;

this.instance.setTransform(-312.5,-260.5);

this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));

}).prototype = getMCSymbolPrototype(lib.dianne, new cjs.Rectangle(-312.5,-260.5,625,521), null);

(lib.christian = function(mode,startPosition,loop) {

this.initialize(mode,startPosition,loop,{});

// Layer_1

this.instance = new lib.christianMcbride();

this.instance.parent = this;

this.instance.setTransform(-312.5,-260.5);

this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));

}).prototype = getMCSymbolPrototype(lib.christian, new cjs.Rectangle(-312.5,-260.5,625,521), null);

(lib.cecile = function(mode,startPosition,loop) {

this.initialize(mode,startPosition,loop,{});

// Layer_1

this.instance = new lib.cecileMclorin();

this.instance.parent = this;

this.instance.setTransform(-312.5,-260.5);

this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));

}).prototype = getMCSymbolPrototype(lib.cecile, new cjs.Rectangle(-312.5,-260.5,625,521), null);

(lib.buyTickets = function(mode,startPosition,loop) {

this.initialize(mode,startPosition,loop,{});

// Layer_1

this.instance = new lib.BUY_TICKETS();

this.instance.parent = this;

this.instance.setTransform(-99.5,-44.5);

this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));

}).prototype = p = new cjs.MovieClip();

p.nominalBounds = new cjs.Rectangle(-99.5,-44.5,199,89);

(lib.antonio = function(mode,startPosition,loop) {

this.initialize(mode,startPosition,loop,{});

// Layer_1

this.instance = new lib.antonioSanchez();

this.instance.parent = this;

this.instance.setTransform(-312.5,-260.5);

this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));

}).prototype = getMCSymbolPrototype(lib.antonio, new cjs.Rectangle(-312.5,-260.5,625,521), null);

// stage content:

(lib.RECOVER_animatefileexpandingmaybe = function(mode,startPosition,loop) {

this.initialize(mode,startPosition,loop,{});

// timeline functions:

this.frame_0 = function() {

var _this = this;

/*

Clicking on the specified symbol instance executes a function.

*/

_this.linkButton1.on('click', function(){

/*

Loads the URL in a new browser window.

*/

window.open('https://www.thiswebsite.com', '_blank');

});

}

this.frame_74 = function() {

if(!this.alreadyExecuted){

this.alreadyExecuted=true;

this.loopNum=1;

} else {

this.loopNum++;

if(this.loopNum==3){

this.stop();

}

}

}

this.frame_75 = function() {

this.gotoAndPlay('django');

}

this.frame_76 = function() {

var _this = this;

/*

Clicking on the specified symbol instance executes a function.

*/

_this.closeSchedule.on('click', function () {

/*

Makes the specified object visible or invisible.

*/

_this.closeSchedule.visible = false;

});

var _this = this;

/*

Clicking on the specified symbol instance executes a function.

*/

_this.viewSchedule.on('click', function(){

/*

Makes the specified object visible or invisible.

*/

_this.closeSchedule.visible = true;

});

this.stop();

}

// actions tween:

this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(74).call(this.frame_74).wait(1).call(this.frame_75).wait(1).call(this.frame_76).wait(1));

// schedule

this.closeSchedule = new lib.expanded_panel();

this.closeSchedule.name = "closeSchedule";

this.closeSchedule.parent = this;

this.closeSchedule.setTransform(300.2,125,0.48,0.48,0,0,0,0.1,0.1);

this.closeSchedule._off = true;

this.closeSchedule.visible = false;

this.timeline.addTween(cjs.Tween.get(this.closeSchedule).wait(76).to({_off:false},0).wait(1));

// view_schedule

this.viewSchedule = new lib.viewSchedule();

this.viewSchedule.name = "viewSchedule";

this.viewSchedule.parent = this;

this.viewSchedule.setTransform(61.9,248.1,0.48,0.48,0,0,0,0.1,0.1);

this.viewSchedule._off = true;

new cjs.ButtonHelper(this.viewSchedule, 0, 1, 1);

this.timeline.addTween(cjs.Tween.get(this.viewSchedule).wait(76).to({_off:false},0).wait(1));

// link_layer

this.linkButton1 = new lib.link1();

this.linkButton1.name = "linkButton1";

this.linkButton1.parent = this;

this.linkButton1.setTransform(150.9,124.5,0.461,0.463);

new cjs.ButtonHelper(this.linkButton1, 0, 1, 2, false, new lib.link1(), 3);

this.timeline.addTween(cjs.Tween.get(this.linkButton1).wait(76).to({regX:-0.3,scaleX:0.16,scaleY:0.28,skewY:180,x:249.6,y:173.2},0).wait(1));

// buy_tickets

this.instance = new lib.buyTickets();

this.instance.parent = this;

this.instance.setTransform(252.7,248.1,0.48,0.48,0,0,0,0.1,0.1);

this.instance._off = true;

new cjs.ButtonHelper(this.instance, 0, 1, 1);

this.timeline.addTween(cjs.Tween.get(this.instance).wait(76).to({_off:false},0).wait(1));

// title

this.instance_1 = new lib.titleSlide_1();

this.instance_1.parent = this;

this.instance_1.setTransform(150,125,0.48,0.48,0,0,0,0,0.1);

this.instance_1._off = true;

this.timeline.addTween(cjs.Tween.get(this.instance_1).wait(76).to({_off:false},0).wait(1));

// cecile

this.instance_2 = new lib.cecile();

this.instance_2.parent = this;

this.instance_2.setTransform(150.5,125.5,0.48,0.48,0,0,0,0.1,0.1);

this.instance_2._off = true;

this.timeline.addTween(cjs.Tween.get(this.instance_2).wait(60).to({_off:false},0).wait(15).to({_off:true},1).wait(1));

// christian

this.instance_3 = new lib.christian();

this.instance_3.parent = this;

this.instance_3.setTransform(150.5,125.5,0.48,0.48,0,0,0,0.1,0.1);

this.instance_3._off = true;

this.timeline.addTween(cjs.Tween.get(this.instance_3).wait(45).to({_off:false},0).to({_off:true},15).wait(17));

// dianne

this.instance_4 = new lib.dianne();

this.instance_4.parent = this;

this.instance_4.setTransform(150.5,125.5,0.48,0.48,0,0,0,0.1,0.1);

this.instance_4._off = true;

this.timeline.addTween(cjs.Tween.get(this.instance_4).wait(30).to({_off:false},0).to({_off:true},15).wait(32));

// antonio

this.instance_5 = new lib.antonio();

this.instance_5.parent = this;

this.instance_5.setTransform(150.5,125.5,0.48,0.48,0,0,0,0.1,0.1);

this.instance_5._off = true;

this.timeline.addTween(cjs.Tween.get(this.instance_5).wait(15).to({_off:false},0).to({_off:true},15).wait(47));

// django

this.instance_6 = new lib.django_1();

this.instance_6.parent = this;

this.instance_6.setTransform(150.5,125.5,0.48,0.48,0,0,0,0.1,0.1);

this.timeline.addTween(cjs.Tween.get(this.instance_6).to({_off:true},15).wait(62));

}).prototype = p = new cjs.MovieClip();

p.nominalBounds = new cjs.Rectangle(300.5,124.5,300.4,251);

// library properties:

lib.properties = {

id: 'D5C2A7596806422485BF47DFF55456B3',

width: 600,

height: 250,

fps: 12,

color: "#000000",

opacity: 0.00,

manifest: [

{src:"expanding_banner_atlas_.png", id:"expanding_banner_atlas_"}

],

preloads: []

};

// bootstrap callback support:

(lib.Stage = function(canvas) {

createjs.Stage.call(this, canvas);

}).prototype = p = new createjs.Stage();

p.setAutoPlay = function(autoPlay) {

this.tickEnabled = autoPlay;

}

p.play = function() { this.tickEnabled = true; this.getChildAt(0).gotoAndPlay(this.getTimelinePosition()) }

p.stop = function(ms) { if(ms) this.seek(ms); this.tickEnabled = false; }

p.seek = function(ms) { this.tickEnabled = true; this.getChildAt(0).gotoAndStop(lib.properties.fps * ms / 1000); }

p.getDuration = function() { return this.getChildAt(0).totalFrames / lib.properties.fps * 1000; }

p.getTimelinePosition = function() { return this.getChildAt(0).currentFrame / lib.properties.fps * 1000; }

an.bootcompsLoaded = an.bootcompsLoaded || [];

if(!an.bootstrapListeners) {

an.bootstrapListeners=[];

}

an.bootstrapCallback=function(fnCallback) {

an.bootstrapListeners.push(fnCallback);

if(an.bootcompsLoaded.length > 0) {

for(var i=0; i<an.bootcompsLoaded.length; ++i) {

fnCallback(an.bootcompsLoaded);

}

}

};

an.compositions = an.compositions || {};

an.compositions['D5C2A7596806422485BF47DFF55456B3'] = {

getStage: function() { return exportRoot.getStage(); },

getLibrary: function() { return lib; },

getSpriteSheet: function() { return ss; },

getImages: function() { return img; }

};

an.compositionLoaded = function(id) {

an.bootcompsLoaded.push(id);

for(var j=0; j<an.bootstrapListeners.length; j++) {

an.bootstrapListeners(id);

}

}

an.getComposition = function(id) {

return an.compositions[id];

}

})(createjs = createjs||{}, AdobeAn = AdobeAn||{});

var createjs, AdobeAn;

This topic has been closed for replies.
Correct answer kglad

how are you testing?

are you opening the html from the publish directory on your computer?

are you moving or upload the files?

what does your developer console show?

1 reply

kglad
Community Expert
Community Expert
August 20, 2018

after you publish, how are you testing?

Participating Frequently
August 20, 2018

I'm testing in Google Chrome.

Respectfully,

Christy-Leigh Grosman

Graphic Design

NJPAC

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
August 20, 2018

how are you testing?

are you opening the html from the publish directory on your computer?

are you moving or upload the files?

what does your developer console show?