{"id":14011,"date":"2018-02-15T16:37:57","date_gmt":"2018-02-15T16:37:57","guid":{"rendered":"https:\/\/coherent-labs.com\/?p=14011"},"modified":"2018-03-14T10:07:41","modified_gmt":"2018-03-14T10:07:41","slug":"create-spa-without-single-line-code","status":"publish","type":"post","link":"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/","title":{"rendered":"How to create SPA without a single line of code"},"content":{"rendered":"<h3>What are Single Page Applications?<\/h3>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Single-page_application\" target=\"_blank\" rel=\"nofollow noopener\">Single-Page Applications (SPA)<\/a>\u00a0are Web applications that load a single HTML page and dynamically update that page as the user interacts with the application. The biggest difference between SPAs and multi-page applications is that navigating an SPA doesn&#8217;t involve going to an entirely new page, instead, the pages (commonly known as\u00a0<em>views<\/em>\u00a0in this context) load inline within the same page itself.<\/p>\n<p>In this tutorial we will show you how to create a SPA without having to writ\u0435 a single line of code, using\u00a0<a href=\"http:\/\/www.adobe.com\/products\/animate.html\" target=\"_blank\" rel=\"nofollow noopener\">Adobe Animate<\/a>\u00a0and the Coherent Exporter Add-on.<\/p>\n<h3>Creating SPA without coding<\/h3>\n<p>Our SPA will have a simple navigation bar with tabs and three pages of content. Each of the pages will be an Animate&#8217;s Symbol. Loading the relevant pages&#8217; content (highlighted with red) will be done by clicking on the tabs:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14018 size-full\" src=\"https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/mark.png\" alt=\"SPA without coding tutorial\" width=\"1277\" height=\"718\" \/><\/p>\n<p>Let&#8217;s start with creating the navigation for the SPA example. Craft it with Animate&#8217;s tools and convert every one of the tabs on the right to Symbols with Instance names. Later, we will attach them with JavaScript logic from the Exporter.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14019 size-full\" src=\"https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/navigation.png\" alt=\"SPA tutorial navigation adobe animate\" width=\"1915\" height=\"719\" \/><\/p>\n<h3>Creating pages as Symbols<\/h3>\n<p>The following images represent the pages&#8217; content:<\/p>\n<ul>\n<li>the first page (view):<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14020 size-full\" src=\"https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/pageOne.png\" alt=\"HTML multi-page spa tutorial\" width=\"1277\" height=\"716\" \/><\/p>\n<ul>\n<li>the second page (view):<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14021 size-full\" src=\"https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/pageTwo.png\" alt=\"SPA UI without coding tutorial\" width=\"1275\" height=\"716\" \/><\/p>\n<ul>\n<li>the third page (view):<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14022 size-full\" src=\"https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/pageThree.png\" alt=\"SPA UI without coding exmple\" width=\"1277\" height=\"717\" \/><\/p>\n<p>Let&#8217;s start with the first page. Craft it with the Animate&#8217;s tools, select all of the elements and convert them into a single Symbol with an Instance name. Select it and from the Animate&#8217;s Properties menu remove the Visible checkbox&#8217; tick:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14023 size-full\" src=\"https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/visible.png\" alt=\"adobe animate coherent tutorial\" width=\"343\" height=\"445\" \/><\/p>\n<p>In the empty Scene, create the second page, convert it to Symbol with Instance name and make it invisible. Do the same with the third page.<\/p>\n<h3>Show\/Hide options in the Exporter<\/h3>\n<p>To make the link between each tab and the relevant page, we will use the Exporter&#8217;s Show\/Hide options. \u0422hey are called in a JavaScript&#8217;s event and point to a target of our choice.<\/p>\n<p>Select the &#8216;PAGE ONE&#8217; tab&#8217;s Symbol, go to the Exporter&#8217;s Events menu and add the following options:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14024 size-full\" src=\"https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/target1.png\" alt=\"adobe animate spa tutorial\" width=\"1254\" height=\"267\" \/><\/p>\n<p>For the remaining tabs the options are as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14025 size-full\" src=\"https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/target2.png\" alt=\"adobe animate second page target\" width=\"1254\" height=\"266\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14026 size-full\" src=\"https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/target3.png\" alt=\"adobe animate page target tutorial\" width=\"1250\" height=\"266\" \/><\/p>\n<p>Publish and preview the Scene. Let&#8217;s look at the\u00a0<code>Scene_1.html<\/code>&#8216;s markup to see what&#8217;s behind the Show\/Hide options. The pages&#8217; visibility is controlled by adding\u00a0<code>target.style.display=\"none\"<\/code>\u00a0or\u00a0<code>target.style.display=\"inline\"<\/code>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14027 size-full\" src=\"https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/markup.png\" alt=\"SPA UI scene markup tutorial\" width=\"686\" height=\"497\" \/><\/p>\n<p>In order to make the first page&#8217;s content visible when the Scene is loaded, select the page&#8217;s Symbol, from Animate&#8217;s Properties menu add the tick to the Visible checkbox.<\/p>\n<p><strong>Note:<\/strong>\u00a0If you find difficulties with selecting the intended Symbol because the elements are overlapping, you can send it to the front\/back. You can do this by right-clicking on the Symbol and choose Arrange and Bring\/Send to Front\/Back from the context menu:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14028 size-full\" src=\"https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/arrange.png\" alt=\"Adobe Animate arrange the layers\" width=\"883\" height=\"633\" \/><\/p>\n<h3>Video preview<\/h3>\n<p>The video below illustrates the final result:<\/p>\n<div style=\"width: 1140px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-14011-1\" width=\"1140\" height=\"641\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/video.mp4?_=1\" \/><a href=\"https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/video.mp4\">https:\/\/coherent-labs.com\/wp-content\/uploads\/2017\/12\/video.mp4<\/a><\/video><\/div>\n","protected":false},"excerpt":{"rendered":"<p>What are Single Page Applications? Single-Page Applications (SPA)\u00a0are Web applications that load a single HTML page and dynamically update that page as the user interacts with the application. The biggest difference between SPAs and multi-page applications is that navigating an SPA doesn&#8217;t involve going to an entirely new page, instead, the pages (commonly known as\u00a0views\u00a0in [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":13471,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1,408],"tags":[245,349,357,412,229,269],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to create SPA without a single line of code - tutorial<\/title>\n<meta name=\"description\" content=\"Learn about Single-Page Applications with our tutorial, which shows how to create an SPA without having to writ\u0435 a single line of code, using Adobe Animate and Coherent Exporter.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to create SPA without a single line of code - tutorial\" \/>\n<meta property=\"og:description\" content=\"Learn about Single-Page Applications with our tutorial, which shows how to create an SPA without having to writ\u0435 a single line of code, using Adobe Animate and Coherent Exporter.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/\" \/>\n<meta property=\"og:site_name\" content=\"Coherent Labs\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CoherentLabs\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-15T16:37:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-14T10:07:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/coherent-labs.com\/posts\/wp-content\/uploads\/2017\/11\/techtorials-748x210-100.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"749\" \/>\n\t<meta property=\"og:image:height\" content=\"210\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Alexandra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CoherentLabs\" \/>\n<meta name=\"twitter:site\" content=\"@CoherentLabs\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alexandra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/\",\"url\":\"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/\",\"name\":\"How to create SPA without a single line of code - tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/coherent-labs.com\/posts\/#website\"},\"datePublished\":\"2018-02-15T16:37:57+00:00\",\"dateModified\":\"2018-03-14T10:07:41+00:00\",\"author\":{\"@id\":\"https:\/\/coherent-labs.com\/posts\/#\/schema\/person\/b0252689790c3d1c9036209533d03791\"},\"description\":\"Learn about Single-Page Applications with our tutorial, which shows how to create an SPA without having to writ\u0435 a single line of code, using Adobe Animate and Coherent Exporter.\",\"breadcrumb\":{\"@id\":\"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/coherent-labs.com\/posts\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to create SPA without a single line of code\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/coherent-labs.com\/posts\/#website\",\"url\":\"https:\/\/coherent-labs.com\/posts\/\",\"name\":\"Coherent Labs\",\"description\":\"Cross-Platform Game UI Middleware\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/coherent-labs.com\/posts\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/coherent-labs.com\/posts\/#\/schema\/person\/b0252689790c3d1c9036209533d03791\",\"name\":\"Alexandra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/coherent-labs.com\/posts\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/687476ba742eac5c6da76b305bc4004b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/687476ba742eac5c6da76b305bc4004b?s=96&d=mm&r=g\",\"caption\":\"Alexandra\"},\"url\":\"https:\/\/coherent-labs.com\/posts\/author\/alexandra\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to create SPA without a single line of code - tutorial","description":"Learn about Single-Page Applications with our tutorial, which shows how to create an SPA without having to writ\u0435 a single line of code, using Adobe Animate and Coherent Exporter.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/","og_locale":"en_US","og_type":"article","og_title":"How to create SPA without a single line of code - tutorial","og_description":"Learn about Single-Page Applications with our tutorial, which shows how to create an SPA without having to writ\u0435 a single line of code, using Adobe Animate and Coherent Exporter.","og_url":"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/","og_site_name":"Coherent Labs","article_publisher":"https:\/\/www.facebook.com\/CoherentLabs\/","article_published_time":"2018-02-15T16:37:57+00:00","article_modified_time":"2018-03-14T10:07:41+00:00","og_image":[{"width":"749","height":"210","url":"https:\/\/coherent-labs.com\/posts\/wp-content\/uploads\/2017\/11\/techtorials-748x210-100.jpg","type":"image\/jpeg"}],"author":"Alexandra","twitter_card":"summary_large_image","twitter_creator":"@CoherentLabs","twitter_site":"@CoherentLabs","twitter_misc":{"Written by":"Alexandra","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/","url":"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/","name":"How to create SPA without a single line of code - tutorial","isPartOf":{"@id":"https:\/\/coherent-labs.com\/posts\/#website"},"datePublished":"2018-02-15T16:37:57+00:00","dateModified":"2018-03-14T10:07:41+00:00","author":{"@id":"https:\/\/coherent-labs.com\/posts\/#\/schema\/person\/b0252689790c3d1c9036209533d03791"},"description":"Learn about Single-Page Applications with our tutorial, which shows how to create an SPA without having to writ\u0435 a single line of code, using Adobe Animate and Coherent Exporter.","breadcrumb":{"@id":"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/coherent-labs.com\/posts\/create-spa-without-single-line-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/coherent-labs.com\/posts\/"},{"@type":"ListItem","position":2,"name":"How to create SPA without a single line of code"}]},{"@type":"WebSite","@id":"https:\/\/coherent-labs.com\/posts\/#website","url":"https:\/\/coherent-labs.com\/posts\/","name":"Coherent Labs","description":"Cross-Platform Game UI Middleware","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/coherent-labs.com\/posts\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/coherent-labs.com\/posts\/#\/schema\/person\/b0252689790c3d1c9036209533d03791","name":"Alexandra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/coherent-labs.com\/posts\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/687476ba742eac5c6da76b305bc4004b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/687476ba742eac5c6da76b305bc4004b?s=96&d=mm&r=g","caption":"Alexandra"},"url":"https:\/\/coherent-labs.com\/posts\/author\/alexandra\/"}]}},"_links":{"self":[{"href":"https:\/\/coherent-labs.com\/posts\/wp-json\/wp\/v2\/posts\/14011"}],"collection":[{"href":"https:\/\/coherent-labs.com\/posts\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coherent-labs.com\/posts\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coherent-labs.com\/posts\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/coherent-labs.com\/posts\/wp-json\/wp\/v2\/comments?post=14011"}],"version-history":[{"count":11,"href":"https:\/\/coherent-labs.com\/posts\/wp-json\/wp\/v2\/posts\/14011\/revisions"}],"predecessor-version":[{"id":14588,"href":"https:\/\/coherent-labs.com\/posts\/wp-json\/wp\/v2\/posts\/14011\/revisions\/14588"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/coherent-labs.com\/posts\/wp-json\/wp\/v2\/media\/13471"}],"wp:attachment":[{"href":"https:\/\/coherent-labs.com\/posts\/wp-json\/wp\/v2\/media?parent=14011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coherent-labs.com\/posts\/wp-json\/wp\/v2\/categories?post=14011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coherent-labs.com\/posts\/wp-json\/wp\/v2\/tags?post=14011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}