04.30.07
Posted in mental microphony at 11:24 pm by daz
I’ve finally given up thinking that I can’t solder. Last I week soldered 368 joints in order to attach buttons and flying leads to 92 identical circuit boards, I’ve also successfully soldered several microphone capsules to flying leads and hence my new hobby is born - diy microphony. I have a stack of 100 electret capsules so will be exploring ways of using them. Early test have been good - 2 capsules plus 3pin minijack = stereo mic to plug straight into minidisc recorder. Sounds pretty good, cost next to nothing - hoorah ! Other plans include a battery pack for line level output, a stone microphone, and a variety of surround mics. I’ll be posting a few pics, and maybe some recordings … sooooon
Permalink
04.10.07
Posted in random bits of .AS at 6:44 pm by daz
a dead simple, but really useful textfield prototype - useful for displaying data in a ‘trace’ type fashion :
textfield.prototype.trace=function($input){
var $tf=this.getNewTextFormat();
this.text=$input;
this.setTextFormat($tf);
};
So what? can’t I just use (textfield.text = $input) and be done with it?
Well, yes, you could, but then the textfield’s format resets to the default, which seems to be a rather ugly and generic times of some sort or other … this way, call textfield.trace(”blah blah blah”) and the formatting is retained
Permalink
04.02.07
Posted in demo, download, porcine parsing at 1:50 am by daz
There’s no guarantee of anything, and there’s lots of weird stuff needing trimming, plenty of work still to be done, but plenty that does work. Fiddle, play, scratch heads, etc.
Licence :
Use as you like, let me know if you do, and how you’re getting on.
Permalink
Posted in demo, porcine parsing at 1:25 am by daz
a simple text-box, buttons, scrollers, and some drawing here
a growing ‘reference doc’ here
Permalink
Posted in download, porcine parsing at 1:19 am by daz
Use this link to download a simple swine sample zip.
Permalink
Posted in docs, porcine parsing at 1:15 am by daz
So, for the moment, this post lists parsers and plugins.
Look in the plugin source in the download for hints on how to write new functions and parsers for SWINE.
In the mean time …
PLUGINS
there are no public plugins at this stage
PARSERS
<xml>
<plugins/>
<plugin/>
<classes/>
<library/>
<mc/>
<g/>
<pen/>
<ink/>
<paint/>
<line>
<polyline/>
<fill/>
<box/>
<circle/>
<img/>
<mask/>
<textfield/>
<button/>
<onover/>
<onout/>
<onpress/>
<onrelease/>
<hscroll/>
<vscroll/>
<do/>
</xml>
Permalink
04.01.07
Posted in SWINE, porcine parsing at 10:48 pm by daz
SWINE … SWF - COMMAND LINE and XML parsing engine.
What ?
An XML document format for getting content into SWF files at runtime.
Isn’t that SVG ?
No, this is SWINE, and its designed to be viewed from SWF. It is similar to SVG, but then its similar to HTML too. Its basically a method of exposing all things actionscript to XML.
Isn’t that SWFML ?
No, this is SWINE, and it works at runtime, rather than creating a compiled SWF file, SWINE is used to render XML using actionscript.
Okay cool, so its a document format for displaying content in SWF files and a SWF file that renders XML ?
That’s the basics, if you like … but, since XML is eXtensible it kinda makes sense to have a parser that is smart enough to be eXtensible too. Currently there are around 30 elements in the core format, but with the ability to load plugins comes the ability to assign parsers for new elements on the fly, allowing practically any well-formed XML to be used to place custom objects into the document on screen.
daz.roughdiamondproductions.com/swine
Permalink
Posted in random bits of .AS at 1:55 pm by daz
Although its relatively simple to add a sound (wav / mp3) into a swf (via flash api) its a lot more useful if you don’t have to compile the sound directly into the swf. This can be achieved by publishing an mp3, and then loading it into the swf at runtime using the sound object but …
the mp3 should have the correct sample-rate - other wise, it may playback at the wrong speed, and pitch.
As far as I can tell, this means using a sub-division of 44.1khz sampling rate - 22.05khz or 11.025khz for example - 32khz and 48khz sampling rates don’t work as I’d expected in swf - yes, your file sounds great in winamp / mediaplayer / etc, but I don’t reckon flashplayer re-samples to match the system - if your sounds are all screwed up, then this could be the cause.
Permalink
Posted in random bits of .AS at 1:28 pm by daz
prototyping within actionscript is when things get really interesting. Its meant to be used to create a new class of object, as in this futile example :
myob=function(){return this;}
myob.prototype.foo=function($value) {trace ($value);};
bar=new myob();
bar.foo(’my message’)
traces -> ‘my message’ to the output
but it can be put to much more fun use, for example, by modifying the movieclip.prototype object, instances of movieclip inherit the new behaviour …
movieclip.prototype.dosomething=function(){
// do someting interesting here
}
mymovie=createemptymovieclip(”mymovie”, 1);
mymovie.dosomething();
anyothermovie.dosomething();
and it seems to be faster at runtime than defining each function within each new movieclip as you go. the problem is that as each and every movieclip inherits the new method [dosomething()] if you perform a listing on the movieclip, you can end-up with tons of methods - which can get a bit tricky.
Anyway, the point is, by modifying the prototype behaviour of a movieclip, it becomes relatively easy to make nested behaviours - as in parsing an XML document with an unknown nested structure into a series of nested movieclip objects. This is the core concept of the SWINE parser.
more prototype functions [added to soon] can be found at -> daz.roughdiamondproductions.com/prototype
Permalink