Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • SiteCatalyst
  • Students
  • Elements family

Adobe Creative Cloud

  • What is Adobe Creative Cloud?
  • Design
  • Web
  • Photography
  • Video
  • Students
  • Teams
  • Enterprise
  • Educational institutions

Design and photography

  • Photoshop
  • Illustrator
  • InDesign
  • Adobe Muse
  • Lightroom

Video

  • Adobe Premiere
  • After Effects

Web development and HTML5

  • Edge Tools & Services [opens in a new window]
  • Dreamweaver
  • Gaming [opens in a new window]

Adobe Marketing Cloud

  • What is Adobe Marketing Cloud?
  • Digital analytics
  • Social marketing
  • Web experience management
  • Testing and targeting
  • Media optimization

Analytics

  • SiteCatalyst
  • Adobe Discover
  • Insight

Social

  • Adobe Social

Experience Manager

  • CQ
  • Scene7

Target

  • Test&Target
  • Recommendations
  • Search&Promote

Media Optimizer

  • AdLens
  • AudienceManager
  • AudienceResearch

Document services

  • Acrobat
  • EchoSign [opens in a new window]
  • FormsCentral [opens in a new window]
  • SendNow [opens in a new window]
  • Acrobat.com [opens in a new window]

Publishing

  • Digital Publishing Suite

  • See all products
Business solutions

By business need

  • Digital analytics
  • Digital publishing
  • Document management
  • Media optimization
  • Social marketing
  • Testing and targeting
  • Video editing and serving
  • Web development [opens in a new window]
  • Web experience management
  • See all business needs

By industry

  • Broadcast
  • Education
  • Financial services
  • Government
  • Publishing
  • Retail
  • See all industries
Support & Learning

I need help

  • Products
  • Adobe Creative Cloud
  • Adobe Marketing Cloud
  • Forums [opens in a new window]

I want to learn

  • Training and tutorials
  • Certification [opens in a new window]
  • Adobe Developer Connection
  • Adobe Design Center
  • Adobe TV [opens in a new window]
  • Adobe Marketing Center
  • Adobe Labs [opens in a new window]
Download
  • Product trials
  • Adobe Flash Player
  • Adobe Reader
  • Adobe AIR
  • See all downloads
Company
  • Careers at Adobe
  • Investor Relations
  • Newsroom
  • Privacy
  • Corporate Social Responsibility
  • Customer Showcase
  • Contact us
  • More company info
Buy
  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers
  • Adobe Marketing Cloud sales [opens in a new window]
Search
 
Info Sign in
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Welcome,
My Adobe
My orders
My information
My preferences
My products and services
Sign out
My cart
Privacy My Adobe
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out Privacy My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Promotions
Estimated shipping
Tax
Calculated at checkout
Total
Review and Checkout
Adobe Developer Connection / Adobe Edge resources /

Bootstrapping Edge compositions with bootstrapCallback

by Josh Hatwich

Josh Hatwich
  • edge.adobe.com
  • blogs.adobe.com/edge

Content

  • Code Example: Playing three compositions in sequence
  • Where to go from here

Created

30 July 2012

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
customizationHTML5integrationJavaScript
Was this helpful?
Yes   No

By clicking Submit, you accept the Adobe Terms of Use.

 
Thanks for your feedback.

Requirements

Prerequisite knowledge

Prerequisite knowledge

Some familiarity with Adobe Edge® and HTML markup.

 

Required Adobe products

  • * Adobe Edge preview
  • * An HTML editor, such as Adobe Dreamweaver (Try or Buy) or Brackets (an open-source code editor)

User level

Beginning

Sample files

  • edge-bootstrap-example.zip

We added a small feature with Adobe Edge preview 6 that makes a big difference if you are trying to combine multiple Edge compositions so that they will work together, or if you are integrating an Edge composition into a larger website framework. In this example, you will learn how to use the AdobeEdge.bootstrapCallback API that the Adobe Edge team added to preview 6, so that you can programmatically register a callback function when users land on HTML pages within your website; in short, this allows you and your applications to access event listeners for Symbol and Timeline events without editing an Edge composition xyz_edgeActions.js file directly.  

