Posts in Category "General"

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.

Flash Pro CC – Performance | Faster | Streamlined

Hello everyone!

Flash Pro CC is released and you must have noticed the big boost up to the performance. With a completely new 64-bit modularized architecture, native cocoa: modularized, Flash Pro CC is faster and more reliable. With this, we could achieve faster start time, file opening and saving, timeline scrubbing, and more.

Please watch the video for complete information!

Flash Pro CC | User Interface | Then and Now

The UI of Flash Pro CC has been completely redesigned to provide a crisp, focused, and fresh experience. Some of the key changes are:

Dark UI Theme

The dark UI theme allows you to focus completely on the stage and your content when working with Flash Pro. Although you can switch over to a lighter theme, Flash Pro CC is available to you with the Dark UI enabled.

fl_dark_UI

Keyboard Shortcuts

  • (A) The Keyboard Shortcuts panel is now equipped with a Search facility that allows you to drill-down to the right Command, easily.
  • (B) You can also copy the entire list of Keyboard Shortcuts to the clipboard and then, to a text editor for quick reference.
  • (C) In a conflict, when setting a keyboard shortcut for a command, a warning message is displayed. And you can quickly navigate to the conflicting command, modify it to resolve the conflict.
  • (D) You can modify a set of shortcuts and save them as a preset. You can then select and use the preset per your convenience.

KeyboardShortcuts

Preferences Panel

  • Sync Prefernces to Creative Cloud and download on another machine.
  • Fully streamlined options for handling Flash Pro Warnings.
  • Code editor related preferences integrated into one tab.

Preference

ActionScript Editor

  • New and completely streamlined editor
  • Intelligent commenting
  • Integration with Scintilla

Find and Replace dialog

  • Ability to search across all open documents(both  fla’s and scripts)
  • Ability search test fields and code (i.e in actions panel and in scripts) separately
  • Limit search to current frame
  • Streamlined UI for better usability

FindAndReplace

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!