Copy link to clipboard
Copied
Hi,
I'm a rare user of Adobe Animate so please bear with.
I have a .swf that I created 5 years ago for a website. I wish to reuse it after converting it to HTML5.
The conversion seemed straightforward enough as there's a site online that could do it. When it came back however the animation looped recurrently.
Is there a way within Animate CC to convert the original .fla (which I still have) to HTML5 and keep the 'loop once' property?
Thanks
Jim
Yeah - just use this.stop(); on teh final frame. There is also an option in the publish settings where you can turn looping off and on for HTML5 Canvas.
Copy link to clipboard
Copied
You can open the AS3 document .fla within Animate CC and choose Commands > Convert to other document formats from the application menu. From here, choose HTML5 Canvas and it will be saved to a new file targeting that platform.
To have it loop once (play twice?) you will need to create a variable to keep track on teh first frame and then increment it on the final frame. Additionally, check on the final frame whether the variable has been incremented or not and either stop or whatever.
FRAME 1:
var loop = true;
FRAME {LAST}:
if(loop){
loop = false;
}else{
this.stop();
}
Copy link to clipboard
Copied
Thanks Joseph,
I think I meant 'play once' and then stop. Apologies if I misled: assuming I can salvage the last part of your script though and tag
this.stop();
onto the last frame? Also, the method for getting it saved afterwards; do I now use 'publish' rather than export? (the latter steers me down the road of creating another .swf)
Regards,
Jim
Copy link to clipboard
Copied
Yeah - just use this.stop(); on teh final frame. There is also an option in the publish settings where you can turn looping off and on for HTML5 Canvas.
Copy link to clipboard
Copied
Seems to be doing the trick – thanks Joseph. Just to confirm 'publish' is now the way to save the animations? (with export .swf soon to be a legacy)
And from there I pass the images + .js files etc to my web-developer so he can insert them on my site?
Copy link to clipboard
Copied
Not at all. Publish is how you produce SWF for Flash Player as well. SWF is not going away.
Yeah, Publish should create a set of files and folders you can pass along - exactly.
Copy link to clipboard
Copied
You've been more than helpful, cheers for your assistance and insight Joseph.
Jim
Copy link to clipboard
Copied
swf will continue to be used for any AS3 projects, including AIR for desktop and AIR for mobile.
With HTML5 you can try your file out with Test Movie, as you would with swf. When it does that it inserts a random number everyway, to avoid browser caching issues. Before sending the html, js, images and sounds to your developer, do use File/Publish one last time. Then it will not include those random numbers.
Copy link to clipboard
Copied
A good tip too Colin, thanks.
Copy link to clipboard
Copied
What was the site that did the conversion for you?
Copy link to clipboard
Copied
Hello Colin,
the site was: flash-to-html5(dot)net and the conversion it returned was a single myfilename.HTML file (wrapper?) with all the gubbins inside.
Rgds
Jim