Random Suprise

My girl told me about this;

Frida's Garden - Threadless, Best T-shirts Ever

I had no idea. Cool to get reprinted twice now!

FlashPress Feature Requests?

I’m currently re-writing my Flash press PHP service.

I’ve moved it to using the Wordpress api as opposed to working on the database directly.

Most methods are complete, with some no longer needed. For instance, all posts / pages can be returned with a simple ‘getContent” method, but would you rather have seperate, ‘getPost’,’ getPosts’, ‘getPage’, ‘getPages’ etc methods?

What additional features would you like to see in this service? Remember, that the service has access to most of the Wordpress API. There is no point recreating each an everything method, but there might be some methods that are more useful than others. I’ve also added in two methods for calling Wordpress methods beyond what the service supports, one for the Wordpress API and one that handles SQL requests, channeled through the Wordpress API.

Anyway, let me know your thoughts, if you have any.

At the moment, I’ve only supporting ZendAMF but will test out AMFPHP if I get the chance.

Update:
I’ve got it mostly completed. Just have to work on documentation and some examples. I’ve got reading and writing to the Wordpress database for posts / pages and attachments. And reading support for most other Wordpress features.

To get Write support for attachments (image resizing) you will have to require admin.php, but as you have to require a Wordpress file to get access to the Wordpress API anyway, I’m sure thats not a problem for anyone. Let me know if it is.

Update 2:
I’ve finally managed to get AMFPHP up and running again and have the various methods working through the services browser. I added in a new method to get the attachments from a post, which was a requested feature. I’ve also re factored some of the code.

The current available methods are:
callWpMethod – call any available Wordpress method
getUserByLoginName
getUserMetadata
getUserById
getComments
getPostMeta
findTerms (taxonomy method)
getTagCloud
getTerms
getCategories
getCategoriesByPostId
getTagsByPostId
getBlogInfo
getBookmarks
getAttachments
deletePost
getPostOrPageByTitle
getPosts
getPost
countPosts
insertAttachmentAsByteArray
insertAttachment
insertPost

I may rename some, or drop some methods. Note that “posts” is used to mean posts and pages.

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 (597)

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

Dependencies
Zero

Jquery Fullbrowser Background Images

I seem to be spending more and more time using jQuery than I do Flash, but I think that is just the nature of my current job. I’m actually really enjoying jQuery, it’s a breeze to use and in most instances you can do what you can do in Flash with javascript, only quicker.

To cut a long story short, I had a project come up that needed a javascript full browser background image class, and being the nerd I am, I thought I’d roll my own rather than use any existing jQuery plugins.

I approached it from a Flash standpoint, and tried to replicate the way I use my Flash full browser classes. So rather than operating on a container of image urls as most jQuery full browser plugins do I set this one up to respond to a method call, and load and display each image as requested. The reason for this approach was that I wanted the plugin to only load what images were requested, by me when I wanted them. I’m thinking however of adding in the ‘operate on a container of image urls’ approach to a future iteration.

As this is my first attempt at writing a jQuery plugin I’ve probably made a ton of noob mistakes. Let me know how it works and any bugs you encounter.

Plugin Features

  • Set Fade in time
  • Center image within browser window on x axis
  • Callback methods

An example of loading a single image;.
http://www.noponies.com/dev/jquery-npfullbrowser/static.htm

An example of setting up a slideshow;
http://www.noponies.com/dev/jquery-npfullbrowser/slideshow.htm

Source Files
Here is the relevant source file; jQuery Full Browser Background Images (757)

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.

The Flash plugin is required to view this object.

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

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.

ActionScript 3 LoadMovie Snippet

Over on kirupa, one of the users was complaining about the lack of LoadMovie in AS3.

While not being something that has ever concerned me in the slightest, I thought I’d whip up a quick AS3 version of the same general idea.

Its pretty simple. A singleton class, with a simple “loadMovie” method that accepts the string URL of the asset to load, the container to load it into, and an optional Boolean flag for deciding if the containers existing children (if it has any) are removed with each new load.

I doubt this will have much use, but who knows.

Source Files
Here is the relevant source file; LoadMovie (1631)

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

Dependencies
Zero

Next Page »