Re: [Flashcoders] jsfl - set all bitmaps in library to photo compression

2006-08-30 Thread James Deakin

This will come in very handy. Just one thing though. I have no Idea
where to put this file. And how to exicute it. Could you please point
me in the right direction.

Kind regards

James Deakin

On 8/25/06, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:


I had a project recently that was originally developed as a CDROM by a
3rd party, but then had to be migrated to the web. Many of the lib items
(1000's of items) had been set with specific compression values or
Lossless. This ended up with a 60MB swf file. Ick.

So I brewed up this little JSFL that sets all bitmaps in the library to
document level photo/jpeg compression.

Hope this helps anyone who has or will have a similar headache.

//--
var lib = fl.getDocumentDOM().library;
for(n=0;nlib.items.length;n++){
var item=lib.items[n];
if(item.itemType==bitmap){
lib.selectItem(item.name);
lib.setItemProperty('compressionType', 'photo');
fl.outputPanel.trace(SET COMPRESSION TO PHOTO
ON:+item.name);
}
}
//--

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] jsfl - set all bitmaps in library to photo compression

2006-08-30 Thread Chris Hill
You put it in the Commands folder in your user configuration folder. For 
example:
C:\Documents and Settings\MyUserName\Local Settings\Application 
Data\Macromedia\Flash 8\en\Configuration\Commands


You might need to show hidden files.


Here's my image settings command, while we're sharing:

Image Settings.jsfl
---
// :mode=javascript:

settings=flash.getDocumentDOM().xmlPanel(fl.configURI+ 
'Commands/imageSettingsGUI.xml');

if(settings.dismiss == accept)
{
   imageQuality = settings.imageQuality;
   imageSmoothing = Boolean(settings.imageSmoothing);
   imageCompression = settings.compressionType;
   useImportedJpegQuality = Boolean(settings.useImportedJpegQuality);
  
   var library = fl.getDocumentDOM().library;

   var selItems = library.getSelectedItems();
   fl.trace(Selected items length:+selItems.length);
   for(var i=0;iselItems.length;i++){
   var item = selItems[i];
   if(item.itemType == bitmap){
   if(useImportedJpegQuality == true){
   item.useImportedJpegQuality = true;
   }else{
   item.useImportedJpegQuality = false;
   item.compressionType = imageCompression;
   if(imageCompression == photo){
   item.quality = Number(imageQuality);
   }
   }
   item.allowSmoothing = imageSmoothing;
   }
   }
}

---
imageSettingsGUI.xml
---
dialog title=Set Image Options buttons=accept,cancel
   label value=Compression Type:/
   menulist id=compressionType
   menuitem label=PNG/Lossless value=lossless/
   menuitem label=JPEG value=photo/
   /menulist
   label value=Image Quality (leave blank for default)/
   textbox id=imageQuality value=50/
   checkbox label=ImageSmoothing? id=imageSmoothing checked=true/
   checkbox label=Use imported JPEG Quality(only if a jpeg) 
id=useImportedJpegQuality/

/dialog
---

James Deakin wrote:


This will come in very handy. Just one thing though. I have no Idea
where to put this file. And how to exicute it. Could you please point
me in the right direction.

Kind regards

James Deakin

On 8/25/06, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:



I had a project recently that was originally developed as a CDROM by a
3rd party, but then had to be migrated to the web. Many of the lib items
(1000's of items) had been set with specific compression values or
Lossless. This ended up with a 60MB swf file. Ick.

So I brewed up this little JSFL that sets all bitmaps in the library to
document level photo/jpeg compression.

Hope this helps anyone who has or will have a similar headache.

//--
var lib = fl.getDocumentDOM().library;
for(n=0;nlib.items.length;n++){
var item=lib.items[n];
if(item.itemType==bitmap){
lib.selectItem(item.name);
lib.setItemProperty('compressionType', 'photo');
fl.outputPanel.trace(SET COMPRESSION TO PHOTO
ON:+item.name);
}
}
//--

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] jsfl - set all bitmaps in library to photo compression

2006-08-25 Thread Tor.Kristensen

I had a project recently that was originally developed as a CDROM by a
3rd party, but then had to be migrated to the web. Many of the lib items
(1000's of items) had been set with specific compression values or
Lossless. This ended up with a 60MB swf file. Ick.

So I brewed up this little JSFL that sets all bitmaps in the library to
document level photo/jpeg compression. 

Hope this helps anyone who has or will have a similar headache.

//--
var lib = fl.getDocumentDOM().library;
for(n=0;nlib.items.length;n++){
var item=lib.items[n];
if(item.itemType==bitmap){
lib.selectItem(item.name);
lib.setItemProperty('compressionType', 'photo');
fl.outputPanel.trace(SET COMPRESSION TO PHOTO
ON:+item.name);
}
}
//--

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com