Link in Zwischenablage kopieren
Kopiert
I'm a beginner. Sorry! But I've created an animation that works. It's simple and very straight forward.
But it doesn't do what I want which is to start when I click "Start" then loop three times and stop at the end of the animation at frame 58.
Here's what I have:
in Layer 1, frame 1 of the animation I have this:
var _this = this;
_this.stop();
In Layer 1, frame 2 and to the end (frame 58 is end) I have this:
if (!this.looped) this.looped = 1;
if (this.looped++ > 3) this.gotoAndStop('58');
In Layer 2, frame 1 and to the end I have this (and a "Start" button):
var _this = this;
_this.button_2.on('click', function(){
_this.gotoAndPlay('2');
});
Animation starts when I click "Start" but it only plays once, then goes back to beginning and stops. It seems my "Stop" in Layer 1, frame 1 overrides the loop command? But what do I do to prevent the animation to auto play on load if I don't have a Stop action in there?
Link in Zwischenablage kopieren
Kopiert
It sounds like you're creating a banner ad. But your code is AS3, which won't work in an HTML5 Canvas document, which is what you have to use for ads now.
Which is it?
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
You seem to have ignored the part of my post where I said you can't use AS3 code. You can't use AS3 code. You have to use JavaScript. Look at the code hints for Canvas documents. Look at the browser developer console for errors when testing the page.
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
I've revised my original post to include the actual code I've used. Would greatly appreciate help with this!
Link in Zwischenablage kopieren
Kopiert
Hey Hanna. Here is an example of how you could do it.
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
you must be doing it wrong. from ANCC, press ctrl-enter or cmd-enter. It should open your browser.
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
That's insane! I tried it on multiple browser and this is the correct way to do it.
If it is a video, then in the component parameters check off autoplay.
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Link in Zwischenablage kopieren
Kopiert
Change the code to:
i++;
if(i<6){
	this.gotoAndPlay(2);
} else{
	this.gotoAndStop(0);
	
}
Weitere Inspirationen, Events und Ressourcen finden Sie in der neuen Adobe Community
Jetzt ansehen