PublishProfile (class)
Overview
Summary
OO interface to Flash's publish settings
Contents
- Overview
- API
- Instantiation
- Methods
- File
- defaultNames
- flashPath
- flash
- htmlPath
- html
- pngPath
- png
- jpegPath
- jpeg
- gifPath
- gif
- projectorWinPath
- projectorWin
- projectorMacPath
- projectorMac
- ActionScript
- version
- player
- documentClass
- packagePaths
- packageExportFrame
- libraryPaths
- externalLibraryPaths
- configConst
- strict
- warnings
- autoDeclare
- dialect
- exportFrame
- optimize
- Image
- Sound
- streamFormat
- streamBitRate
- eventFormat
- eventBitRate
- overrideSounds
- deviceSound
- streamUse8kSampleRate
- eventUse8kSampleRate
- SWF
- Advanced Settings
- generateSizeReport
- protectFromImport
- omitTraceActions
- permitDebugging
- debuggingPassword
- useNetwork
- hardwareAcceleration
- scriptTimeLimit
- Top
- Utilities
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
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
profile.file.defaultNames;
file.flashPath
Get and set the value for PublishFormatProperties.flashFileName
profile.file.flashPath;
file.projectorWinPath
Get and set the value for PublishFormatProperties.projectorWinFileName
profile.file.projectorWinPath;
file.projectorWin
Get and set the value for PublishFormatProperties.projectorWin
profile.file.projectorWin;
file.projectorMacPath
Get and set the value for PublishFormatProperties.projectorMacFileName
profile.file.projectorMacPath;
file.projectorMac
Get and set the value for PublishFormatProperties.projectorMac
profile.file.projectorMac;
ActionScript
as3.version
Get and set the value for PublishFlashProperties.ActionScriptVersion
profile.as3.version;
as3.player
Get and set the value for PublishFlashProperties.ExternalPlayer and Version
profile.as3.player;
as3.documentClass
Get and set the value for PublishFlashProperties.DocumentClass
profile.as3.documentClass;
as3.packagePaths
Get and set the value for PublishFlashProperties.AS3PackagePaths
profile.as3.packagePaths;
as3.packageExportFrame
Get and set the value for PublishFlashProperties.PackageExportFrame
profile.as3.packageExportFrame;
as3.libraryPaths
Get and set the value for PublishFlashProperties.AS3LibraryPaths
profile.as3.libraryPaths;
as3.externalLibraryPaths
Get and set the value for PublishFlashProperties.AS3ExternalLibraryPaths
profile.as3.externalLibraryPaths;
as3.configConst
Get and set the value for PublishFlashProperties.AS3ConfigConst
profile.as3.configConst;
as3.warnings
Get and set the value for PublishFlashProperties.AS3Coach (warnings)
profile.as3.warnings;
as3.autoDeclare
Get and set the value for PublishFlashProperties.AS3AutoDeclare
profile.as3.autoDeclare;
as3.dialect
Get and set the value for PublishFlashProperties.AS3Dialect (ES|AS3)
profile.as3.dialect;
as3.exportFrame
Get and set the value for PublishFlashProperties.AS3ExportFrame
profile.as3.exportFrame;
Image
image.deblockingFilter
Get and set the value for PublishFlashProperties.DeblockingFilter
profile.image.deblockingFilter;
Sound
image.streamFormat
Get and set the value for PublishFlashProperties.StreamFormat (Pass in a PublishProfile.CONSTANTS.audioFormat value)
profile.image.streamFormat;
image.streamBitRate
Get and set the value for PublishFlashProperties.StreamCompress (Pass in a value from 8 to 160)
profile.image.streamBitRate;
image.eventFormat
Get and set the value for PublishFlashProperties.EventFormat (Pass in a PublishProfile.CONSTANTS.audioFormat value)
profile.image.eventFormat;
image.eventBitRate
Get and set the value for PublishFlashProperties.EventCompress (Pass in a value from 8 to 160)
profile.image.eventBitRate;
image.overrideSounds
Get and set the value for PublishFlashProperties.OverrideSounds
profile.image.overrideSounds;
image.deviceSound
Get and set the value for PublishFlashProperties.DeviceSound
profile.image.deviceSound;
image.streamUse8kSampleRate
Get and set the value for PublishFlashProperties.StreamUse8kSampleRate
profile.image.streamUse8kSampleRate;
image.eventUse8kSampleRate
Get and set the value for PublishFlashProperties.EventUse8kSampleRate
profile.image.eventUse8kSampleRate;
SWF
swf.compressMovie
Get and set the value for PublishFlashProperties.CompressMovie
profile.swf.compressMovie;
Get and set the value for PublishFlashProperties.InvisibleLayer
profile.swf.includeHiddenLayers;
swf.includeMetaData
Get and set the value for PublishFlashProperties.IncludeXMP
profile.swf.includeMetaData;
Advanced Settings
advanced.generateSizeReport
Get and set the value for PublishFlashProperties.Report
profile.advanced.generateSizeReport;
advanced.protectFromImport
Get and set the value for PublishFlashProperties.Protect
profile.advanced.protectFromImport;
advanced.omitTraceActions
Get and set the value for PublishFlashProperties.OmitTraceActions
profile.advanced.omitTraceActions;
advanced.permitDebugging
Get and set the value for PublishFlashProperties.DebuggingPermitted
profile.advanced.permitDebugging;
advanced.debuggingPassword
Get and set the value for PublishFlashProperties.DebuggingPassword
profile.advanced.debuggingPassword;
advanced.useNetwork
Get and set the value for PublishFlashProperties.UseNetwork (Playback security)
profile.advanced.useNetwork;
advanced.hardwareAcceleration
Get and set the value for PublishFlashProperties.HardwareAcceleration
profile.advanced.hardwareAcceleration;
advanced.scriptTimeLimit
Get and set the value for PublishFlashProperties.ScriptStuckDelay
profile.advanced.scriptTimeLimit;
Comments are closed.