Categories
Extending Flash Flash

About extending Flash

I recently started to get interested in JavaScript Flash (JSFL) and I’m really impressed with its ‘power’.
As the title says: it extents the Adobe Flash authoring environment: you can add commands, new tools / panels, behaviour, actions, templates, and much more. You can make Flash do stuff it can’t do out of the box.

Extension are not only used in Flash but can also be used in other Adobe applications, but I can only focus on Flash.

The Flash JavaScript application programming interface (JavaScript API) is a complementary programming tool that lets you create scripts that run in the authoring environment.

source

There some things you need to know, and this post will explain some of them, and will be used by me in other post about extending Flash (so I have to explain it once):

Commands

Commands can be found in the Flash under Commands (seems obvious..)

I will post the commands here without a installer so you can learn from it.
But this file can also be used and copied in the correct folder it will work.
Commands can be placed in the correct folder, and can be used without restarting.

So right mouse button (save file… ) and save/copy the file to the command folder.
Flash 8

C:\Documents and Settings\[username]\Local Settings\Application Data\Macromedia\Flash 8\[language]\Configuration\Commands

Flash CS3:

C:\Documents and Settings\[username]\Local Settings\Application Data\Adobe\Flash CS3\[language]\Configuration\Commands
Remember to look in the “Local Settings” folder for the “Application Data” folder!
Flash 8 was made by “Macromedia” but this company was bought by Adobe so Flash CS3 can be found in the “Adobe” folder

Flash panels

Flash panels are mostly .SWF with scripts that only work in the Flash authoring environment.
I will post the .FLA and everything else needed to get the SWF working also on this blog. But I can’t promise that it will be educational, but I will try to clean up the files where I can.
The Flash Panels can be found under “Window” >> “Other Panels“.

A Flash panel can be installed manually, but you will need a restart before you can use it. But once you installed it and restarted Flash you can modify the SWF as much as you want.

Flash 8

C:\Documents and Settings\[username]\Local Settings\Application Data\Macromedia\Flash 8\[language]\Configuration\WindowSWF

Flash CS3:

C:\Documents and Settings\[username]\Local Settings\Application Data\Adobe\Flash CS3\[language]\Configuration\WindowSWF
Remember to look in the “Local Settings” folder for the “Application Data” folder!
Flash 8 was made by “Macromedia” but this company was bought by Adobe so Flash CS3 can be found in the “Adobe” folder
You need to restart Flash to have access to Flash Panel

Adobe Extension Manager

To install any of the extensions (.MXP – files) I’ve created you will need a Adobe Extension Manager, it’s free and you can install older versions in case you’re working with Flash MX of Flash 8.
And at least Macromedia Flash MX 2004 but I’m working with Adobe Flash CS3 and I test my scripts in Flash 8.

Once you have the Extension Manager installed you only have to download the MXP files and double click it or use the install on the Extension Manager.

Creative Commons License

And, as most of my work here, it’s licensed under Creative Commons License:

Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

Categories
Flash Flash experiments

Flash experiments: amazing tube

I was experimenting with Google SketchUp 6 and Pepakura designer v2 .1.2.
And I saw in the Pepakura a pattern when creating tubes.

Update: it not only creates tubes (example: 15 sides) but also cubes (4 sides) and prism (3 sides)

And off course I couldn’t resist building it in Flash:

And in this case it’s a flash application that creates flat, printable versions of cubes tube. Just print it, cut it out, glue it together and there you have it: the amazing cube tube:

[swf]http://www.matthijskamstra.nl/laboratory/swf_experiments/amazingTube_v01.swf,450,450[/swf]

I have made something similar: the amazing cube.
I’m working towards something????

Categories
Extending Flash Flash

XML Reader Flash panel

When you’re working with Flash and dynamic content your no stranger to XML.
And how to access the data in the XML.

There are a couple of ways you can access and manipulating XML documents in Flash:

  1. the nerdy way (XML DOM): my_xml.firstChild.childNodes[2].childNodes[1].attributes.x
  2. the xPath way using xfactorstudio XPath classes: xmlDoc.selectNodes("/bookstore/book[price>35]/title")
  3. the Flash XPathAPI class: XPathAPI.selectNodeList(xml.firstChild, "/rdf:RDF/item/title")
  4. the XML2Array methode: Novel[0].Description[0].value

