A question about Joshua Davis and his techniques came up in my online Class. I thought I post to the answer here as others might be interested in how to print the stage in an SWF.
Joshua Davis is pretty inspiring. I like the idea of creating art with Flash via an automated system. He uses a script that creates art automatically by crating movieclips on the stage dynamically. THen he prints these our.
This is not so hard to and doesn't require any special software other than flash. You can also import the work into Illustrator and work with it there.
Note that randomly generated art may or may not be art. The color choices and other elements may need to be adjusted and added or removed to make a really artful design. That said the process can add interesting elements to your work.
Try it for yourself. Follow these steps.
1) create a Flash movie with some art on the stage. You could just place elements on the stage for now. As you learn AS you can write a script that generates things on the stage.
2) Launch the SWF.
3) Right Click the stage and choose Print...
In the print dialog box print to PDF. This option may show up in different places on different systems.
But the secret is that the PDF can be imported into Illustrated. Printing to the PDF format creates a record of the current content on the stage as vectors in the PDF document.
Note that Illustrator will change a few things or not interpret them correctly. Stroke weight for example, is scaled in Flash but not scaled in Illustrator.
It seems like the AC_RunActiveContent.js will no longer be necessary. Looks like MS will be taking the "Click to Activate" requirement out of IE. read more Here.
I noticed that navigateToURL (this replaces getURL in AS2) doesn't seem to work locally, if you want to open a link in the same window (_self). I found this note on the Adobe site. It seems that you need to set "allowScriptAccess" to "always" in the HTML parameters. This needs to be set in both the param tags as below: <param name="allowScriptAccess" value="always" /> and in the embed tag: <embed allowScriptAccess="always" />
Here's an AS3 class that creates a simple scroll bar. Set this as the Base Class for any movie clip. The container clip must have two movie clips named drag_mc and track_mc. These clips act as the dragger and track for the scroll bar
Add an event listener to call a handler when the scroll bar is dragged. SimpleScrollBar dispatches the ScrollBarEvent.UPDATE which includes the property scroll_value. This property holds a value from 0 to 1 representing the position of the dragger.
Here's some example code. Assume that scroll_mc is a movie clip that contains two clips drag_mc and track_mc. This clip has SimpleScrollBar set as it's base class.
scroll_mc.addEventListener( ScrollBarEvent.UPDATE, on_update );
function on_update( e:ScrollBarEvent ):void {
var n:Number = e.scroll_value; // Get the value of scroll bar
scroll_txt.scrollV = Math.round( ( scroll_txt.maxScrollV - 1 ) * n ) + 1;
}
Download the sample: simplescrollbar-class
Here's a few ideas from a thread on Actionscript.org about communicating between two classes:
(root as MyDocClass).my_doc_method();
MyDocClass(root).my_doc_method();
http://www.actionscript.org/forums/showthread.php3?t=152676
Here's some more info on this subject: http://www.actionscript.org/forums/showthread.php3?t=163265