Make Flash Panels? Sick of MMExecuting your coding life away? Check these wrapper scripts. I originally thought that the API that came with the FWCommandComponents would be my salvation… but it took more than a day and a lot of favor asking, which I hate doing btw, to get them. Thankfully, a fellow developer came through… after I had written my wrapper out of frustration…well, really lack of patience to be more accurate. See, the Extending Fireworks PDF claims that there is this aforementioned MXP on the Studio MX CD or on the website. I thought it meant the Studio MX 2004 CD, hence no one finding it, except for one developer who thought to check the MX one. It’s not on MM’s website.
At any rate, it turns out after installing, the homes who wrote it practically wrote a Flash wrapper function for EVERY Fireworks JSF command possible… pretty insane. My route was totally different. I just used resolve with a little string mods, and some AsBroadcaster since EventBroadcaster became tedious as hell that forwards the window panel events that Fireworks generates to whatever listener cares.
Bottom line, instead of this:
MMExecute(“fw.exportSWF();”);
You can do this right in Flash:
fwapi.exportSWF();
Feels good, don’t it?
Well, I’ve liked more of what Fireworks offers in terms of events, but still, I do do (gross) some occasional Flash Panel work too, and there has been an influx of more JSAPI/JSFL and Flash Panel developers releasing tools, so figured it was a great time to port it over to Flash too. I’ve included a sample with the Flash one, while the Fireworks one is in my previous post, the PNG to SWF Batcher. Both FLA’s in the source file utilize the AS class wrapper and use it, hopefully enough to give you an idea of how it works.
Weaknesses are, when returning complex values, like doc from getDocumentDOM for instance, your still better off doing multiple lines of code in a big string, and executing that, or just running an external script. Also, I don’t convert Boolean’s that are returned, so they’re still “true” and “false” as strings. Still, numbers and strings work great.
Now, before I get my ass kicked for not using AS2, here me out: which would you rather use? This:
import FWAPI
#include “JXLFWAPI.as”
And it HAS to be in that order, or:
#include “JXLFWAPI.as”
And just one file?
Thought so. If you said the first, your a goob, and just want to see me get all ticked off… well GIVE UP GOOBER!
__resolve is neato.
Fireworks Flash Panel Wrapper – <a href=”https://www.jessewarden.com/downloads/JXLFWAPI.as”>JXLFWAPI.as</a> | <a href=”https://www.jessewarden.com/downloads/pngtoswf_source.zip”>Source</a>
Flash Flash Panel (whoa) Wrapper – <a href=”https://www.jessewarden.com/downloads/JXLFLAPI.as”>JXLFLAPI.as</a> | <a href=”https://www.jessewarden.com/downloads/flashpanelwrapper.zip”>Source</a>