1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

How to: Post images to TwitPic with Actionscript

Uploading images to services like TwitPic is actually as easy as sending a HTTP POST request, which means its also pretty darned simple to upload something from Flash Player 10 or AIR. This is an example for AIR, but doing something similar in Flash Player 10 should also be possible – you just need to swap the references to the File class to FileReference.

TwitPic

So, how do we get our photos on TwitPic?  Well, let’s check the API: TwitPic API. According to the API, it’s just a case of posting an image file with additional parameters of username, password and if you like, message. And the upload location is pretty simple too - http://twitpic.com/api/upload or http://twitpic.com/api/uploadAndPost. One for just uploading, and the other for posting things to your twitter feed at the same time.

If you’re posting automatically to twitter, TwitPic will automatically add the url to your image to the start of your tweet.

So, let’s check out some basic code:
Continue reading How to: Post images to TwitPic with Actionscript…

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

Tweener – 4 years old now(!)

Zeh Fernando has posted about Tweener – a bit of a roundup of the development and demise [of Tweeners' development] of Tweener.  In short, it’s no longer being developed, but it still works and is still pretty awesome.  That doesn’t do the post justice though, so head over and read the full post at Zeh’s blog;

http://zehfernando.com/2009/tweener-4-years-later-a-post-mortem/

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

Flex Quick Tip: Printing an Objects’ contents

You quickly learn in Actionscript 3 that tracing an objects’ contents is not always that simple.  Commands such as trace(myObject); often yeild the highly infuriating [object Object] return, which tells you mostly nothing of what you actually wanted to know.  After that you can move on to more advanced trace logic, like the handy;

for(var i in n) {
    trace(i+":"+n[i]);
}

But that’s a lot of stuff to type, and often yeilds infuriatingly long stacks of parameter traces.

Flex can make things a little easier, with this useful utility class, the cunningly named ObjectUtil class.  Simply import the class (import mx.utils.ObjectUtil;) and call the following method; trace(ObjectUtil.toString(myObject)); and you’ll get a nice output of all the properties of your object.

Kudos to flextutor.org for this, in their original post “How to print an objects’ contents in Flex.”  I thought I’d repost it here though, not least because there seems to be an issue loading their site as I’ m writing this article.

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

ActionSnippet

ActionSnippet

This site has loads of little ActionScript snippets. There’s some cool stuff in there – click on ‘All Posts’ and you’ll see a list of them.
It’s got things like dragging and snapping to a grid, random sort, variable swap, etc etc.

http://actionsnippet.com/

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

Setting up ASDoc in Flex Builder

ASDoc is a command-line tool that you can use to create API language reference documentation as HTML pages from the classes in your Adobe® Flex® application. The Adobe Flex team uses the ASDoc tool to generate the Adobe Flex Language Reference. [From LiveDocs http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_1.html]

Seb (a developer on the PPV3D team) shows you how to set this up in Flex Builder
http://www.sebleedelisle.com/?p=401

I could’ve done with this earlier this week as I ended up using the Command Prompt instead!

Also if you’re @author is coming up with the wrong name Seb shows you how you can change the default:
http://www.sebleedelisle.com/?p=404

I think this could come in handy when working on large projects and/or projects with multiple developers.

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

Link: Actionscript 3 – Don’t User the Timer to Make Timers

An interesting bug in the Timer class -http://flexandair.com/?p=32

Turn’s out it can’t count properly – helpful eh?

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

Tutorial link: Getting started in Papervision 3D

This tutorial goes from the basics and is really comprehensive.

http://www.marcpelland.com/2009/01/22/guide-to-getting-started-in-papervision-3d/