Flashpress 0.8 Released

Changes

1 / Changes to WpPostVo Object

  • a / If the post has a featured image, the URL to it is included, otherwise its an empty string
  • b / The posts tags are listed (if it has any) as an array of TermVo Objects
  • c / The posts categories are listed (if it has any) as an array of TermVo Objects
  • d / The posts attachments are listed as an array of their URLS

2 / Changed inheritance of WpPostVo and WpSearchVo. Inheritance chain is as follows: WpPostbase->WpPostVo->WpSearchVo. Reason for this change is that the WpSearchVo only differs from the WpPostVo in its use of the ‘score’ attribute. Also, it makes sense that the WpSearchVo object returns as much information as a standard WpPostVo object.

3 / Fixed an variable type issue with searching that meant that only integer based score results were returned. This has been changed to a Number.

4 / Rejigging of internal helper methods

5 / Removal of two redundant VoObjects, which had been replaced by WpTermVo.

6 / Package name of the actionscript demo has changed from ‘noponies’ to ‘com.reformation’. This is due to the slow move of this blog to a new location.

Let me know how performance is with this release. The internal post retrieval method is now doing more work, but should save you having to make extra database requests. I’ve tested it with a request for 100 posts and its quick. But let me know. Let me know if you encounter any bugs etc.

I’ve not had time to finish the more full featured demo, but its coming.

Download here: Flash Press 0.8 (764)

Flashpress 0.8 Features

I’m currently rebuilding my noponies illustration site with Flashpress and of course a WordPress backend.

I’ve added in some new features to Flashpress as I’ve worked through the site, these are related to the data returned by each PostVO object, I’ve tried to make it a little simpler to get what you need from this object, without needed to go back to WordPress for simple stuff, like a posts tags.

So, I’ve added in the following to the post vo object:

1 / If the post has a featured image, the URL to it is included, otherwise its an empty string
2 / The posts tags are listed (if it has any) as an array of TermVo Objects
3 / The posts categories are listed (if it has any) as an array of TermVo Objects
4 / The posts attachments are listed as an array of their URLS.

The addition of tags and categories makes filtering the returned data quite easy.

Are there any other features that people want? I was looking at the user authentication aspect of WordPress at work last week, and was wondering if people have the need to be able to authenticate users? Possibly useful for adding comments etc?

1/ I think I’ll add a user authentication method, it wont really log a user into wordpress, but it would be useful for testing user access rights etc. Thoughts?

Once I finish my noponies illustration site, I’ll release the source files, so that there are some richer examples of what can be done with Flash and WordPress.

Simple Flash to browser console logging

If you are like me, you like to be able to trace out commands etc from Flash into your browser container. I generally use FlashTracer on Firefox or a more full featured debugger.

However, sometimes I simply want to trace elements into the console of either Safari or Firefox. This is as simple as using ExternalInterface and a small javascript method that takes a single parameter and writes it to the browsers console, via console.log(). Which can then be inspected via Safari’s debug panel or within Firebug on Firefox. And yes, I realise I could use Flashbug or something similar, but to be honest, I hardly ever use Firefox, hence the desire for something that works in Safari.

Simple example file is attached.

Source files
Simple Flash logging (1258)

FlashPress 0.6 Released

OK, I finally had some time to tidy this up a little.

So, here it is, FlashPress 0.6.

Supports both ZendAMF and AMFPHP. Supports WordPress 3.0.

This version of FlashPress uses the WordPress API rather than directly working on the wordpress database. It also includes write support for some methods. This is experimental and you should test this fully before deploying it. There is also an experimental search method, that will probably change internally as I get my head around the SQL required.

This is a beta, so let me know how you get on with it, and post any bugs etc so I can look into them.

The example file is minimal, with just a listing of the various method calls and their parameters. As I get time (unlikely) I’ll add to the examples. I’ll add the method lists to this post as I get some more time.

Note: I’ve tested this release against WordPress 3.0, and it seems to be working fine. Let me know if you enounter any issues.

