I’ve been making a large set of new UI components and trying to get some nice skins going for them. Although I am a PC guy, I’ve always admired the style of the Mac interface.
There are about a million tutorials out there on how to make Mac style aqua buttons in Photoshop and Fireworks, and it’s relatively easy to do, but I didn’t want to be importing bitmaps. So I took one of the Fireworks tutorials and duplicated the actions as much as I could in Flash. The result was surprisingly nice. I also realized that everything I was doing could be done in JSFL. So I sat down and made a JSFL command to do just that.
Read more...I wrote this a couple of weeks back and just never got around to posting it. This post represents the fruit of many hours banging my head on the desk trying to figure out what was going wrong. Hopefully it will save you some brain cells.
First of all, let’s cover some basic definitions.
Export. This is the action of marking a symbol in the library as “Export for AS.” The main reason you would want to do this is if you plan to attach the symbol to the stage at run time using attachMovie. This would also cover using methods like createObject and createClassObject, as these are wrappers for attachMovie.
Read more...After I don’t know how long, Yugo Nakamura has updated www.yugop.com.
Yugo was one of my original Flash idols, and is one of the most innovative Flash experimenters ever.
The new site features some sweet new material and a nice navigation / interface.
Read more...For some reason, today seems to be the day for posting photos from Flash Forward NYC. I got these two links in my inbox today:
From Danny Franzreb:
https://www.taobot.com/flashforward_nyc_04/FlashforwardNYC2004/index.html
and from Craig Swann:
https://www.crashmedia.com/gallery/index.php?dir=ffnyc2004
So I decided it was time to upload my own:
https://www.bit-101.com/nyc2004/
Read more...My co-worker, Sam Robbins, has succumbed to blog fever. After a nasty battle with CSS, his blog has emerged victoriously!
https://blog.pixelconsumption.com/
Read more...I’ve probably posted some of these before, but over the months, these three have proven worth their weight in gold, especially in developing components.
Select any components in your library (components you are developing) and run this command. They will be exported into your components directory. Also, if they are in a folder in the library, and a folder of the same name exists in your components directory, that’s where they’ll go. This could even be fixed up with the new file i/o api to create the directory if it doesn’t exist.
Read more...Like a lot of people, I use the trace function as my main debugger. It’s great for tracing out numbers or strings, or even arrays of numbers or strings. But when you get into objects, you wind up with something like [object Object], which isn’t too enlightening.
OK, so then we get in to for-in loops, and doing something like this:
for(var prop in myObj){
trace(prop + ": " + myObj[prop]);
}
Again, very useful, but I get sick of typing all that every time. And say one of the properties of myObj is itself and object? You wind up with for-in loops within for-in loops, tedious to type, and you wind up deleting it anyway once you’ve found your bug, or determined it’s not in that object.
Read more...OK, this is probably my fourth or fifth post on this, each with a different recommendation for handling! I just read this post by Sam at rewindlife, showing how you could use the Delegate class (of which I am already a convert) to handle the callbacks of plain Flash buttons. I thought, hmm….if it can handle button callbacks, why not xml callbacks? Did a quick test:
import mx.utils.Delegate;
class Test {
private var member:String = "I am a member of Test";
private var x:XML;
public function Test(){
init();
}
private function init(){
x = new XML();
x.ignoreWhite = true;
x.onLoad = Delegate.create(this, parse);
x.load("test.xml");
}
private function parse(success){
trace("success: " + success);
if(success){
trace("xml: " + x.firstChild);
trace("Test member: " + member);
}
}
}
So what’s going on here? We create a new Delegate and assign it as the onLoad handler of the xml object. You’ll see in the function, parse, which we passed to the delegate, it receives the success parameter, which is what onLoad receives. But you also can see the scope of the function remains the class, not the xml object.
Read more...I love digging through the class files in Flash MX 2004.
You find neat little tidbits like getTextExtent2, where it is admitted that TextFormat.getTextExtent is broken in Flash.
The solution? They create an invisible text field on _root, at a depth of -2. Assign it the text and the format in question, autosize it, measure its resulting textWidth and textHeight and return that.
Thats all in classes/mx/core/ext/UIObjectExtensions.as
Read more...This will be old news for a lot of you, but pretty interesting to many more.
If you have been using v2 components, there’s a good chance you are using createObject or createClassObject. I think a lot of people assume that these were commands added to the base ActionScript 2.0 language. Not so. They are simply functions written in external ActionScript class files. They are functions added to MovieClip’s prototype. So you can always call one of those functions from any timeline or MovieClip based component, and they will be available.
Read more...