PublishProfile (class)

Categories:Flash

Overview

Summary

OO interface to Flash's publish settings

Contents

Concept

Flash's publish settings are only available to read or write via XML. This makes it somewhat cumbersome and a little unintuitive to alter settings that you might think would be straightforward to alter.

The new PublishProfile class is an attempt to make this process much more object-oriented, by providing a full API to properties, within groups, that you can get or set in a couple of key strokes. And because the class has a full API, you will be able to see its properties inside Komodo, making it easy to target a particular property and changed it as needed:

 

Usage

The PublishProfile class should be instantiated as a normal instance, then have its settings updated via its object properties:

var profile = new PublishProfile();

profile.file.flash        = true;
profile.file.flashPath    = '../bin/main.swf';
profile.as3.exportFrame   = 3;
profile.swf.compressMovie = false;

The settings will be saved automatically, and Flash's XML string will be updated and reimported behind the scenes:

API

Note that the documentation for the properties of this class will probably stay incomplete.

View the source code for more information regarding each property

Instantiation

PublishProfile(dom, autoSave)

PublishProfile constuctor - creates a new Profile based on the current or supplied Document

Parameters:

  • dom Document An optional Document instance; defaults to the currently open Document
  • autoSave Boolean An optional Boolean to resave the profile immediately when properties are set; defaults to true

The following example creates a new PublishProfile for the current document:

var profile = new PublishProfile();
trace(profile);
[object PublishProfile dom="example assets.fla"]	

Methods

load()

Loads the current Publish Profile XML

The following example reloads the Flash's publish profile settings into the current profile instance:

profile.load();

	

save()

Saves and reimports the current settings

The following example explicitly saves the current profile instance's settings:

profile.save();

	

File

file.defaultNames

Get and set the value for PublishFormatProperties.defaultNames

  • Type: Boolean
  • Access: Read and write

profile.file.defaultNames;

	

file.flashPath

Get and set the value for PublishFormatProperties.flashFileName

  • Type: String
  • Access: Read and write

profile.file.flashPath;

	

file.flash

Get and set the value for PublishFormatProperties.flash

  • Type: Boolean
  • Access: Read and write

profile.file.flash;

	

file.htmlPath

Get and set the value for PublishFormatProperties.htmlFileName

  • Type: String
  • Access: Read and write

profile.file.htmlPath;

	

file.html

Get and set the value for PublishFormatProperties.html

  • Type: Boolean
  • Access: Read and write

profile.file.html;

	

file.pngPath

Get and set the value for PublishFormatProperties.pngFileName

  • Type: String
  • Access: Read and write

profile.file.pngPath;

	

file.png

Get and set the value for PublishFormatProperties.png

  • Type: Boolean
  • Access: Read and write

profile.file.png;

	

file.jpegPath

Get and set the value for PublishFormatProperties.jpegFileName

  • Type: String
  • Access: Read and write

profile.file.jpegPath;

	

file.jpeg

Get and set the value for PublishFormatProperties.jpeg

  • Type: Boolean
  • Access: Read and write

profile.file.jpeg;

	

file.gifPath

Get and set the value for PublishFormatProperties.gifFileName

  • Type: String
  • Access: Read and write

profile.file.gifPath;

	

file.gif

Get and set the value for PublishFormatProperties.gif

  • Type: Boolean
  • Access: Read and write

profile.file.gif;

	

file.projectorWinPath

Get and set the value for PublishFormatProperties.projectorWinFileName

  • Type: String
  • Access: Read and write

profile.file.projectorWinPath;

	

file.projectorWin

Get and set the value for PublishFormatProperties.projectorWin

  • Type: Boolean
  • Access: Read and write

profile.file.projectorWin;

	

file.projectorMacPath

Get and set the value for PublishFormatProperties.projectorMacFileName

  • Type: String
  • Access: Read and write

profile.file.projectorMacPath;

	

file.projectorMac

Get and set the value for PublishFormatProperties.projectorMac

  • Type: Boolean
  • Access: Read and write

profile.file.projectorMac;

	

ActionScript

as3.version

Get and set the value for PublishFlashProperties.ActionScriptVersion

  • Type: Number
  • Access: Read and write

profile.as3.version;

	

as3.player

Get and set the value for PublishFlashProperties.ExternalPlayer and Version

  • Type: String
  • Access: Read and write

profile.as3.player;

	

as3.documentClass

Get and set the value for PublishFlashProperties.DocumentClass

  • Type: String
  • Access: Read and write

profile.as3.documentClass;

	

as3.packagePaths

Get and set the value for PublishFlashProperties.AS3PackagePaths

  • Type: String
  • Access: Read and write

profile.as3.packagePaths;

	

as3.packageExportFrame

Get and set the value for PublishFlashProperties.PackageExportFrame

  • Type: Number
  • Access: Read and write

profile.as3.packageExportFrame;

	

as3.libraryPaths

Get and set the value for PublishFlashProperties.AS3LibraryPaths

  • Type: String
  • Access: Read and write

profile.as3.libraryPaths;

	

as3.externalLibraryPaths

Get and set the value for PublishFlashProperties.AS3ExternalLibraryPaths

  • Type: String
  • Access: Read and write

profile.as3.externalLibraryPaths;

	

as3.configConst

Get and set the value for PublishFlashProperties.AS3ConfigConst

  • Type: String
  • Access: Read and write

profile.as3.configConst;

	

as3.strict

Get and set the value for PublishFlashProperties.AS3Strict

  • Type: Boolean
  • Access: Read and write

