Skip navigation
jelaplan
Currently Being Moderated

Sharing Pages options in the Fireworks Command API

Apr 9, 2013 1:20 PM

Tags: #sharing #pages #page

I would like to write some commands related to sharing pages. I wrote a simple command that lets me share a layer to the next page. This is nice but I'm stymied taking it further. For example, one thing that I can't figure out is

  1. Checking whether a layer is already shared to Pages. If I run my share command twice on the same layer/Page, then the second Page now has two layers of the same name that are both shared. That is really a deffect. If I hide one then the other hides too. If I could detect sharing then In some cases I would simply not share the layer. In other situations, I would unshare a layer if it is shared.

 

I noticed in the history that there are two undocumeted API calls - excludeSharedLayer & detachSharedLayer. For example

fw.getDocumentDOM().detachSharedLayer(2, 11);.  The arguments for this method are not apparent. The first is the layer number that is being detached but the second is not apparent. It doesn't make much sense to run these on a layer that isn't shared and in fact this brings an error so it is problematic.

 

In the short term, I'd like to know if there are any properties or methods to detect if a layer is Page shared and ideally to what other pages it is shared. Longer term,  I hope that Adobe could update the FWAPI document to be more thorough because the presence of undocumented API methods and properties is frustrating.

 
Replies
  • Currently Being Moderated
    Apr 11, 2013 1:22 PM   in reply to jelaplan

    The .detachSharedLayer() function is documented here: http://help.adobe.com/en_US/fireworks/cs/extend/WS5b3ccc516d4fbf351e63 e3d1183c94856c-7808.html

     

    But I don't know about excludeSharedLayer.  There seem to be a lot of page methods that aren't documented.  The pages API is pretty crap, unfortunately, so there may not be a way to tell whether a layer is shared across pages.  You may just need to wrap the call in a try/catch and ignore the exception when you try to detach a non-shared layer.  I don't seem to get an exception when I try to do that, though.

     

    I've collected some bugs and undocumented functions here: https://github.com/fwextensions/fwjs-errata  I'll have to add excludeSharedLayer, and the other page methods.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points