Before I discovered option 2 /3 /4, I had to work with XML DOM. This was also in the periode I was still programming in the Flash IDE and the XML DOM methode cost me a lot of time: I couldn’t find the correct node, or attribute, etc.

Until I started programming in SE|PY, because it has a XML Reader. The XML Reader could check if my XML was correctly formatted, and I could just point to the node I wanted to use and it gave me the correct node path.
I don’t know when it started (probably for a while, because I started to use different methodes to access XML) but sadly this reader has some errors, which makes it difficult to use.

But why do I care? I needed to use the XML DOM because I didn’t want to add to the kb of a dynamic banner I was building. It was programmed it in Flash IDE and the SE|PY XML Reader didn’t work….

Download:

Without more blabla: here is the first version of XML Reader.

XML Reader Flash panel XML_Reader_v0.1.zip (52kB)

In the zip is also a readme.txt with more info about XML Reader.
Doubts? Test drive it here!
Let me know what you think of it, what’s wrong with it, what could improve, bugs, etc

Description XML Reader

XML Reader is a Flash window panel where you can load XML files into.
This is useful in situations when you are writing an XML parser, and need to view the XML your parsing, but don’t feel like toggling back and forth between Flash and another program.
As a Flash panel, you can simply dock it inside of Flash with your other panels, and have it always available while you code in the Flash IDE.

This XML Reader does more: it has color syntax highlighting, indentation and XML DOM(*) to access and manipulate XML Documents WYSIWYG style.

I hope this will help to increase my productivity, and perhaps yours?

(*) The XML Document Object Model (XML DOM) defines a standard way for accessing and manipulating XML documents.

View XML Reader

So I created XML Reader, based upon the one in SE|PY

Because the open XML button only works in Flash a example XML is loaded.

Thanx to:

This project is based upon some work of other developers:

  • The XMLHighlighter class developed by R.Arul Kumaran (at the moment of writing this post I couldn’t visit his site).
    This class is used for highlighting the XML file and my modification makes it possible to ‘trace’ the XML-nodes.
  • The XML and Text Viewer Panel developed by Jesse Randall Warden. This example showed me how to build a panel.
  • The MXI File Creator by Muzakdeezign. This free program is used to create and edit the Macromedia Extension (.mxi file).
  • The XML reader from SE|PY by Alessandro Crugnola.
    This is my free code editor when I’m not using the Flash IDE editor. And the only (as far as I know) wysiwyg XML Reader. Sadly this reader has some errors, which makes it difficult to use. So to fix this, I wrote this panel.
Categories
Flash Flash experiments

Flash experiments: omtrek cirkel

I have to do this in Dutch because I have no idea what’s it called in English, sorry.
It not really important, and will be used in a project which has little to do with this explanation.

Een klein testje om de omtrek en de oppervlakte van een cirkel te berekenen.
Het moest van ver komen dus heb ik het ff opgezocht:
wiswijzer.nl
wisfaq.nl

Omtrek = pi * diameter = 2 * pi * straal
Oppervlakte = 1/4 * pi * diameter2 = pi * straal2

[swf]http://www.matthijskamstra.nl/laboratory/swf_experiments/omtrek.swf, 450, 250[/swf]
Update #1: For my English readers:
(more about circles here)
“omtrek” = circumference
“oppervlakte” = area (read more: circle area)
“diameter” = diameter (diameter)
“straal” = radius
(look more math stuff up at at Math Open Reference)
Categories
Flash Flash experiments

Flash experiments: tiled background

Update #1: Recently there are some who like to have the source of this project, that’s not a problem. But the source is what it is, and there are no comment in the code….
And because this post was not up-to-date, I’ve remove some of the links to sites with patterns because they didn’t exist anymore. That’s also the reason that I had to update the Flash file.
shortcut to download

Another experiment, to use external images for background patterns.

But there was no need to start from zero, so here are some tutorials that I used:

both tutorials were used in the experiment.

[swf]http://www.matthijskamstra.nl/laboratory/swf_experiments/tiledBackground_v02.swf, 450, 450[/swf]

(I had to update this file because of broken links: this is version 2)

Get the source files here:

The .ZIP file contains:

