Posted by Jacob Wright in Flash, General, PHPAug 12th, 2005 | No Comments
AMFPHP (Flash Remoting written in PHP) has hit a stable version 1.0 release! I’ve been looking forward to this for a long time.
Flash Remoting is a method of transfering data to a Macromedia Flash Movie. It sends it in binary format and is much easier to use as it arrives in an object form, meaning, you don’t have to sort through the child nodes of an XML object. I have been using AMFPHP for over a year on several projects (being one of the main backend developers in my company, mediaRAIN) to send stuff. I created the logo storage of LogoMaker/InstaLogo using AMFPHP which handles,...
Posted by Jacob Wright in General, JavascriptAug 11th, 2005 | No Comments
I have created a method that assists in creating your HTML elements in Javascript. textToNode takes a string of text and converts it into a DOM element which you may then use for insertion. It's much easier to use than creating each node seperately, adding attributes to it, then appending it to the parent. It also works for table elements (tr, td, etc.) and the option element in a drop-down box.
This was created for DOMClass objects but has been very nice for creating elements on the fly. It is as easy to use as the innerHTML property of an element, but it works with table elements etc. and...
Posted by Jacob Wright in General, Object Oriented Programming, PHPAug 5th, 2005 | No Comments
One of the simple and very useful pieces of code in Pherret (a PHP 5 framework) is the setProperties() function in the base Object class. The name originally came from Java Beans and works in a similar manner. I'm sharing it because it could be used in any code with PHP 5 or PHP 4.
First, here is the problem being solved. Do you ever find yourself setting and object (or array, or variables) from a HTTP post in the following manner?
$user = new User();
$user->firstName = $_POST['firstName'];
$user->lastName = $_POST['lastName'];
$user->address = $_POST['address'];
$user->city...
Posted by Jacob Wright in General, Javascript, Object Oriented ProgrammingAug 4th, 2005 | 1 Comment
It's alive!! I have created a very cool, very simple, function to create new javascript objects that are (not just act upon) HTML DOM elements. Let me explain. Say I have a cool new tree menu I'm creating (true story), and I want others to be able to just start creating the menu items and adding them in via javascript if they need to. The ideal way would be to just say myItem = new MenuItem('Cool Item'); and have it return to me the actual menu item (the TR tag or LI tag) which can be inserted into the menu.
No more of this element wrapper stuff. I don't want to code my classes to act upon a...
Posted by Jacob Wright in General, Object Oriented ProgrammingJul 18th, 2005 | 15 Comments
This is the fourth of five articles on object oriented-programming.
An Introduction to Object-Oriented Programming
Thinking Object-Oriented
Planning an Application
Creating Objects
Making Objects Reusable
In the previous three object oriented programming articles written for jacwright.com, we introduced object oriented programming, spoke of thinking about a system object oriented, and discussed the importance of planning, even if only in one's head. The next two articles, Creating Objects and Reusing Objects, delve into the meatier subject of writing objects. We will be discussing how to implement...
Posted by Jacob Wright in GeneralJul 5th, 2005 | No Comments
I have been working on a project recently which has had a shorter than comfotable deadline (working long hours, weekends, etc.). For this reason I haven't had time to upkeep the site as I would like. The information on Pherret is outdated, and there is not a good (recent) download of the framework. However, for better or for worse, the deadlines are coming this week and the following. Because of this there will not be any article this week. I hope to be able to get back on top of things at the end of this week or the end of next week. I should be able to update the information, perhaps even...