Fireworks Javascript API, Current Layer

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

I've recently discovered the joy of creating extensions for Fireworks with Flash & Javascript(i've died & gone to heaven), Since I'm using FireworksMX & not 2004 the API extension wrapper V2 Flash shortcuts seem to be useless (fwapi.getCurrentLayer()) <- That would be great, but it isn't working.

I've been able to get things working (adding lines, rectangles, ect..) but I can't for the life of me find or figure out how to determine the index number of the current layer, I've tried using the extension wrapper shortcuts (figured it wont hurt to try), I've tried passing -1 as the index, i've tried passing the name of the layer....

I need the layer index for the dom.selectAllOnLayer(layerIndex) function so I can use dom.flattenSelection() rather than dom.flattenDocument()

I've sifted through ALOT of google/macromedia pages on this one, I can find countless prepackaged extensions, but help on creating them has been slim in my searches :(

I've read the entire extending_fw.pdf manual from Macromedia (about to start from the begining again) I can't find what i'm looking for there either.


Does anyone know,
A : How to determine current layer
B : Resources on this subject in genneral.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

I found the answer to my first question :)
Code: [ Select ]
fw.getDocumentDOM().currentLayerNum;

As for resources, I guess using tools one at a time & exporting to .jsf is how i'm going to figure things out from now on :P
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

Guess I should also mention that there is a component called "Fireworks API Wrapper" that you must add to the stage to get the FWAPI stuff to work :oops:

Makes things MUCH easier :lol: (does make your extension a little heavy though...)

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 4 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.