Skip to main content
paul_james123
Inspiring
February 28, 2017
Answered

Import statements in html wrapper?

  • February 28, 2017
  • 1 reply
  • 993 views

Well, I'm still stalled here:

I resolved the 2 bugs in Stiller's Sound Sync demo (see link to his zip files below) that Colin pointed out earlier in this thread: https://forums.adobe.com/thread/2283273

...and have it working as an Animate CC project.

However, when I try to put that sound sync code, specifically this part:

import net.quip.sound.SoundSync;

import net.quip.sound.CuePointEvent;

...into the framescript of my Animate project, it crashes (blank page results when trying to test in browser).

Probably, that's because those import lines need to be put into the html wrapper, right?

So, I tried to put those lines into the template that my Animate project uses (inserting them at the end of my <head> section of my template) like this:

<script>

import net.quip.sound.SoundSync;

import net.quip.sound.CuePointEvent;

</script>

But when I put this:

var ss:SoundSync = new SoundSync();

...into my Animate's FLA framescript it still crashes upon test.

Any ideas what I'm doing wrong?

Thanks!

====================

Stiller's Sound Sync demo:

http://www.adobe.com/content/dotcom/en/devnet/actionscript/articles/cue_points_audio/_jcr_content/articlePrerequistes/multiplefiles/node_1275446929093/file.res/sound_sync.zip

    This topic has been closed for replies.
    Correct answer Colin Holgate

    You would normally not be testing with HTML at all. When you do a test movie it makes a swf. If you get that working you would later on maybe add it to a web page, and then the HTML is just a wrapper.

    It's not like how HTML5 Canvas works, where having some of the code in the HTML is normal.

    1 reply

    Colin Holgate
    Colin HolgateCorrect answer
    Inspiring
    February 28, 2017

    You would normally not be testing with HTML at all. When you do a test movie it makes a swf. If you get that working you would later on maybe add it to a web page, and then the HTML is just a wrapper.

    It's not like how HTML5 Canvas works, where having some of the code in the HTML is normal.

    paul_james123
    Inspiring
    March 1, 2017

    Thanks Colin.

    I guess I need some guidance.

    I read in Animate help, that "To create all the files you need to put Animate content on the web, use the Publish command"

    Also I'm using Greensock tweens in my Animate project and the GSAP framework tutorial recommends this:

    "Unlike Flash content that was neatly wrapped up in a single .swf file, Adobe Animate CC needs to publish an HTML file that typically:

    • Loads external JavaScript libraries (CreateJS).
    • Creates the <canvas> where artwork will be rendered.
    • Contains JavaScript that initializes your project.
    • Loads custom JavaScript unique to your project (symbol definitions, animation code)."

    (Creating GSAP Templates for Adobe Animate CC | GreenSock )

    ...So if I'm using Animate in that way, should I export as SWF?

    If so, then should keep the:

    import net.quip.sound.SoundSync;

    import net.quip.sound.CuePointEvent;

    ...in the FLA's frame script?

    Thanks

    ps. My project includes complex animation that will ultimately be viewed as responsive web content.

    Colin Holgate
    Inspiring
    March 1, 2017

    For testing you don't need to use Publish.

    For Greensock you will need to use their AS3 libraries, and not their Javascript libraries.

    GitHub - greensock/GreenSock-AS3: Public repository for GreenSock's ActionScript 3 libraries like GSAP (TweenLite, Tween…

    Yes, keep the import lines in the frame script.