Author Archive: Suhas

Flash Professional CC | Publish Persistent Metadata

This feature allows you to create plug-ins by attaching arbitrary metadata to individual objects via JSAPI. The metadata is then published to either the stagPlaceObject4 SWF tag in Flash Player 11.6 or to an external metadata file (JSON, XML, etc.). This feature builds on the existing persistent data functionality already available with Flash Pro.

What is supported?

  • Supported Object Types: You can add metadata to Movie clips, Buttons, and Text. These objects must necessarily be placed on Stage.
  • Supported Data Types: Metadata can be of Integer, Double, or String datatypes.
  • Supported Publish Targets: Flash Player 11.6, SWF, JSON,

How does the feature work?

  1. Create a SWF panel UI or write JSFL commands.
  2. Call JSAPI to set, get, clear, and publish persistent data.
  3. Data is added to selected object in the fla and is available when the file is saved and re-opened.
  4. Use any of the two Publishing Options:
    • Publish to SWF with unique “EMBED_SWF” format key. This will embed the persistent data in the SWF in the object.metaData property when the FLA is published.
    • Custom publishing format (such as “EXTERN_JSON”) requires extension developer to write a SWF panel or JSFL file to traverse document at publish time and manually export persistent data to an external file.
  5. To access metadata embedded in SWF (“EMBED_SWF”) write AS to access the metaData property such as “myInstance.metadata…”. To access custom publishing format in external file, add code to SWF to load and parse the external file.

Try this demo:

  1. Download Blog Testfiles archive file.
  2. Extract the contents of the ZIP to an accessible location on your computer.
  3. Launch Flash Pro CC, and ensure that you have Adobe Extension Manager installed. For more information, see this help article.
  4. Install the Dynamic Layout.zxp file, a sample extension that showcases the feature (for more information, see this help article). This panel allows you to anchor your object at runtime.
  5. Relaunch Flash Pro CC.
  6. In Flash, go to Window > Extensions > Dynamic Layout.
  7. Create a new AS3 file targeting Flash Player 11.6.
  8. Create a symbol and place it to the left and toward the bottom of the stage, and select the symbol.
  9. In Dynamic Layout panel, select the Embed in SWF during Publish option. A new Dynamic Layout Actions layer is created.
  10. Check the Left and Bottom box.
  11. Test your Movie in Flash Professional.
  12. Resize your SWF window to see your object anchor to the spot.

Once you have installed the extension, you can see all the commands and source code to build the actual panel. Also available is the code it executes at runtime located inside Flash user config folder.

Flash User Config folder is located at:

  • Windows – C:\Users\<username>\AppData\Local\Adobe\Flash CC\en_US\Configuration\WindowSWF\Dynamic Layout
  • Mac - Volume/Users/<username>/Library/Application Support/Adobe/Flash CC/en_US/Configuration/WindowSWF/Dynamic Layout

 

Sample files include:

MetaDataUtilities (sample jsfl code)

  • PersistentDataClearAll.jsfl
  • PersistentDataInspect.jsfl,
  • PersistentDataSetExample.jsfl

PanelSource (actual fla that creates the dynamic layout panel)

  • Dynamic Layout.fla
  • DynamicLayout.as

RuntimeAndExampleCode

  • DynamicLayoutClient.as,
  • DynamicLayoutUtils.jsfl
  • ExportPersistantDataJSON.jsfl

 

Sample JSAPI:

You can make use of the following sample JSAPIs when adding persistent metadata:

// get the first selected element

var elem =

fl.getDocumentDOM().getTimeline().layers0.frames0.elements0;

// add persistent data “myAlign” of “left”

elem.setPersistentData( "myAlign", "string", "left" );

// mark persistent data as exported and embedded in SWF during

publish elem.setPublishPersistentData("myAlign", "EMBED_SWF", true);

// also mark data as exportable during a CUSTOM “EXTERN_JSON” JSFL

script elem.setPublishPersistentData("myAlign", "EXTERN_JSON", true);

 

// special key for enabling publishing of persistent data to SWF at

publish time fl.getDocumentDOM().setPublishDocumentData("EMBED_SWF", true);

 

// Also enable for custom “EXTERN_JSON” format

fl.getDocumentDOM().setPublishDocumentData("EXTERN_JSON", true);

The following APIs must be set with same publish format and passed “true” for persistent data to publish.This allows control at the individual item level as well as enabling / disabling for the entire document.

  • element.setPublishPersistentData()
  • document.setPublishDocumentData()

 JSAPIs

