20 February 2012
Previous experience with Edge is assumed. Work through the steps in Beginner's guide to Adobe Edge Preview 3 for a primer on the Edge basics.
Additional requirements
Beginning
Since the first preview release of Adobe Edge on August 1, 2011, hundreds of thousands of copies of this application have been downloaded. When you consider that Edge is not even a beta product, is freely available, has undergone three major revisions since then, and has garnered so much interest, it would be safe to assume that Edge is poised to become an integral part of the web design and development toolbox.
Edge Preview 1 focused on the interface, graphics, and motion. Preview 2 incorporated feedback on Preview 1 and featured a number of interface bug fixes. Preview 3 introduced interactivity. This release, Preview 4, builds on Preview 3 with several significant new features and improvements, including the use of Symbols, web fonts, and clipping.
Because the new features in Edge Preview 4 are so interesting, it makes sense to work through a separate tutorial—this one—that will enable you to extend the skills presented in Beginner's guide to Adobe Edge Preview 3. If you have never used Edge, complete that tutorial to learn the fundamentals before continuing here.
Before diving into the project, set up your environment by:
The project you are going to construct was initially featured in a Sneak Peek on the Adobe Edge Team Blog. In it, team member Sarah Hunt created a banner ad for a fictional car company. Follow these steps to get started:
Choose File > New to create a new Edge document and set the stage size to 728 pixels wide by 80 pixels high.
The first major change you will notice is the addition of a Library Panel (see Figure 1), which provides access to assets (graphics added to your project), as well as Symbols and fonts, both of which you will work with later.
Though you can always import files by choosing File > Import, with Edge Preview 4 you can speed things up by dragging and dropping content directly from the file system.
The background.png size doesn’t quite fit the stage. Prior to this release of Edge, resizing required use of the Properties panel. In Edge Preview 4, you can use the new Transform tool in the Tools panel to resize the image to fit the stage.
The gradient is now properly sized (see Figure 4).
Note: One thing this new Transform tool cannot do is rotate the selection. That still requires a visit to the Rotate area of the Properties panel, though it has been publically stated that rotation capabilities will be added to the Transform tool in the next preview release.
If you are a Flash Professional user, you’re likely familiar with Symbols. Symbols have been introduced in Edge Preview 4. In fact, the icon for an Edge Symbol is closely related to the movieclip Symbol from Flash.
In very simple terms, a Symbol in Edge is a self-contained, reusable item. In Edge, Symbols:
Follow these steps to see how all of this works:
When you select the Autoplay Timeline option for a Symbol, any animation contained within it will play when you press the space bar to play the movie on the main Timeline. If it is not selected, the Symbol will not play automatically at runtime; it will have to be controlled using a script.
When a Symbol is selected, you can add Actions to it in the Properties panel (see Figure 6). In addition, if you select the Scrub option, the animation within a Symbol will play when you scrub the playhead across the main Timeline.
You can edit Symbols in the Library in two ways. You can right-click the Symbol in the Library panel and then select Edit Symbol. Alternatively, you can edit the Symbol in place.
If you are a Flash Professional user you are likely familiar with the ability to open Symbols right on the main Timeline, make changes to the Symbol, and have those changes instantly appear on the Timeline. You can use the same technique in Edge Preview 4.
Follow these steps to give the car two spinning wheels:
Two things happen. Everything but the car is grayed out, and a breadcrumb trail appears at the top of the stage (see Figure 7).
You may have noticed the wheels stop spinning at the one second mark on the main Timeline. This is due to the duration of the spin animation in the wheel Symbol. There are two ways of addressing this:
Follow these steps to implement the second technique:
When you do this, the script panel will open. The panel is actually named Trigger because you are using code to tell Edge to trigger an action when the playhead reaches this point. In this case you want to move the playhead back to the 0 point on the Timeline and play the animation.
If you prefer to write your own JavaScript, you can type your code directly into this panel and not concern yourself with the snippets. As well, the code panel in Edge Preview 4 includes some code short cuts. If you click the e in function (sym,e) at the top of the code block, a list of these shorts cuts is presented to you (see Figure 10).
If you click the Panel properties button in the Script panel (see Figure 11) you will see that you now have the ability to:
Obviously the car is larger than the stage and needs to be resized. Follow these steps to shrink it down and put the car in motion:
If you test the project in a browser, you’ll see that the car scoots across the stage but when it stops the wheels keep spinning. This is due to the script added to the Wheel Symbol. One of the neat features of Edge is the ability to control Symbol playback from the main Timeline. Here’s how:
sym.getSymbol("Car").getSymbol("Front").stop();
sym.getSymbol("Car").getSymbol("Rear").stop();
Essentially, the first line tells Edge to find the Element named Front in the Car Symbol and stop it from playing.
No matter how you approach it, the use of fonts on the web has been problematic at best. In the past, if the user didn’t have the font your application used on his or her machine you would have had to accept the fact that your really nice Garamond was likely going to be replaced by Times. If you were still adamant about your choice of font, then you converted the text to an image file or you resorted to a font replacement technology such as sIFR. This dark age of web type may just be fading away thanks to the fact that HTML5 compliant browsers, generally, can use the @fontface tag.
This capability has been added to Edge, so you can now use web fonts from a variety of vendors and add them to the Font panel of your Edge projects. In this example, you are going to add web fonts using two sources: Typekit, which is a commercial solution, and Google Fonts, which is an open source solution.
Note: Though this is all very encouraging there are legal considerations involved. As Sarah Hunt notes on the Edge team’s blog: "Most fonts come with an EULA (End user license agreement) that specifies how the font can be used. For example, you can purchase a font to use for print, but the EULA can say you are not allowed to embed that font for web use. In the past few years a lot of font foundries and font services have been picking up on the trend of web based fonts and writing EULAs that specifically target web use (how many sites can be embedded, how many views, etc.) For the purposes of the Web Font tool in Edge, the onus of liability is left up to the user to know what their limitations of the font file are. There simply isn’t a feasible way for Edge to determine if the EULA for the font is valid or not, especially since Edge only handles the CSS stylesheet for the font and not the file itself.”
To start with Typekit, which just happens to be a part of Adobe, follow these steps:
Note: If you are setting up a Typekit account, you also need to create a Kit after you sign in. Make sure the Domain in your Kit Settings is 127.0.0.1. This is your localhost IP address and is how the fonts you choose will be displayed in Edge.
Note: Some fonts have extra Weights and Styles associated with them. To this point in the Edge preview release cycle you can choose only the Roman, Italic, and Bold weights of the fonts if you want them to render in Edge. Other styles such as the Semibold and Semibold Italic will not render. The Edge team is aware of this limitation and is working on a solution.
The dialog box also prompts you to add a list of fallback fonts (or the font stack) that Edge will use. Although you can manually type it here, there is a good chance that you may mistype the proper names for the web font. There is actually an easier way of accomplishing this task.
Note: To delete an item from the Fonts panel, select it and press the Delete key. The font will be removed from both the Fonts panel and the Font list in the Properties panel.
Note: When you add a font, you may notice a small icon for the font appear at the bottom of the stage. Don’t worry about; it will not appear when the movie is published. It is there to indicate that you are using a Typekit font.
The process for using Google web fonts is quite similar to the process used for Typekit:
Edge Preview 4 includes two more new features: Element Display and Clipping.
The Element Display feature gives you control of an element’s display attribute. The three settings are: Off , On , and Always On . If you select Off , the element is removed from the browser’s rendering tree, increasing efficiency. Select On and the element is displayed when you need to see it. Select Always On and, as the name implies, the element is always visible.
You can use Clipping in the Properties panel to create some rather interesting masking effects. Clipping is ideal for situations in which a CSS spritesheet is used in an Edge animation, although that topic is beyond the scope of this tutorial.
To better understand how the Clipping and Element Display features work, you can apply them to the text Element on the stage. The plan is to have the text appear as the car zips across the text block.
In this tutorial, you’ve applied many of the major new features of Edge Preview 4. You started by dragging content from the file system into Edge and discovered that items added to your Edge document are now automatically added to the Library panel. From there you explored the new Symbols feature and learned how Symbols are created, nested, manipulated, and removed from an Edge document. You saw how to add web fonts from services such as Typekit and Google Web Fonts to your Edge projects using simple copy and paste actions. Lastly, you applied the new Display Element and Clipping features.
For a more complete list of the improvements in Edge Preview 4 see Mark Anders’ blog post on the subject.
Now that you have some experience with Edge, take some time to explore the samples page on Labs. Download a few of the samples. Open them in Edge. Dissect them and start learning how to do even more with Edge.
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.