Someone put together a monster list of sites and services that offer Web API’s…check it out.
FlashApe » archive for August, 2007
Nice list of Web APIs
- August 21st, 2007
- 9:03 am
FLVFetcher update
- August 20th, 2007
- 6:04 pm
I just updated FLVFetcher so that you can now pass it a full youtube or google video url using FLVFetcher.fetchByURL(url). FLVFetcher allows you to load google and youtube flv’s directly into flash.
Also, the fla in the source has been saved out as a Flash 8 file.
Ritalin is easy, ritalin is good
- August 20th, 2007
- 10:23 am
I hope anyway….recently I was diagnosed with AD/HD. After talking with doctors and researching it, I am simply amazed at how much of an impact it has had on my life. I always took it as that was “just me”, that’s “just how I am”. Add on to that the affect it had on my wife, who was having a hard time and getting frustrated dealing with “the way that I am” and the impact is that much greater.
How do I feel about the diagnosis? Fantastic. I feel like someone found a missing piece to the puzzle that is me. I’ve only been taking the ritalin for three days so far, and I’m starting off with a pretty low dose, so I can’t really say anything about hte effects yet, we’ll see how that goes. I’ve got my fingers crossed though, and I’m looking forward to days when I don’t have to:
- walk out my front foor, realize i forgot something, go back, get what I forgot, walk out my front foor, realize i forgot something, go back, get what I forgot, walk out my front foor, realize i forgot something, go back, get what I forgot, walk out my front foor, realize i forgot something, go back, get what I forgot,walk out my front foor, realize i forgot something, go back, get what I forgot, walk out my front door, finally get to my car, start driving realize i forgot my cell, go back to my apartment, forget what I went back there for
- Spend 10 minutes looking for
that i was JUST holding 5 seconds ago….10 times a day - Listen to my wife get frustrated because I lost something again, or forget something again
- Make careless errors on work because I simply can’t focus
- Spend more time than necessary at work because I can’t focus/am easily distracted
- Have 4-5 projects at a time that are unfinished for no good reason
- Lose track of the conversation I am having with someone else after 10 seconds.
Anyway, we’ll see how it goes. I’m hoping to post some updates, especially related to how it affects my work.
FLVFetcher - Directly download youtube and google flv’s into flash
- August 16th, 2007
- 5:54 pm
Here’s my take on downloading the flv’s directly from youtube and google to stream into flash. It’s made up of two parts - an AS 2 class called FLVFetcher and a php script.
As of right now, to get the path to the flv file you simply add and event listener for the ON_URL event, then all you need to do is pass the video id of the file you wish to load.
For youtube videos, its that is the value of the ‘v’ variable in a url like:
http://www.youtube.com/watch?v=Tkq2Kq-LmJg,
and for google video, its the value of the docid variable in a url like:
http://video.google.com/videoplay?docid=-988708193861222512.
FLVFetcher.fetchByID(id:String, videoType:String);
The class has two constants you can use for the video type, either FLVFetcher.YOU_TUBE or FLVFetcher.GOOGLE.
On the php side, it uses a custom HTTPRequest class to get around server configurations where remote file access is disabled.
You can check it out here and download a zip of the source here.
Some example code:
import com.f1fd.flv.FLVFetcher;
import com.f1fd.flv.FLVFetchEvent;
import mx.utils.Delegate;
// for google, you jsut need the 'docid' variable from the url
var googleID = "-4329042477720699378";
// for youtube vids, all you need is the 'v' variable
var youTubeID="J0TiFPynBgI";
var fetcher = FLVFetcher.getInstance();
this.onEnterFrame = function(){
init();
delete this.onEnterFrame;
}
function init(){
FLVFetcher.PHP_PATH = 'get_video.php';
fetcher.addEventListener(FLVFetchEvent.ON_URL, Delegate.create(this, onURL));
fetcher.addEventListener(FLVFetchEvent.ON_ERROR, Delegate.create(this, onError));
google_button.addEventListener ('click', Delegate.create(this, onGetGoogleClick));
youtube_button.addEventListener ('click', Delegate.create(this, onGetYouTubeClick));
}
function onGetGoogleClick(){
fetcher.fetchByID(googleID, FLVFetcher.GOOGLE)
}
// change second param to FLVFetcher.GOOGLE for google videos
function onGetYouTubeClick(){
fetcher.fetchByID(youTubeID, FLVFetcher.YOU_TUBE)
}
function onURL(evt){
message_txt.text = 'The URL is : '+newline+evt.data;
my_vid.contentPath = evt.data;
}
function onError(evt){
}
Drag and Drop in Flex
- August 9th, 2007
- 4:15 pm
I was trying to implement drag and drop for a loaded Image today. All I needed to do was move it, and constrain the drag to the parent container, and that’s it. In two different books I have on flex, and in the documentation, as well as this tutorial, they talk about implementing drag and drap through a series of steps which include:
- importing the DragManager, Drag Source, and Drag Event classes
- Creating a new DragSource object
- Creating a new proxy image, which is the item that is visibly being dragged
- Setting up another object oto act as as a drop target and handle drag events
After getting 90% complete with that method, I ran across a comment on the Flex LiveDocs which pointed me to the blatantly obvious: you can simply use the startDrag() and stopDrag() methods inherited Sprite.
Durr.
GreenSock - good stuff.
- August 9th, 2007
- 10:00 am
Just wanted to give a shout to Jack Doyle, aka GreenSock. He’s done some excellent work on some very useful utilities, including:
- TextMetrics - Enhanced text field metrics.
- Transform Manager - give the user the ability to scale, rotate, and/or move any MovieClip on the stage
- TweenLite - A Lightweight (2k) Yet Powerful Tweening Engine, availble in AS2 and AS3 flavors. Also availablee is TweenFilterLite, for tweening filters.
There’s some other goodies there too. On top of doing good work, he’s been very responsive and helpful in the instances where I’ve contacted him directly asking for help.
Undefined Numbers in AS 3
- August 6th, 2007
- 5:10 pm
Just ran into this one, trying to set parameters that were typed to number to undefined or null. There are a few datatypes you can’t do that with anymore, and Number is ’special’ because they cannot be undefined or null, only NaN. Instead of using Number you can use the special * (untyped) designation, and to test for an undefined Number you can use isNaN().
Book Review: The Essential Guide to Flex 2 with Actionscript 3.0
- August 2nd, 2007
- 1:27 pm
I just got done wrapping up (for the most part) the book Flex 2 With Actionscript 3.0. Overall I thought it was a generally gentle introduction into Flex and covered a lot of basic Flex topics pretty well. Using typical Friends of ED ’show me how’ (rather than ‘read this code’) style, the book breezes through topics such as setting up creating projects, working with variables and databinding, containers and components, working with XML, states, and more.
At this point I have two main criticisms of the book, nethier of which should deter anyone considering this book. First, teh book could have used a little better technical review…or at least someone could have made sure that the code examples in the downloads for the book matched what the book was saying. Mostly it was little things, like a chapter’s project files would be all lumped in the folder when the books sample code clearly expected a different directory structure, or the supplied XML files not matching up too well with what the code in the books was showing. I also noticed one glaring instance when a function mysteriosuly switched names for no reason.
The other criticism I have is the ColdFusion slant on the book. Nothing against ColdFusion, but I don’t use it, and probably won’t, ever. Luckily there was only one chapter devoted to Flex / ColdFusion integration, so I pretty much just skipped it.
As far as the title of the book goes, it barely touches on AS3, so if you’re really looking for a deeper level of AS-MXML integration then this book might not be for you. While I don’t think this book is an ‘Essential Guide’, I definitely think it’s a great book to kick start your intro to Flex.