How does this work? The Edge preloader now defines the AdobeEdge.bootstrapCallback API, which allows you to register a callback function from the context of your HTML page that will be called when your Edge composition is loaded and ready to play. This callback provides a hook to register event listeners for Symbol and Timeline events, something that was previously only possible from within an Edge composition xyz_edgeActions.js file.

Code Example: Playing three compositions in sequence

The following looks at an example that plays a series of compositions in sequence. The example ZIP file that you downloaded from the Requirements section contains three "finished" Edge compositions that allow you to focus on editing the wrapper.html file that combines the three compositions.  The compositions that we’ll use are very simple:

  • page_a.html
  • page_b.html
  • page_c.html

Setting up the project

Edge does not support editing multiple compositions in the same file. You still might want to make edits to a composition after integrating it into a larger site. An emerging practice is to edit the compositions separately via a composition-specific HTML files and then combine then in a single wrapper.html file that your site uses to preview the combined work.

Figure 1. To preview, combine composition files in a single wrapper file. This diagram maps the file structure for a website.
Figure 1. To preview, combine composition files in a single wrapper file. This diagram maps the file structure for a website.

You can place the wrapper and each of the pages in the same directory so that they can share resources.

Including the three compositions

First the wrapper.html must include each of the compositions, as shown in the code in Figure 2.

Figure 2. Add the compositions to the wrapper file.
Figure 2. Add the compositions to the wrapper file.

Adding HTML markup for each stage

For each Edge composition, associate a stage DIV with a class name identical to the Edge composition’s ID.

Figure 3. Associate each Edge composition with an identical DIV class name.
Figure 3. Associate each Edge composition with an identical DIV class name.

Adding CSS to position three stages

Each Edge composition lives inside a stage DIV element. Without a little help from CSS, the three stages flow and display one after another. The stages also all appear when the page loads. In this example, the code hides the second and third stage until the right time in the sequence, as shown in the code for Figure 4.

Figure 4. Hiding the second and third stage until the right time in the sequence.
Figure 4. Hiding the second and third stage until the right time in the sequence.

Bootstrapping with JavaScript

Since Edge loads using a preloader script, very few JavaScript APIs are reliably available from the wrapper HTML page. The preloader downloads Edge and jQuery libraries dynamically; therefore, the HTML page needs a hard signal that indicates when it is safe to call into jQuery and Edge APIs. Add the following code to establish callback -- in other words, indicate -- when it is safe for your page to call jQuery and Edge APIs.

AdobeEdge.bootstrapCallback(function (compId) {   //your function will be called when the composition is ready to play });

Coordinating multiple compositions

Your bootstrap function coordinates three compositions. As each composition loads and becomes ready, each composition calls the callback you’ve registered. Coordinate the compositions by keeping track of loading using the loadedComps variable.

Figure 5. Keep track of loading by using the loadedComps variable.
Figure 5. Keep track of loading by using the loadedComps variable.

Registering Edge-specific callbacks

The Edge composition is ready when the the Edge runtime issues the bootstrap callback. You can safely bind to Edge callback APIs. You can use the same syntax here as is in the xyz_edgeActions.js file. The following code listens for the timeline to complete. When one timeline completes, it hides the related composition and then shows and plays the next one in the sequence.

Figure 6. When the timeline completes: hide what was played, and show and play the next.
Figure 6. When the timeline completes: hide what was played, and show and play the next.

It is pretty simple!

Here is the finished result. (This finished result is more for you to inspect and see the functionality, rather than for your viewing pleasure.)

Where to go from here

There are a host of great resources collected on the Adobe Edge website and the on the Adobe team blogs. If you require help or have suggestions for the Edge team, you can find the core engineering and product management team on the Adobe Edge user forum.

More Like This

  • Beginner's guide to Adobe Edge Preview 3
  • Beginner's guide to Adobe Edge Preview 4

Products

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • Digital Publishing Suite
  • Elements family
  • SiteCatalyst
  • For education

Download

  • Product trials
  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR

Support & Learning

  • Product help
  • Forums

Buy

  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2013 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

Ad Choices

Reviewed by TRUSTe: site privacy statement