On Nov 29th, Adobe announced on their labs site that they are starting a pilot program for serving Yahoo! ads through PDFs.
What does this mean for the small press PDF market?
For authors who self-publish their content through PDFs and distribute through online stores, this could represent a new revenue stream. While I'm not heavily involved with the online publishing scene, I am interested in the way that digital media on the web changes the way we make art and make a living at it.
So I was working on some docs for our cross-project library and ASDoc started giving me issues. It was throwing a Definition could not be found error on a class I know existed. It looked something like:
"path/to/your/imported/Class.as (5): Error: Definition path.to.your.imported:Class could not be found" and ceases operation.
However, I know that my imported class was definitely available. Turns out this is a bug in ASDoc. It looks like ASDoc throws this error if the imported class is never actually used with in the class it was parsing.
Quick Fix: Problem: ASDocs creation on an AIR app.
Error: The definition of base class WindowedApplication was not found.
Quick Solution:
The SWC you're looking for is in here:
[WHEREVER YOUR SDK IS]/framewoks/libs/air
The long winded version:
So, I'm putting together an AIR app and I says to myself:
"Self..."
"What?"
"Well, why don't we output some ASDocs for our spiffy new AIR application."
So I put together a quick ant file and ran it.
<project name="My App - It's Very Snazzy" default="createASdocs"><target name="createASdocs" description="Create AS Docs"><exec executable="/Frameworks/flex_sdk_3/bin/asdoc" failonerror="true"><arg line="-doc-sources ${basedir}/src"></arg><arg line="-library-path '/Frameworks/flex_sdk_3/frameworks/libs/'"></arg><arg line="-library-path '/Frameworks/flex_sdk_3/frameworks/locale/en_US'"></arg></exec></target></project>
And I got this error:
[exec] Error: The definition of base class WindowedApplication was not found.
[exec] public class MyApp extends WindowedApplication
[exec] ^
Now I could regale you with my adventures in finding out where the heck the AIR classes library was stored, but today I'll spare you anymore rambling and just tell you.
[WHEREVER YOUR SDK IS]/framewoks/libs/air
Right where you expect it to be.
Where you should've looked before you went bumbling around the Intarwebs trying to find it.
Quick Fix: If you have an error reading "Unable to resolve a class for ResourceBundle: logging." you need to add the local/en_US/framework_rb.swc library to your ActionScript project.
The longer version:
So my team and I were interested in using the built-in flex logging framework provided for Adobe for a new internal logging app. We started looking into it and after determining that it wouldn't add any unnecessary weight to our flex projects we decided to go with it.
However, we wanted to standardize on a logging framework that would also work for low-weight ActionScript 3 projects. So I figured, "well, they're just classes, I'll add the libraries and start using them." So I went into my project properties and added the framework.swc library and my "Definition mx.logging:Log could not be found" error went away.
Except I got this great new error "Unable to resolve a class for ResourceBundle: logging." . . . huh?
After looking around I found a post on moock.org: How to use Tween in an ActionScript Project (Flex Builder 2). His specific example was for using the Tween class in a normally Flex-less project. However, it seems to be the fix for other cases where you want to use Flex components/classes in an AS2 project.
The problem is that the framework_rb.swc contains the IResourceManager and ResourceManager classes that the Log class references as well as the logging.properties file.
I'm not sure what this means for localization, though, since the framework_rb.swc is inside the locale/en_US directory. My work doesn't ever involve localization so I haven't really looked into any further. Anybody have any thoughts on that?
Also, just as a note, the "100kb of dependant code" Moock references is specific to his use of Tween and its dependance on UIComponent. It does not mean that you get the 100kb just for touching the Flex libraries.
So one of the most annoying things I've ever come across in Flash/ActionScript development is dealing with dynamically loaded images from other domains and accessing their inner BitmapData. In enterprise apps, it's almost never the case that all of your images are coming from the same domain.
Recently, I had a project come up that asked me once again to deal with this issue. The goal was to get JPGs to smoothly zoom slowly something like the Ken Burns effect. The problem was that the images were all hosted in a completely different domain. In my ignorance, I threw my hands up and said, "Nope, sorry it's going to be a crappy effect. You can never get that sort of thing to work without getting at the BitmapData. Which is impossible because it's coming from another site."
At which point Arpit pointed out that in AS3 we now have this absolutely beautiful LoaderContext class. I know I'm late to the game on this one, but I wanted to blog it because I hate when this stuff isn't easily found on the web and the more we blog, the easier it is to find.
The solution couldn't be easier. Here's how you get around it:
Make sure the domain which is serving out the images has a crossdomain.xml file at its root.
If you're unfamiliar with crossdomain policy files or the security sandbox in general, check out this security white paper from Adobe.
Add the SmoothImage component to your project. ...
<foo:SmoothImage id="imageDisplayer">
width="308" height="274"
complete="onImageChangeComplete(event);"
/>
...
Add a LoaderContext with a checkPolicy property set to true. See the docs for more info. ...
<foo:SmoothImage id="imageDisplayer">
width="308" height="274" loaderContext="{new LoaderContext(true)}"
complete="onImageChangeComplete(event);"
/>
...
Sigh your relief that you will never again have to deal with the hell that is cross domain image manipulation.
Check it out, new theme by Toronto's Nick La called iTheme. Pretty groovy, check out his stuff.
I'm also trying to use the Pownce Widget for WordPress by Ronald Heft. I'm pretty sure I'm using it incorrectly, but if I can get it to work, it'll be pretty dope.
No, really, I'll totally tell you about what's going on at 360|Flex. I'm still getting used to the idea that I even have a blog and making time to take all my crazy mess of notes and turn them into a coherent mess of notes for you to read.
One guy who's blogging this conference really well is Dave Coletta, from Virtual Ubiquity. Check his blog out at http://www.colettas.org/. He seems (as I look over his should during this sesison on the Saffron Modeler by Samuel Agesilas) to be live blogging directly in plain text instead of taking notes and then translating them to coherent prose. I'm not sure I actually have the ability to pay attention and comment on the presentation at the same time so I have to go with the notes method.
Also, I'm checking out Qumana for editing this blog offline on my laptop. I was getting really frustrated with not being able to work on my blog in any organized manner at times when I did not have a wireless connection. I'll let you know if I find anything really annoying about it, otherwise, assume it works great.
After our adventure at Coffee of Doom (Seattle Coffee Works, although I think CoD is a better name) Jeremy went off to hang out with brother-in-law and I decided to do a bit of exploring. I ended up heading over to a neighborhood known as Fremont. It may be the Pacific Northwest's home of random crap.