Flex Based Workflow Tools For The Flash IDE

36
® Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 1 Creating Workflow Tools for the Flash IDE Ian McLean Chris Deely Tim O’Hare #AdobeMax266

Transcript of Flex Based Workflow Tools For The Flash IDE

Page 1: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 1

Creating Workflow Tools for the Flash IDE

Ian McLean

Chris Deely

Tim O’Hare

#AdobeMax266

Page 2: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 2

The User

Upload Assets

Edit Custom Settings

Video EncodingPlatformPlatform

DesignerDeveloper

Page 3: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 3

The User

Mindless

Repetitive

Time ConsumingPlatformPlatform

DesignerDeveloper

Page 4: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 4

The User

Workflow Tool PlatformPlatform

DesignerDeveloper

Page 5: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 5

The Problem

Work Faster

Be more consistent

Provide a higher quality level

Do more with less

WORK SMARTER NOT HARDER

Manually rotating every one of these 1000 snowflakes sucks!

Page 6: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 6

Go with the Flow

OutputOutputCreative Tasks

Creative Tasks

Enable more Mindful / Creative Tasks

Step 1Easy

Step 2Advanced

Step 3Easy

The Workflow Tool

Page 7: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 7

Go with the Flow

OutputOutputCreative Tasks

Creative Tasks

Reduce Steps for the User

Step 1Easy

Step 2Advanced

The Workflow Tool

Page 8: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 8

Go with the Flow

OutputOutputCreative Tasks

Creative Tasks

Lower the Learning Curve

Step 1Easy

Step 2Easy

The Workflow Tool

Page 9: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 9

Go with the Flow

OutputOutputCreative Tasks

Creative Tasks

Work faster with more consistency

Step 1Easy

Step 2Easy

The Workflow Tool

Accomplish more with less work

Page 10: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 10

The Power at your Fingertips

Your users already understand the IDE

Don’t reinvent the wheel

Page 11: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 11

Examples of Workflow Tools for the Flash IDE

Panel to Flash IDE

CUSTOM PANEL UICUSTOM PANEL UI

Manipulate MovieClips

Page 12: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 12

Examples of Workflow Tools for the Flash IDE

Panel to Flash IDE

CUSTOM PANEL UICUSTOM PANEL UI

Manipulate Text

Page 13: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 13

Examples of Workflow Tools for the Flash IDE

Panel to Flash IDE

CUSTOM PANEL UICUSTOM PANEL UI

ManipulateActionScript

Page 14: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 14

Server-Side Logic

Server-Side Logic

Examples of Workflow Tools for the Flash IDE

Panel to Server-Side Logic

CUSTOM PANEL UICUSTOM PANEL UI

Update Server-Side Data

Page 15: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 15

Examples of Workflow Tools for the Flash IDE

Panel to Flash IDE & Server-Side Logic

CUSTOM PANEL UICUSTOM PANEL UI

Server-Side Logic

Server-Side Logic

Update Server-Side Data

Manipulate MovieClips

Page 16: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 16

Let’s Build Something

Page 17: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 17

Available Technologies:

JSFL (For IDE level functionality)

XUL (XML based Prompts and Pop-ups)

C Level extensibility

Custom Panel Windows (SWF Based)

Page 18: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 18

Flash CS4 Custom Panel Windows

SWF based content

Sizable

Dockable

Example: Project Window

Page 19: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 19

Panel, Meet Flex

Flex automatically works in Flash CS4 (Flex 4 too!)

What Flex brings to the table

Liquid layouts

Advanced component set

Custom component architecture

Easy consumption of web services

MXML, Flash Builder, Rapid prototyping

Page 20: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 20

Creating a Panel Window

Step 1:

Place any .swf in to the WindowSWF directory.

Step 2:

Open panel from Window->Other Panels menu

…Yes, it’s really that easy.

Configuration/WindowSWF

Page 21: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 21

WindowSWF Paths

Mac:/Library/Application Support/Adobe/Flash CS4/en/Configuration/WindowSWF

Windows:\Application Data\Adobe\Flash CS4\language\Configuration\WindowSWF

Page 22: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 22

DEMO

Page 23: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 23

Ok, So What Can A Panel Do?

Nearly everything Flash IDE itself can do

Manipulate Objects on the Stage

Manipulate the timeline

Generate Actionscript on the fly

Interface with Components

Basic file access

Page 24: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 24

How User Actions Work

User Action

JSFL Call

var doc = fl.getDocumentDOM()var timeline = doc.getTimeline()timeline.addNewLayer()

MagicalLow(er) Level

Code

MagicalLow(er) Level

Code

Page 25: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 25

The Flash IDE Document Object Model (DOM)

fl.getDocumentDom();

fl.getDocumentDom().library

fl.getDocumentDom().getTimeline();

Page 26: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 26

JSFL API Hierarchy

Page 27: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 27

Example JSFL

Print to the output panel:fl.trace(“Hello World”);

Read a text File:var s = FLfile.read(“/Users/Ian/MyFile.txt”);

Delete a selected object:fl.getDocumentDOM().currentSelection[0].delete();

Remember:

JSFL requires FLA to be open in order to perform FLA-related functionality

Document related functionality requires an open document

Page 28: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 28

Configuring a Flex panel project

Point the output directory to WindowSWF/MyPanel folder

Keep files you want copied to WindowSWF in “src”

Page 29: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 29

Keep all supporting files in a package with your project name

Disable the HTML wrapper

Configuration/WindowSWFProject structure

Keep it Tidy

Page 30: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 30

How to Execute JSFL in a SWF

MMExecute(JSFLCommand:String);

Ex:import adobe.utils.MMExecute;MMExecute(“fl.trace(‘hello world’)”);

Page 31: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 31

And some more…

Run an external script

MMExecute(“fl.runScript(‘sample.js’)”);

Call a function and pass in an argument

MMExecute(“fl.runScript(‘sample.js’, ‘doSomething’,’” + myVar “’)”);

Access the configuration directory

MMExecute(“fl.runScript( fl.configURI + ‘WindowSWF/sample.js’)”);

Page 32: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 32

DEMO

Page 33: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 33

Tips for writing JSFL

JSFL editor in Flash CS4

External JSFL files

fl.trace() for debugging

JSON for passing objects

Page 34: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 34

Common Challenges

Problem: JSFL variables are not persistent

Solution: Treat JSFL like a Command pattern.

Problem: Panels do not automatically maintain their state when closes

Solution: Write/Read state information to disc with FLfile

Problem:File I/O is string only.No file handles outside of FileReference. Flash player File upload/download restrictions apply.

Solution: Persuade your local C guru to write a library

Page 35: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 35

Resources

Extending Flash CS4 Reference - Adobehttp://help.adobe.com/en_US/Flash/10.0_ExtendingFlash/index.htmlhttp://bit.ly/My63F

Project FilesWatch the Twitter tag #adobemax266 for details

Follow UsIan McLeanhttp://devote.your.life.auricom.com@ianmclean

Chris Deelyhttp://blog.webdeely.com@chrisdeely

Bother TimTim O’[email protected]

Page 36: Flex Based Workflow Tools For The Flash IDE

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 36