The following JSAPIs are needed for this feature. Those in blue are new to Flash CC.

Name Parameters Return Type Description Example

void element.setPersistentData(name:String, type:String, value);

name: name of the datatype “integer”, “double” etc none Stores data with an object. Data is written to .fla file and available toJavaScriptwhen the file is re-opened.

fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].setPersistentData( “myData”, “integer”, 12 );

variable element.getPersistentData(name:String);

name: name of the data variable – returns the stored data Returns the value of the specified data. The type returned depends on the type of data that was stored.

var data = fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].getPersistentData( “name” );

void element.removePersistentData(name:String);

name: name of the data None Removes any persistent data that has been attached to the object with the given name.

var elem = fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0];elem.removePersistentData( “myData” );

void element.setPublishPersistentData(name:string, publishFormat:String, publish:Boolean);

name: name of the datapublishFormat: the format for which this data gets published*
publish: if true, this item gets published
false: do not publish this item
none Enable / disable publishing for single item of persistent data
 // get the first selected element
var elem = fl.getDocumentDOM().getTimeline().layers0.frames0.elements0;// add persistent data “myAlign” of “left”
elem.setPersistentData( “myAlign”, “string”, “left” );// mark persistent data as exported and embedded in SWF during publish
elem.setPublishPersistentData(“myAlign”, “EMBED_SWF“, true);// also mark data as exportable during a CUSTOM “EXTERN_JSON” JSFL script
elem.setPublishPersistentData(“myAlign”, “EXTERN_JSON“, true);// special key for enabling publishing of persistent data to SWF at publish time
fl.getDocumentDOM().setPublishDocumentData(“EMBED_SWF“, true);// Also enable for custom “EXTERN_JSON” format
fl.getDocumentDOM().setPublishDocumentData(“EXTERN_JSON“, true);Both

  • element.setPublishPersistentData()
  • document.setPublishDocumentData()
    must be set with same publish format and passed “true” for persistent data to publish.This allows control at the individual item level as well as enabling / disabling for the entire document. |

