Premium Content


Premium Content articles are the very best articles from the world's leading internet technology, subject-matter experts. We have many categories of content below on a wide variety of subjects that have all been commissioned from big name authors.

Explore the Premium Content

Validating and Submitting Flash Forms

Today we write our own ActionScript function to validate our Flash form. We see how the Flash form components have methods that we can use to access the values of the form components, be they combo boxes, list boxes, check boxes or simple text inputs.

In order to make our validation meaningful and complete, we clean up the form input by stripping leading and trailing white space from the input, as well as performing some basic testing to see if an email address is in the correct format. Because these functions are not native to ActionScript, we import them from external sources.

For people that filled the form in incorrectly, we build a dialog that displays the problems with the person's data entry. Once the data is validated, we build some root variables that contained the valid data and then send the information to a PHP script.

This is suitable for intermediate Flash developers, as it builds upon two previous beginner's tutorials, but reading those is not necessary, and the .FLA files are provided for download.

Read More

Creating a Dynamic News Feed in PHP

In this article we look at how to create a dynamic news feed. By delivering the content of the feed as JavaScript, it can be incorporated easily into any site, as the feed is gathered by the user's browser and so does not need any special software on the host's server.

We then look at reading records from a MySQL database, putting the results in an array so that the data can be worked with easily later on in our code. We create a custom function to display a number of characters from a string, without splitting the string in the middle of a word. By making the number of characters to display a parameter of the function, we made it general- purpose, so that it can be used easily on other sites to save time in the future. We then look at displaying the news data using JavaScript.

Finally, we create a page that read a parameter from the pages URL, and uses it to select a record from the database, and we display this data on the page, so that a visitor can read the whole of their selected news item.

Read More

Saving time with Photoshop masks

Clients can be irritating. Especially when they change their minds about things. In this article we'll learn to work around this. What we're aiming for here is saving time. We're going to look at techniques to minimize redoing design work, by taking a close look at masks and how they can work for you. We'll also go through the production cycle of a design, and how to develop it so that any image that has been used can quickly be replaced by another - without having to redo all the effects you've used on it.

Read More

Templates, Library Items and Includes

Templates are useful for maintaining a consistent layout of the website as well as providing a method of locking areas from user editing with Macromedia Contribute. Once you've mastered Dreamweaver Templates, you will learn that Templates are your friend. They will allow you to create consistent websites with ease and save development time once the template is created and fully functional.

This tutorial summarizes the differences between Templates, Library items and Server-side Includes. Delving into the definition, description of use and sample markup. Once this tutorial is mastered, you will understand better about the various discussed technologies, and which can be used together when developing your website.

Read More

Dynamic Form Data

Last week we learned how we could build a form in Flash using the built-in components that Flash provides. The main problem we had with the form was that the form components that provided selections had their values hard coded within the Flash MX editor.

In most situations this isn't a big problem, but in the case of our Country combo box, 200+ countries is too many to type in. Or what about a drop-down menu of products, when the product list changes daily? Today we'll look at how we can make the form more dynamic. To do this we'll look at some of the ActionScript methods that we have for altering the form components, and how we can grab the data for them from a PHP script.

This is article 2 in a series of 3:

1: Flash Forms

Creating basic form elements in Flash

2: Dynamic Form Data

Populating form elements in Flash from a dynamic source.

The database is MySQL and the populating scripts are built in PHP.

3: Form Submission

Covers Flash form validation using ActionScript and submitting the data to a server.

The form submission script is written in PHP and submits the data to a MySQL server

For those of you who didn't read last week's article, the Flash MX movie form_base.fla is available for download that contains the results of following the previous tutorial.

Read More

Popup Windows: Doing Them Right

Ah, the dreaded popup window, enemy of the free world! Thanks to loads of unscrupulous uses of the popup, many people feel exactly that way about such intrusive windows. There are some who say a popup window should never be used, and some that would use a popup for seemingly everything. The truth is that somewhere in the middle is where the truth lies.

There are legitimate reasons for using popups, only you know your business imperatives. Thos tutorial teaches the right way to handle opening new windows. JavaScript can be somewhat picky about how you bring a new window into being, and not doing things exactly right can leave you pulling out your hair.

Read More

Accessible Tables for data

With all the talk about "table-less web design" and CSS layouts you might be forgiven for thinking that the HTML table is well and truly dead, never to be used again by any reputable web designer. However, this is not the case. While tables for layout are to be avoided if at all possible in the interests of accessibility and forwards-compatibility, tables can and should still be used for their original purpose - that is to display tabular data.

In this self-contained tutorial we will look at how to create accessible tables that comply with the recommendations of the W3C, we will also learn how to use CSS to make our accessible tables look attractive and easy to read in a web browser.

Read More

Grabbing an RSS Feed with PHP

A great way to add content to your site is use syndicated content from blogs, news sites etc with RSS which is Rich Site Summary (some would say Really Simple Syndication, or RDF Site Summary), and is a format used by a variety of sites for content syndication.

This tutorial uses PHP to grab the feed and incorporate it into our site. As it stands we can't do this in Dreamweaver, so we'll make a PHP script and then turn it into an extension so that you can re-use it on other pages. The PHP requires some existing understanding to make sense of, so this tutorial will be hardwork (but not impossible) for PHP newbies.

Read More

CSS Design: Creating a Two-Column Layout

If one column CSS layout design was simply too simple, try a two column layout! You'll not only learn how to create an easily modified 2 column layout, but you'll also get the skinny on working around Box Model problems by modifying DOCTYPEs and employing the infamous "Box Model Hack." You'll also learn how to separate your layout styles from your general styles, allowing you to employ the @import trick, which provides a usable alternative for those using Netscape 4 or without CSS support.

All the files are provided for download, so you can experiment to your heart's content

Read More

Flash Forms

Today's article is the first in a series that covers building and using Flash forms. Flash forms are generally much more attractively designed than html forms because of the control you have over fonts etc in Flash. We will be covering from how to build the form to populating it with dynamic data, posting our results to a database and handling the response from our submission. Today we begin by looking at the elements that Flash provides for building forms and how they are used.

The sample FLA file is included for download so you can experiment with it or adapt it to your own needs.

Read More

Working with Session Variables in PHP

In this tutorial, we look at using Session Variables in PHP, to store user information as a user moves backwards and forwards through the pages of a website. This allows information to be tied to a user, linking them to records in a database to create a shopping cart (for example). Session Variables are also commonly used for security systems, so that once a user has logged in their status is held in a Session Variable.

The first section that we examine is how Session Variables work, and how to enable them in PHP if they're not already enabled. We then look at how to store a value in a Session Variable, and how to avoid the common "Headers already sent" error that can occur, and how it can be stopped permanently by using Output Buffering.

We then look at how to read back a Session Variable and how to check whether a Session has been set or not. Finally, we look at when to use Session Variables and when to use Cookies, and how to destroy a Session Variable.

Read More

Colour Theory and Management in Photoshop

In this tutorial we look at colour. Perhaps one of the most important yet overlooked aspects of websites is the use of colour. If you're serious about creating a website and developing graphics that will be suitable, the best place to start is to take a look at the starting places of all images: perception.

Once you understand the way that colours are perceived and made, we look at the different methods of colour management in Photoshop, which to use when and the pros and cons of each.

Read More
Newer articles Older articles