Source Files
Flash Press 0.6 (853)

Actionscript 3 watermark image class

A recent project needed a watermark added to any images that could be downloaded off the site. Originally we used a PHP solution, which worked fine. But I wanted to do it inside of Flash and use the save methods in FP10.

So, I wrote this simple little class to adding a water mark to a display object, and the returning that display object as bitmapdata for say, passing to Adobe’s jpg encoder.

Maybe someone will have some use for it?

Source Files
Here is the relevant source file; Watermark class (1144)

By downloading, you agree to the terms of use, outlined here: http://www.blog.noponies.com/terms-and-conditions

Dependencies
Zero

Actionscript 3 RSS Reader Demo

I made this as a simple test for RSS parsing for a job a little while back, and it never was used for anything, so I’ll post it here as it may be of use to someone.

Its a simple RSS parser that uses the RSS and Atom libraries http://code.google.com/p/as3syndicationlib/ to handle parsing its RSS feeds. Although parsing RSS is trivial, I wanted to use a provided Adobe library for the hell of it.

The file is not overly documented and uses my scrolling panel and scrollbar classes to handle scrolling the RSS items.

An example is below.

Source Files
Here is the relevant source file; Rss Reader Demo (1402)

By downloading, you agree to the terms of use, outlined here: http://www.blog.noponies.com/terms-and-conditions

Dependencies
Zero

Using Asdoc under OSX

At work I’m without my install of Flex, and its various niceities like ant builds for creating ASDoc documentation for my various classes and work projects.

In the past I’ve messed around with the commandline controls for creating ASDoc documentation, but without a great deal of success.

However, at work today, I decided to get it working and create some documentation. There are a range of options for creating asdoc documents on the mac, I’ll list them below.

1 / Command line. Downloading the Flex SDK and kicking it command line style.

2 / Getting a copy of Flex, and using Ant to build your docs.

3 / Using either the SDK, or Flex but a front end tool like Dita to generate the shell scripts for you, that you then run in terminal to create your docs.

I’ve used Dita and Flex with an Ant build on my home mac. At work, I use the command line approach.

Heres how I got it to work, using the new Flex 4 SDK beta and the OSX terminal.

a / Make sure you have downloaded the latest Flex SDK. Unzip it and place it somewhere on your hard drive. Mine lives in the “Developer” folder of my OSX boot disk.
b / Open up a text editor. I always find it easier to work out my terminal commands in a text editor, and simply paste in what I want into termainl when I’m ready.
c / Find the path to your bin folder within your Flex SDK folder. The simplest way, is to simply drag n drop the bin folder into an empty terminal window, which will then give you the path to the folder. Or simply, type it out manually. You now need to tell terminal to work from this ‘bin’ directory, via the ‘cd’ command. The syntax for that is below;

cd path-to-you-flex-sdk-bin-folder

d / Now you can simply run the various asDoc commands to generate your documentation. The various commands I’ve used to create the documentation for my NpFSObjectresize class are listed below. Make sure the asdoc commands are all on one long line. For some reason, I had to have the footer and window title before the -doc-sources parameter.

cd /Developer/SDKs/flex_sdk_4.0.0.7219/bin/
./asdoc -main-title="NpFSOBjectResize Class" -window-title="Noponies NpFSOBjectResize Class" -footer="Copyright <a href='http://www.blog.noponies.com' title='Visit Class Author'>Noponies</a> 2009" -doc-sources=/Users/dsattler/Desktop/sample/noponies -output=/Users/dsattler/Desktop/sample/docs

As you can see from the example above, I have a folder called ‘sample’ on my desktop with my actionscript residing in a folder called ‘noponies’. I’m simply outputting my docs to a folder called ‘docs’ which resides within that ‘sample’ folder.

When you are ready, simply paste in your ASDoc commands into terminal, and you should see the asdoc tool run through its various steps. One thing I’ve noticed is that the Flex 4 ASDoc tool is much more strict about correctly closing html tags etc within your documentation. A missing closing /p caught me out.

Next Page »