Saturday, March 24, 2007

Needing PHP5's simplexml_load_file function but have PHP4?

If you are using PHP Proxy to deal with Cross Domain Security issues with Adobe Flex for things such as RSS feeds but have PHP4 instead of PHP5 you can do the following.

PHP5 makes it looks so nice

<?php
$url = $_POST['url'];
$xml = simplexml_load_file($url, "r");
echo $xml->asXML();
?>


PHP4's equivalent

<?php
$url = $_POST['url'];
$handle = @fopen($url, "r");
if($handle)
{
while(!feof($handle))
{
$buffer = fgets($handle, 4096);
echo $buffer;
}
fclose($handle);
}
?>


Cheers

Matt

Additional Reading
TechNote : Loading data across domains
ABC Indigenous News RSS Feed (using Adobe Flex)



Great news feed.

Matt
Interest Calculator

I had an job interview recently at one of the local financial institutions. As part of the application process I left the interview with a small exercise, asked to use a couple hours on it and send it back in. The exercise was to use a small high level specification, along with a table of rates data, to do a modest small technical design document and implementation of a calculator sitting behind a web service. I did the exercise and sent it in but thought to myself why not chuck a Flex interface on it.



For intended audience.

Matt

Thursday, March 22, 2007

Dealing with asynchronous events in Adobe Flex

Sho Kuwamoto has a couple fantastic blog entries introducing the topic of asynchronous events with Adobe Flex, the options and pros and cons there of.

Asynchronous calls explained

Dealing with asynchronous events, part 1

Dealing with asynchronous events, part 2

Dealing with asynchronous events, part 3

Great stuff!

Matt

Saturday, March 17, 2007

Flex Stock Tracker



Some test values
Symbol : ADBE (Adobe)
Symbol : CSCO (Cisco)

Yahoo!!!

Matt