by John C. Bland II | Jan 24, 2009 | General
Where have I been? I’m glad you asked. For the past 6 months I’ve been SLAMMMMMED with work, server transitions, and with Movable Type issues. ๐ I’ve been itching to blog but I didn’t want to blog on the old server (would need to transfer files, etc for my site again) then after getting the new server up I had MT issues that were nerve wrecking. Today I nixed the last MT issue, after having setup this WordPress blog weeks ago, and exported my old blog only to import here. I’m loving WP 2.7 and am ready to start blasting off blog posts again.
Anyways…look for me to start blogging again very shortly. I have a lot of lil’ code stuff to post.
HOLLA!
by John C. Bland II | Sep 27, 2008 | Flash Platform
I saw this on MySpace but have increasingly seen it more and more lately on numerous sites.
(more…)
by John C. Bland II | Sep 18, 2008 | Adobe AIR, Projects
For the longest I’ve been writing code but I never packaged my common code into a library. Well, that comes to an end.
(more…)
by John C. Bland II | Sep 18, 2008 | Adobe AIR
Just a quick tip here:
bq. var username:String = File.userDirectory.name;
So far I know it works on Mac/Windows but I haven’t tested Linux.
Hope it helps.
by John C. Bland II | Sep 5, 2008 | Adobe MAX
(subject says enough) ๐
This will be my 4th, or so, and my last as manager of “Arizona Flash Platform Users Group”:https://www.gotoandstop.org. Nothing much to say here. Just looking forward to geeking out this year.
by John C. Bland II | Aug 25, 2008 | Flash Platform
One of the easy things to do in Flash is tween but it never hurts to make an easy thing easier and that’s exactly what Grant Skin…errr…my bad…gSkinner (hehe) has done. So, maybe it doesn’t suit you, heck…might not suit me all the time, but I would say it is at least worth a look.
(more…)
by John C. Bland II | Aug 8, 2008 | Adobe AIR
Ok…this isn’t a “spoof” post or anything like that. AIR literally deleted everything on my desktop as well as screwed something up on my OS (Vista). How did this happen? I’m glad you asked.
First off…I didn’t tell it to delete ANYTHING. I’m adding features to an app and one of the features is to save a file to a network share so I was testing it against my desktop directory. Since this is AIR I figured a simple file copy was sufficient.
Do you remember that old joke where someone sent you a spam email and opening the attachment showed your My Computer window deleting every file on your system? That’s how I felt watching my desktop directory contents leave.
I’m on Windows…just right click on Recyle Bin and restore, right? NOPE. AIR DELETED ALL OF MY FILES PERMANENTLY!!!!! Every file…gone. I open Computer and and it tells me “C:\Users\John C. Bland II\Desktop refers to a location that is unavailable. …” which is great because now I literally do not have a desktop (beyond a background image).
So, again…how did this happen? Ok…don’t get testy. I had to vent through sidebars real quick.
//Copy JSON file to web server
var file:File = File.createTempFile();
var stream:FileStream = new FileStream();
stream.open(file, FileMode.WRITE);
stream.writeUTF(“some content”);
stream.close();
var jsonFile:File = new File(_filePath);
jsonFile.resolvePath(“live” + _Index + “.json”);
file.copyTo(jsonFile, true);
So, this all works up to the last line. Odd right? I don’t have any delete lines. _copyTo(…)_ is the culprit. Yep, copy really should be: copyAndDeleteAllContentsInTheDirectoryThenMoveFile(….). ๐
What’s worse is the desktop directory is gone so I have NO idea if it even worked. Now I have to try it again. ๐ This time I’m setting _filePath to _File.desktopDirectory.nativePath+”/myapp”_ so it will only delete that directory vs everything.
copyTo(…)’s overwrite explanation:
“If false, the copy will fail if the file specified by the target parameter already exists. If true, the operation will first delete any existing file or directory of the same name (however, you cannot copy a file or folder to its original path). (Note: If you set this parameter to true and the source and destination File objects point to the same path, calling this method deletes the file or directory.) ”
So…whatever it was…AIR DELETED MY DESKTOP! ๐ Boo FLIPPIN’ hoo! ๐
UPDATE:
The bug is in my _resolvePath_. It should be _jsonFile = jsonFile.resolvePath(“live” + _Index + “.json”);_. So, AIR tried to copy a file to a directory which caused the directory to get nixed since it was an overwrite. The time you want Vista’s UAC to kick in…it is MIA! ๐
by John C. Bland II | Jul 24, 2008 | Flash Platform
This is just a redirect to James’ site. He has posted two videos which are both pretty good.
Last night I decided to not work but found myself on the computer. So while I was messing around I had the videos play in the background and he covered the very basic to the good stuff. I thought it was well done and organized.
“Video: Flex Best Practices”:https://www.jamesward.com/wordpress/2008/07/22/video-flex-best-practices/
“Video: Flex and Java”:https://www.jamesward.com/wordpress/2008/07/21/video-flex-and-java/
Good work James.
by John C. Bland II | Jul 22, 2008 | General
(off-topic)
I thought about this quote earlier and found it funny…figured I’d blog it to add my copyright to it. ๐ hehe.
“7 is the number of completion, unless your checking your voicemail…then it is the number of deletion.”
๐
by John C. Bland II | Jul 22, 2008 | Flash Platform, Software
Come join the “azFPUG”:https://www.gotoandstop.org to see this great new product by “Flypaper”:https://www.flypaper.com.
View “more info on gotoandstop.org”:https://www.gotoandstop.org/index.php/2008/07/22/july-23-2008-630-pm-an-evening-with-flypaper/!
by John C. Bland II | Jul 22, 2008 | Writing
My latest article published today on InsideRIA.com. It has been a long while but that was because I had personal issues delay my delivery of the article which pushed back the release date a few months.
Shortly after I submitted my final draft, Christophe came out with an app to show the offline sync abilities in 2.6. His app looks really nice and he has a custom Java assembler included in his source. My app uses the LCDS samples data so look to Christophe’s for more on the Java side. Great app.
Anyways…read up and enjoy!
by John C. Bland II | Jul 21, 2008 | Flash Platform
I probably haven’t stated it publicly but LCDS is my favorite way of getting data into Flex. Even though I’m solid in CF I tend to enjoy setting a Java backend using Spring. Call me crazy but I dig Flex+Java(via)LCDS.
Anyways…”LCDS 2.6 is out”:https://www.adobe.com/products/livecycle/upgrade/dataservices.html and in the wild.
(Source: https://www.forta.com/blog/index.cfm/2008/7/21/LCDS-26-Released)
As I stated previously, here are my favorite features/updates in 2.6:
* **Data Management offline improvements** – Using the SQL database contained in Adobe AIR, you can use the offline support introduced in LiveCycle Data Services ES 2.5.1 to persist data directly to a SQL database. With little additional code, you can use an application written to use data management offline with complete access to any data and queries you executed online. To do so, specify a cache id and either use the auto-save option or explicitly save queries or items you want to persist offline for retrieval later.
* **Alignment with Adobe Flex 3** – LiveCycle Data Services ES 2.6 supports the releases of Adobe Flex 3 and Adobe Flex Builder 3.
* **Scalable HTTP based channel** – Supports thousands of connections for each Java process. You can use the RTMP channel if you are able to make these connections from your clients directly to the LiveCycle Data Services ES process. You can use the scalable HTTP based channel infrastructure if your clients can only connect to your servers using the HTTP protocol. Using the flexible ChannelSet mechanism of LiveCycle Data Services ES, it is easy to support a list of channels so your clients can connect using the implementation which provides the most efficient implementation.
Read the full “release notes here”:https://help.adobe.com/en_US/livecycle/8.2/lcds_releasenotes.html.
Enjoy!
by John C. Bland II | Jun 6, 2008 | Flash Platform
I saw this "trick" in someone’s code and have been using it lately so I thought I’d share. The idea is to create an object, bind it to the form elements, and bind the form elements to the object. In this example, I’m using a simple form from an app I’m working at the moment.
Userform.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="https://www.adobe.com/2006/mxml" xmlns:dto="com.katapultmedia.mystreamer.dto.*">
<mx:Script>
<![CDATA[
private function save():void{
}
]]>
</mx:Script>
<dto:User id="user" />
<mx:Binding source="firstNameField.text" destination="user.firstName" />
<mx:Binding source="lastNameField.text" destination="user.lastName" />
<mx:Binding source="emailAddressField.text" destination="user.emailAddress" />
<mx:Binding source="passwordField.text" destination="user.password" />
<mx:Binding source="isActiveCheck.text" destination="user.isActive" />
<mx:Form>
<mx:FormItem label="First Name">
<mx:TextInput id="firstNameField" text="{user.firstName}" />
</mx:FormItem>
<mx:FormItem label="Last Name">
<mx:TextInput id="lastNameField" text="{user.lastName}" />
</mx:FormItem>
<mx:FormItem label="Email Address">
<mx:TextInput id="emailAddressField" text="{user.emailAddress}" />
</mx:FormItem>
<mx:FormItem label="Password">
<mx:TextInput id="passwordField" text="{user.password}" />
</mx:FormItem>
<mx:FormItem>
<mx:CheckBox id="isActiveCheck" selected="{user.isActive}" />
</mx:FormItem>
<mx:FormItem>
<mx:Button label="Save" click="save()" />
</mx:FormItem>
</mx:Form>
</mx:VBox>
So, I’m not going to go line but line since it is pretty straight forward but here’s a brief outline.
Form Items
- Each TextInput is bound to the user objects respective property (ex – firstNameField.text is bound to {user.firstName}).
- The isActiveCheck is bound to {user.isActive}
Binding Tags
- Each Binding tags source property is bound to one of the form items.
- Each Binding tags destination property is bound to the respective user property.
That’s it. What happens is when I create an instance of this component I will set myUserForm.user = someUser; and when the user edits one of the form items the respective value of the user object will be updated instantly. This way, when the user clicks the Save button I can easily pull myUserForm.user and pass that dto (data transfer object) to the backend.
Kinda cool, huh? Well, I think so. Saves a good bit of Actionscript writing.
Enjoy.
Update: I should test code before posting. ๐ I’ve removed the brackets around the source/destination properties on the Binding tags. They aren’t needed.
by John C. Bland II | Jun 6, 2008 | Software
If you are looking for a good piece of software for bug tracking, I highly suggest looking at Axosoft’s OnTime. I last used the 2006 version and had numerous issues with it. My biggest issue was licensing. For a small, growing shop, at the time, with contractors coming in and out I didn’t want to keep buying licenses for every contractor that wasn’t a steady contractor. Without that issue, the desktop and web versions were a bit slow at times.
Well, 2008 has fixed the issue of slowness. It is really fast, in comparison, and still very easy to use/setup. The web version is AMAZINGLY better than ’06. It was pretty bad in 06: very slow, not as slick, everything was a refresh (no ajax), etc. I just installed the ’08 Web and I’m pleased.
Anyways…I’m not going to give a feature-by-feature review but thought I’d let folks know they might want to take a look.
Watch the videos and you’ll get a good feel for several of the great features OnTime provides.
BTW, it is “Totally Free” for a single user.
by John C. Bland II | Jun 4, 2008 | Adobe AIR, Flash Platform
I’m researching OpenAIM for an upcoming article and thought I’d share a few quick tidbits about connecting to OpenAIM. Let me first say…I didn’t do anything special here. AOL has provided a pretty quality developer center and they have written the ActionScript 3 code necessary for connecting to the AIM service. As a test I thought I’d try to grab my buddy list and show it in an mx:Tree component.
Disclaimer: This is purely a sample app so the code does not use any best practices or anything…just showing how to use the OpenAIM code.
Sample AIR app:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="https://www.adobe.com/2006/mxml" xmlns:wim="com.aol.api.wim.*"
layout="absolute"
applicationComplete="init()">
<mx:Script>
<![CDATA[
import com.aol.api.wim.data.types.SessionState;
import com.aol.api.wim.data.User;
import com.aol.api.wim.data.Group;
import com.aol.api.wim.Session;
import com.aol.api.wim.data.BuddyList;
import com.aol.api.wim.events.BuddyListEvent;
import com.aol.api.wim.events.SessionEvent;
private var aolSession:Session = new Session(stage, "your developer key", "Your Test Client", ".1");
private var aolBuddyList:BuddyList;
private function init():void{
aolSession.addEventListener(SessionEvent.SESSION_STARTING, handleSessionStarting);
aolSession.addEventListener(BuddyListEvent.LIST_RECEIVED, handleBuddyListLoad);
aolSession.signOn("your username", "your password");
}
private function handleSessionStarting(event:SessionEvent):void{
aolSession.requestBuddyList();
}
private function handleBuddyListLoad(event:BuddyListEvent):void{
aolBuddyList = event.buddyList;
updateBuddyList();
}
private function updateBuddyList():void{
var buddyList:XML = <node label="AOL Buddy List" />
var group:XML;
var user:XML;
for each(var item:Group in aolBuddyList.groups){
group = <node />
group.@label = item.label;
for each(var userItem:User in item.users){
if(userItem.state == SessionState.OFFLINE) continue;
user = <node />
user.@label = userItem.aimId;
group.appendChild(user);
}
buddyList.appendChild(group);
}
buddies.dataProvider = buddyList;
}
]]>
</mx:Script>
<mx:Tree id="buddies" width="100%" height="100%" showRoot="false" labelField="@label" />
</mx:WindowedApplication>
So, briefly I’ll cover the code (gotta cook dinner in a sec; lol). On Line 4, above, we set the applicationComplete event to call our init() function, lines 19 to 23. In there we add a couple event listeners then call the signOn(..) function of the WIM api. Before we can successfully do this the aolSession variable must be created, which we do on line 15.
Note: You HAVE to get a developer key from AOL in order to test this code.
Once the sign on request is complete we call requestBuddyList(), line 26. When the buddy list is returned we set the aolBuddlyList variable then call updateBuddyList(), line 32. The updateBuddyList() function merely loops over the groups (your buddy groups) and users in each group, updates the buddyList XML local variable, then assigns it to the dataProvider of the buddies Tree component.
For the UI we mer
ely create an instance of mx:Tree and set the labelField to @label, which is what we created in the updateBuddyList() function.
That’s it. Run the app and you’ll see your buddy list in a window like below:
They have some work to do on the source code but I went from from 0 knowledge to this sample app in 20 or so minutes. Grab the code and check it out.