+ tiledBackground     
     + deploy
            - AC_RunActiveContent.js
            - tiledBackground_v02.html
            - tiledBackground_v02.swf
     + source
            - tiledBackground_v02.fla

Borrowed some seamless background pattern from Squidfingers
pattern_021.gif
pattern_095.gif
pattern_111.gif
pattern_131.gif
pattern_141.gif

It’s not possible to link directly to Squidfingers!

But you can find your own patterns on the internet, examples of site with seamless background patterns:
http://www.wonderbackgrounds.com/
http://www.cameradio.tk/tiles1.htm

root2art.co.uk
http://backgroundsarchive.com/tiles/wood.php?page=2

I used http://www.neopets.com/backgrounds_tiled.phtml in the flash source.
But you can use any image from the internet!
(Need some help: find “tiled background” with google )

Categories
Flash Flash experiments

Flash experiments: select

Update: Before I could publish this post, before I finished this experiment, I found a better class to do what I want. TransformManager Released – Scale/Rotate/Move any MovieClip from Jack Doyle (Greensock). This class is what I had in mind when I started…. and much, much more… I’m using this class in the future.

Another experiment: I needed a possibility to select and manipulate a graphic in Flash.
So I looked at illustrator and Flash how they did it, and made a variation of my own.

So for now, I can select the top graphic, move and rotate it (not yet resize…)

Check it here:

[swf]http://www.matthijskamstra.nl/laboratory/swf_experiments/select_v01.swf, 450, 450[/swf]

Or check it the select experiment full screen..

Categories
Flash Flash experiments

Flash experiments: tools

I decided to “share” my unstructured flash experiments:

And in this case it’s a flash application that creates flat, printable versions of cubes. Just print it, cut it out, glue it together and there you have it: the amazing cube:

Or just check tools menu full screen..

Based upon xml: toolsmenu.xml

Categories
Flash FlashBox WordPress Plugin

FlashBox 1.4 hits 200

Update: I’ve updated my wp-downloadBtn wordpress plugin so you can see the total download:

Yeah, Yeah, I know: nerd!
But I can’t help it feeling somewhat proud: 200+ people found my WordPress plugin FlashBox interesting enough to download.

So let’s say that not everybody who’s downloaded the zip is also installing it. Let’s say 1 out of 10 … 20 users?

Well that good enough for me: I working on FlashBox 1.5 with some new feature requested by FlashBox users and some wishes I had:

  • Redesign
  • Optional: Choose if you want a add a icon to your link when FlashBox is activate
  • Images “cached” into FlashBox
  • Optional: Use FlashBox without rel="flashbox"
  • Optional: “Powered by FlashBox” in the footer
  • …. (still working on all of this and more…)
Categories
Flash FlashBox WordPress Plugin

FlashBox v1.4 – IE6 blocks content

A new version of FlashBox. The main reason for this update is an IE6-bug (read the whole story here)
But by trying to fix this bug, I also created room for the send-a-friend option.

FlashBox is a on going project so for updated versions of it goto the Flashbox directory.

A two image gallery: an tribute to Gungrave. [1] – [2]

Find more examples on the FlashBox homepage.

Download WordPress Plugin – Download FlashBox v1.4

If you have previous versions of FlashBox installed, it’s a good idea to delete the old “wp-flashbox” directory.
Categories
Flash Flash experiments

Flash experiments: Debug Button

Update #1: it seems that to much data makes this button not function, so I toned it down a little

For FlashBox I was looking for a way to get more/better feedback from the users when they report a bug.

It started with:


function submitBug (target_mc:MovieClip) {
	for(var i in target_mc) {
		trace ( 'key: ' + i + ', value: ' + target_mc[i]);
	}
}

But I’ve extended it, with other usefull information (stage-width/height, url, framenumber, etc);
And in combination with FlashBox (or in combination with the Browser detect – by Peter-Paul Koch [quirksmode]) you also can get the Operating system (I can get that too with Flash), Browser name (not possible with Flash) and version-number of the browser (also not possible with Flash)

With this information it should be easier to debug….

To export the data to me I used the lowest tech solution I could think of:

getURL ("mailto:reportbut@zapper.com?subject=BugReport&body=bug:");

Just give it a try:

[swf]http://www.matthijskamstra.nl/blog/wp-content/uploads/debugBtn.swf, 220 ,70[/swf]