Boolean element.getPublishPersistentData(name:String,fl.getDocumentDOM().setPublishDocumentData(“EMBED_SWF“, true);

publishFormat: the format for which this data gets published* bool returns true if this data item will be published for the given publishing format Get whether the data is to be published  (see above)

fl.getDocumentDOM().setPublishDocumentData(publishFormat:String, publish:Boolean);

publiishFormat: the publishing format for which to enable/disable for entire documentpublish: enable/disable publsihing none enable or disable publishing of persistent data for the entire document  (see above)

Boolean fl.getDocumentDOM().getPublishDocumentData(publishFormat:String);

publiishFormat: the publishing format for which to enable/disable for entire document  true if publishing of persistent data is enabled in the document for the specified publishing format Returns true if publishing of persistent data has been enabled for the speciifed publishing format in this document  (see above)

void LibraryItem.setPublishData(name:string, publishFormat:String, publish:Boolean);

same as element.setPublishPersistentData()
“_EMBED_SWF” not supported on library items

BooleanLibraryItem.getPublishData(name:String,fl.getDocumentDOM().setPublishDocumentData(“MY_FORMAT“, true);

same as element.getPublishPersistentData()
“_EMBED_SWF” not supported on library items

About PublishFormat

A unique string which specifies the various publishing format for which this data gets published.

  • EMBED_SWF” is one special key which causes this data to be embedded inside a SWF file at publish time in the object.metaData property. Requires Flash Player 11.6 (SWF version 19) or above.
  • Any other tag may be used for custom output such as “EXTERN_JSON” if the developer also writes a corresponding JSFL script to the traverse the document and export to the new format.

Enhancements | Publish workflow | AIR Applications | Flash Professional CC

Flash Professional CC contains several exciting changes to the AIR application development workflow. These changes enhance the development, testing, debugging, and publish workflows within Flash. Besides these changes, you will also be able to publish AIR applications to iOS devices that support High Resolution Retina Display. To know more watch the video!

Announcing Flash Professional CC – Toolkit for Dart

 At Google I/O, 2013, Adobe announced The Toolkit for Dart, a new extension to Flash Professional CC. You can now create rich, interactive, and animated content, and publish to the Dart language. Dart is Google’s own open-source Web Programming Language that supports many drawing capabilities and core animation delivered by Flash Professional. It includes support for images and vectors, movie clips and graphics animations, buttons, text, audio, and the filters and blend modes supported by the HTML5 canvas.

Ok, now, here’s something that’s awesome: Adobe intends to contribute the extension to the Dart community by open-sourcing the project. For more information on the extension, see this announcement.

What is Flash Professional CC?

Renaissance.

Although I said that casually, but I am sure the word means something unique to each one of you. For those who think the term sounds alien, before you pop-open Google, Renaissance means rebirth or reincarnation. Commonly, it refers to the cultural movement that began (roughly during 14th century) in Italy and spread right across Europe. Renaissance was that rare phenomenon, which laid a foundation for revolution, restructuring, progress, and ultimately, prosperity.

Adobe Flash Professional CC, a part of the Adobe Creative Cloud offering, has been completely re-engineered, quite literally from ground-zero. Effectively, it’s the true renaissance of your very own Flash Pro. It’s been in the making for a few years now, and we are extremely pleased and proud to present it along with other stunning applications of Creative Cloud.

That said, a pertinent question, what is Adobe Flash Professional CC all about, really? Well, here’s a dip-stick view of it.

 

 

fl_64bitThe Architecture, MAC-friendliness, and the Boost (a la NOS!)

Flash Pro CC is a comprehensively refactored, modular, 64-bit application. During the course of this release, the entire code-base was refreshed to turn Flash Pro in to a native cocoa application.

This refactoring brings in dramatic changes to how Flash Pro performs. It now delivers unprecedented speed and stability. Large files are not only easily manageable, but can also be published ever so quickly. You will also observe that the timeline is highly-responsive, as you begin to work with Flash Pro CC.

 

 

fl_HighDef

We’re HD, and quite gloriously so

Ever considered exporting all the rich content you create to a full HD output? Well, you can more than just consider, now. Flash Pro CC allows you to export all content, from nested timelines to script-driven animations, to an HD output seamlessly. All this, with zero loss of frames!

 

 

fl_flToHtml5

HTML5, from within

The Toolkit for CreateJS is now fully integrated with Flash Pro, and is enhanced to support publishing of buttons, motion curves, and hit-areas to HTML5. Your content can now be completely seamlessly converted to HTML5 (thanks to umpteen bug fixes on Toolkit for CreateJS), and yet, preserve the richness and interactivity.

 

 

fl_dark_UI

It’s black or white

Choose to work with dark or light user-interface themes with Flash Pro CC. The streamlined user-interface, with intuitive dialogs and panels, centers your focus fully on the stage and content.

 

 

fl_HiDPI

Rich, crisp, and a lot of detail with Hi-DPI
The Flash Professional user-interface supports Hi-DPI displays, including high resolution retina display available with MacBook Pro. This dramatically improves visual fidelity and screen resolution adding a lot more detail to how Flash Pro is displayed.

 

 

fl_publishToMultipleDevices

Work with multiple devices

Imagine being able to work with multiple devices of varying screen sizes, configurations, and capabilities – simultaneously. Flash Pro CC enables seamless publishing of AIR applications to iOS devices connected via USB.

 

 

fl_unlimited_pasteboard

Unlimited, unending, and infinite

With unlimited pasteboard/work-area you can manage infinitely large backgrounds and off-stage. While working with unlimited work-area, you can also shift your focus back to the stage using the Center-to-stage option.

 

 

fl_timeline

Efficient beyond measure

With several key enhancements made to timeline and drawing tools, Flash Pro CC brings in a high degree of workflow efficiency, particularly for designers and animators.

  • Distribute objects on Stage to individual keyframes each with the click of a button
  • Swap multiple symbol instances or bitmaps with any other symbol or bitmap preserved in the library or created on Stage
  • Set properties to multiple layers simultaneously
  • Mark multiple layers as guides or masks
  • Work in full screen mode without panels or toolbars to distract you
  • Proportionally expand or contract timeline ranges
  • Move Timeline ranges across the timeline with the length intact
  • Preview colors live when using drawing tools and color picker
  • Use the time-saving in-line controls for graphic filters

 

fl_AS_editor

Comment, uncomment, comment

Take full advantage of intelligent code commenting along with the completely simplified ActionScript Editor interface.

 

 

SyncSettings_flWhere ever you go, your settings follow you

You can now sync preference (s) settings to Creative Cloud and download across two machines when working with Flash Pro. This allows you to apply all your preferences on two different machines at one-go! (for example, computers at work and home.)