profile.as3.strict;

	

as3.warnings

Get and set the value for PublishFlashProperties.AS3Coach (warnings)

  • Type: Boolean
  • Access: Read and write

profile.as3.warnings;

	

as3.autoDeclare

Get and set the value for PublishFlashProperties.AS3AutoDeclare

  • Type: Boolean
  • Access: Read and write

profile.as3.autoDeclare;

	

as3.dialect

Get and set the value for PublishFlashProperties.AS3Dialect (ES|AS3)

  • Type: String
  • Access: Read and write

profile.as3.dialect;

	

as3.exportFrame

Get and set the value for PublishFlashProperties.AS3ExportFrame

  • Type: Number
  • Access: Read and write

profile.as3.exportFrame;

	

as3.optimize

Get and set the value for PublishFlashProperties.AS3Optimize

  • Type: Boolean
  • Access: Read and write

profile.as3.optimize;

	

Image

image.quality

Get and set the value for PublishFlashProperties.Quality

  • Type: Number
  • Access: Read and write

profile.image.quality;

	

image.deblockingFilter

Get and set the value for PublishFlashProperties.DeblockingFilter

  • Type: Boolean
  • Access: Read and write

profile.image.deblockingFilter;

	

Sound

image.streamFormat

Get and set the value for PublishFlashProperties.StreamFormat (Pass in a PublishProfile.CONSTANTS.audioFormat value)

  • Type: Number
  • Access: Read and write

profile.image.streamFormat;

	

image.streamBitRate

Get and set the value for PublishFlashProperties.StreamCompress (Pass in a value from 8 to 160)

  • Type: Number
  • Access: Read and write

profile.image.streamBitRate;

	

image.eventFormat

Get and set the value for PublishFlashProperties.EventFormat (Pass in a PublishProfile.CONSTANTS.audioFormat value)

  • Type: Number
  • Access: Read and write

profile.image.eventFormat;

	

image.eventBitRate

Get and set the value for PublishFlashProperties.EventCompress (Pass in a value from 8 to 160)

  • Type: Number
  • Access: Read and write

profile.image.eventBitRate;

	

image.overrideSounds

Get and set the value for PublishFlashProperties.OverrideSounds

  • Type: Boolean
  • Access: Read and write

profile.image.overrideSounds;

	

image.deviceSound

Get and set the value for PublishFlashProperties.DeviceSound

  • Type: Boolean
  • Access: Read and write

profile.image.deviceSound;

	

image.streamUse8kSampleRate

Get and set the value for PublishFlashProperties.StreamUse8kSampleRate

  • Type: Boolean
  • Access: Read and write

profile.image.streamUse8kSampleRate;

	

image.eventUse8kSampleRate

Get and set the value for PublishFlashProperties.EventUse8kSampleRate

  • Type: Boolean
  • Access: Read and write

profile.image.eventUse8kSampleRate;

	

SWF

swf.compressMovie

Get and set the value for PublishFlashProperties.CompressMovie

  • Type: Boolean
  • Access: Read and write

profile.swf.compressMovie;

	

swf.includeHiddenLayers

Get and set the value for PublishFlashProperties.InvisibleLayer

  • Type: Boolean
  • Access: Read and write

profile.swf.includeHiddenLayers;

	

swf.exportSWC

Get and set the value for PublishFlashProperties.ExportSwc

  • Type: Boolean
  • Access: Read and write

profile.swf.exportSWC;

	

swf.includeMetaData

Get and set the value for PublishFlashProperties.IncludeXMP

  • Type: Boolean
  • Access: Read and write

profile.swf.includeMetaData;

	

Advanced Settings

advanced.generateSizeReport

Get and set the value for PublishFlashProperties.Report

  • Type: Boolean
  • Access: Read and write

profile.advanced.generateSizeReport;

	

advanced.protectFromImport

Get and set the value for PublishFlashProperties.Protect

  • Type: Boolean
  • Access: Read and write

profile.advanced.protectFromImport;

	

advanced.omitTraceActions

Get and set the value for PublishFlashProperties.OmitTraceActions

  • Type: Boolean
  • Access: Read and write

profile.advanced.omitTraceActions;

	

advanced.permitDebugging

Get and set the value for PublishFlashProperties.DebuggingPermitted

  • Type: Boolean
  • Access: Read and write

profile.advanced.permitDebugging;

	

advanced.debuggingPassword

Get and set the value for PublishFlashProperties.DebuggingPassword

  • Type: String
  • Access: Read and write

profile.advanced.debuggingPassword;

	

advanced.useNetwork

Get and set the value for PublishFlashProperties.UseNetwork (Playback security)

  • Type: Boolean
  • Access: Read and write

profile.advanced.useNetwork;

	

advanced.hardwareAcceleration

Get and set the value for PublishFlashProperties.HardwareAcceleration

  • Type: Number
  • Access: Read and write

profile.advanced.hardwareAcceleration;

	

advanced.scriptTimeLimit

Get and set the value for PublishFlashProperties.ScriptStuckDelay

  • Type: Number
  • Access: Read and write

profile.advanced.scriptTimeLimit;

	

Top

top.topDown

Get and set the value for PublishFlashProperties.TopDown

  • Type: object
  • Access: Read and write

profile.top.topDown;

	

top.fireFox

Get and set the value for PublishFlashProperties.FireFox

  • Type: Number
  • Access: Read and write

profile.top.fireFox;

	

Comments are closed.