April 2009 Archives

Safari 4 Beta Review: Part 1

| No Comments | No TrackBacks
Well, I just downloaded Safari 4 today, and have been highly impressed. I haven't encountered any problems whatsoever, despite all the discussion online about all it's problems. I haven't found any, and are using it as we speak. I will talk about it more after I have experienced it more than I already have.

That's all for now.
So, you now have all this data into your Flex application from PHP, you would want to use this data. How do you do it? Well, in this part of the series, I will explain how to use text from PHP in your flex application.

First off: using plain text. Lets say that all that the PHP script returns is a big paragraph of text. To do this, you just make the PHP script print the text. Easy enough. Lets also say that the text is the classic: 
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam feugiat augue eu ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla vitae nisl. Ut fringilla. Nunc tincidunt nunc non magna. Duis vestibulum euismod ipsum. Praesent consequat. In ultricies, massa vitae consectetur accumsan, purus nunc adipiscing magna, nec gravida ipsum enim at quam. Nam in arcu. Donec id mauris in dolor gravida faucibus."
Since this is your text, and you are receiving it through an HTTPService in Flex, (Discussed Here) you have it easy. All you have to do is to access the result of your HTTPService, (lets say it's called dataService) by saying dataService.lastResult. You can use this snippet of code several ways. To get it to display in a text field, you just have to make the Text property of the label or text box this: {dataService.lastResult}. The control will now show the text that you fed it. 
this can be used on all kinds of controls all over your application.

I know I previously said that this entry would be longer. This was an outright fabricated lie. I have broken the entry up into two entries, one today, and one later on in the week about parsing Image data in your application from the PHP script.

Hang on till then.

Great Session on Flash Catalyst

| No Comments | No TrackBacks
Great session on Flash Catalyst. From @flash_catalyst  on Twitter.
So, if you have not seen part 1 of this series and are just now seeing part 2, the link to part 1 can be found here. Now for part 2. This part will be shorter, because there is less to talk about. Part 3 will be quite long and in depth, so keep up.

So now, you have a functioning PHP script that will generate XML code that Flex can interpret. So, for the sake of simplicity, lets say your XML consists of this code. 
<?xml version="1.0" encoding="utf-8"?>
<customer>
     <first>John</first>
     <last>Doe</last>
</customer>

So, that's the script that will be generated by your PHP script if you poke it. But, how do you get flex to poke it? Well, Flex has a built in component to handle this request. It is called an HTTPService. The HTTPService allows you to connect to a web page (PHP, XML, HTML, whatever..) and pull the results. So, to get the result from the PHP script, all you have to do is define an HTTPService component that connects to the PHP script. It would be done like so:
<mx:HTTPService method="POST" url="http://www.me.com/script.php" id="webService" /> 

This HTTPService call will ask the PHP script for a result, which will be supplied to it. The result will be enclosed in the result of the HTTPService. This is accessed by simply getting the name of the HTTPService, in this case webService and attach another identifier to it. This example would require somthing like this: webService.lastResult. Now, a certain tag in the XML code can be accessed by a different method. So, if you want to get the customer name, in this case John, you would do something like this: webService.lastResult.customer.first. Notice the names of the XML tags in the access tag. To access anything deeper, you would have to just add the next tag down and go from there. 

That concludes part 2, and part three will be here on Sunday. Hang on for then.

PHP Data with Flex Applications: Part 1

| 5 Comments | No TrackBacks
I will now start my 3 part series on connecting PHP/MySQL datasets with a Flex application. Part 1 will deal with writing the PHP back end script. 

To start, you need to know the PHP command  Print. this will give you the means to send along the data. You also need to know variables which will be used in the script. 

To start, you need to define a variable and give it a value. The value of the variable will be the beginning of your XML code. So, the variable should be called $result. Define $result like this:
$result = "<?xml version="1.0" encoding="utf-8"?>"; without this, flex will not be able to decode this data as XML. You need to put quotes around the text in the tag or PHP will not recognize it as text.

Next, you use the function that will append data to your variable. This is easy, and involves only adding a . to the end of a variable. So, to define your first XML tag, you do something like this:
$result. = "<myTag>"; which will add the <myTag> tag to your XML script.

So, you want to put MySQL or other data into the XML? Here's how! You have to know how to access the data. You would put it into the tag like this:
$result. = "<myDataTag>".$row_my_data['data']."</myDataTag>"; Notice the periods between the text and data. These will let PHP know that the data in the $row_my_data['data'] text will come from elsewhere in the script. 

To have multiple pieces of data in the same thing, like member names of an organization, all you have to do is to put a repeat region around one of the tag definitions. This will repeat the tag until there is no data left, or another user defined parameter. 

To finish it off, you have to make sure that you have closed all your tags. Otherwise, there will be an error. 

So now, the $result variable has all the XML data that you need. All you have to do is print it to the page. So:
print $result; will do the job.

In a few days, I will put up the second part of the series, "Receiving the Data in the Flex Application", followed by "Implementing Data in the Application".
Note to my loyal viewers, I put this here on my own. Hulu did not pay me to do this. 

Weekly LOL

| No Comments | No TrackBacks
Here it is... the long awaited WEELKY LOL!
Sorry if I haven't been active in a week, because it was Passover and have been in a bad mood from eating Unleavened Bread all week. 
funny-pictures-furwall-prevents-unauthorized-access.jpgfunny-pictures-cat-sits-on-your-keyboard.jpg

BumpTop 3D Desktop

| No Comments | No TrackBacks

So, I hound this thing. It's called BumpTop 3D desktop. It's awesome!!! Of course, like most things, there is no mac beta yet, but when it comes out I have a code to get it. You see, the beta invite code works on mac and PC, though there is no mac version.

Sounds a little bit like Chrome, doesn't it?

To Continue my Catalyst Reviews...

| 1 Comment | No TrackBacks
I plan to create a daily series about Flash Catalyst. As you all know, however, I can't get catalyst yet. This really stinks, and I am really mad. I have no idea who to contact to get onto the Private betas, as this link is not available to the public. As Ryan has said, it should be out in a year. That probably means that the Public beta won't come out for another six months. This really stinks. I don't even have any idea as to wether it will work on my Powerbook... I should look into that...happy01

Just a thought. 

And thus ends a Maple Legacy...

| No Comments | No TrackBacks
Today marks the last day of boiling Maple Syrup for us. We would still be boiling, except that the sap smells like beer now. We expect this last batch to be about 1 1/2 gallons. It is the official end of the 2009 season because the commercial guy down the street from us pulled all his taps today, and so did we.

A tear shed for the end of the season. weep

Cool Emoticon, Huh? I found a plugin for it...
It has a hundred different ones...

Tube TV

| 1 Comment | No TrackBacks
Here is a great application that I've found. It's called Tube TV. It allows you to download videos from Youtube or Google Videos, and convert them to iPod. It also allows allows you to keep the FLV file after downloading. Sweet Eh?

Flash + InDesign... A perfect match..

| No Comments | No TrackBacks
Well, one feature that I have found to be amazing in InDesign is the Export to SWF. We have used this for a variety of applications, and I use it for school. So, when we have to present a printed piece to our class, I always use InDesign to SWF to generate something to put on the projector. 

When trying to rotate it for a calendar, though, that turned out to be a nightmare. you can't do it in flash, or inDesign, or Flex Builder, or Acrobat. Well, at least not easily. We had to, in order to rotate it, somehow change the rotation center of the Swf, which turned out to be a total nightmare. 

All in all, though, it's pretty cool.

Problems with DNS...

| No Comments | No TrackBacks
Over the past few days, we have been having trouble with our DNS service for our website. All of you who tried to view my site and couldn't, I'm sorry. As it turns out, Register.com, our Domain Provider, was recently attacked and our account got hacked. So, none of the websites that we host existed, as far as the DNS was concerned. We didn't know this until Register.com sent us a letter letting us know. We thought that it was a problem with Time Warner DNS, so we switched to OpenDNS. That worked, but it still glitched throughout today. Again, I'm srry for any inconvenience. 

If your account on Register.com got hacked too, I feel your pain.

Weekly LOL

| No Comments | No TrackBacks
Here it is, or should I say, Heer it iz! Teh Weekleh Lol!funny-pictures-cat-pouts-and-wants-more-fish.jpg

I've been thinking....

| No Comments | No TrackBacks
Well, since Catalyst does basically the same thing as Fireworks, change documents into a kind of WebApp, then why does catalyst have to be it's own application? I think that it would be a good use of time and money to combine Catalyst with another application, like Flash or Flex Builder. That would make sense to me.

Just a thought.

Twitter

Follow arthurlockman on Twitter

Pages

Powered by Movable Type 5.01

About this Archive

This page is an archive of entries from April 2009 listed from newest to oldest.

March 2009 is the previous archive.

May 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.