Last night I began work on a project I have been planning on working on for a while. I kept thinking about it saying I should do it but never really got into it. Finally last night I started working on it. The first version is planned on being a simple cataloging system for my DVD rips. Currently I organize them in a spread sheet that tells what formats I have encoded and what hard drive they are stored on but the list is getting long and looking through 300+ rows in a spreadsheet is getting annoying. This project will hopefully help me to better organize my rips/encodes so that I can easily search, watch, and organize the movies. The project is being built in Flex 3 and AIR. Probably the best part of the project is getting to take advantage of Adobe’s AIR, which is now version 1.0 and the ability to work with AIR’s ability to write to the local file system in a database file. Right now the screen shot below does not do a whole lot other than allow for you to add a new library, but tonight I plan on adding the functionality to be able to add videos to a library, and just maybe be able to watch them. We will see how it goes.
Archive for the 'Flex' Category
When is stage available?
I’m not sure if anyone else has run into this…. So for some reason, when writing Flex apps I have been relying on the creationComplete event to initialize my application, but at the time that event fires off the stage is not available yet. I found out there is an applicationComplete event, and after this event is fired off the stage is available.
Campsite Beta v0.2
I figured I would give it another shot and I think I’ve got a reasonably stable version of Campsite. It doesn’t seem to error out from what I’ve tested. Basic functionality is simple.
- Enter the sub domain for your campsite account (if in the url it says someplace.campfirenow.com then you would enter someplace in the field)
- Enter your email address and password, at this point it will log you in
- Choose a room to join
- After you choose a room it will load up the current chat of the room. Don’t click around or anything until you see chat messages in the display, or you will probably break it
- Type a message and click send, after sending a message it will auto-refresh
- If you want to see new messages others have typed click the refresh button
So far that is all there is to it. Its pretty simple and very unfriendly as far as usability and design goes, but that can be taken care of later.
You will need to download AIR, which can be found here.
Then next you will need to download campsite which is here
Give it a try and let me know how it works. Hope someone finds this interesting.
Campsite Delayed
I have not had the time necessary to continue to work on Campsite. I really want to get this thing up and running, so hopefully sometime this week or maybe the beginning of next week I will have some spare time to throw at it.
Sandbox Violations
So this is pretty lame. In flash when you see a sandbox violation you immediately think “Do I have a crossdomain.xml file to allow this?” so you then go check and if not it usually fixes it. Well, this is not the case all the time. I was trying to make a request and instead of http:// I typed http:/. By forgetting the second slash it threw a sandbox violation instead of just simply saying invalid url or something a bit more descriptive. Anyways thats my rant on non-descriptive error messages. They waste time!
Old Posts…
I imported in a couple of old posts from my blogger account today. They are all about programming and AS3 so not too interesting if you are here for any other reason I guess.
Campsite works!
It’s pretty late… 1:34 AM There is a bug within Flex 3 that wont allow me to auto scroll the list that is displaying all of the chats but other than that the thing seems to be working pretty well. There is still a ton of work left to be done, but it will currently log you in to the desired sub domain, you can pick a room and chat away. It currently has to have its date hard coded because of some inconsistencies with the way I get the date and the way campfire does the date, so after I get that worked out hopefully I will be able to put it up for download. Here is a screenshot of it for now.
Coding away….
Yup thats right I’m continuing to work on the campfire chat client, which I’m going to call “Campsite.” Thanks to Cade (Vorak) for that one. It’s going a bit slower than I anticipated, mostly because parsing through a bunch of HTML to find the necessary chats everyone has typed is harder than I would have guessed. I started by using Regular Expressions, and realized that turning the HTML into an XML Object is a far simpler approach. Hopefully I will be able to finish that tonight. I was planning on releasing a simple Beta of the application tonight, but there is no way that is going to happen. Well more wine, music, and typing….. Oh yeah, I’m going to start up another blog for tech things so these types of posts wont end up in here where most people probably don’t care to read them anyway. More later…
So tonight has been quite the little experiment. The fact that Websense is an issue for my friend Cade where he works peaked my interests. And I was all like oh ok, well how about I will built you an AIR application using FLEX 3 that will allow you to poll for the updates in the Campfire manually, so that there are not so many requests going out every 2 seconds. Well unfortunately I have not gotten to the point that the requests run through a sort of “proxy” on jordanrounds.com or anything like that but I have successfully logged into campfire with my login credentials and also posted comments. I just thought it was pretty awesome that I was able to get that far in just one night. More later when I have something working and available for download.
So the problem is you want to connect to port 80 with a socket connection. Now you would think this would be simple, but of course it is not. To connect to port 80 or for that matter any port below port 1024 you need to first connect the xmlsocket:// protocol, which requires a different type of server than an http server such as apache. Before we get real deep into this I will briefly explain the rules. Or should I say describe them as I understand them.
1. To load any type of content from a domain, you must first load a crossdomain.xml file, which tells flash which sites the site it is connecting to allows. An example would be.
cross-domain-policy allow-access-from domain="mysite.com" ports="80" /allow-access-from /cross-domain-policy
so this policy file allows flash content from mysite.com to load content and it also says it allows connections from there to connect to port 80 with to-ports
2. Socket connections can load a crossdomain.xml file over standard http through a socket connection on any port over 1024, but the to-ports property will only allow ports above 1024 if the port connected to is above 1024.
3. To connect to a port below 1024 you must load the crossdomain.xml file from a port below 1024, and to do this you must use the xmlsocket protocol
Example:
Security.loadPolicyFile(xmlsocket://mysite.com/crossdomain.xml);
This line is not necessary unless you would like to specify the crossdomain.xml file location. By default the socket connection will request it from the root.
4. After the connection is made the socket will load the crossdomain.xml file and it will see that it can now access port 80 or whichever port you are trying to allow below 1024.
Conclusions:
Connecting to a port below 1024 is way too complicated. I do not understand why it is necessary to load the policy file over a different protocol. This just results in having to support yet another service, when the only reason for it is just simply to load an xml file. I understand there are security precautions there and that it is the main reason that this exists. I just feel that this could have been handled in a much more graceful or possibly better documented way.


