May 3, 2002   Tip of the Week Mailing List
The Tip

I don't know about you, but I find it very frustrating that Macromedia seems to have decided that Keypress interactions can't be perpetual. Fortunately, there is a way to have a perpetual keypress.

You probably already know that you can use a button or hot spot hidden off screen and set the Key(s) field to the key that you want to use. But did you realize that perpetual hot object responses do not have to have an object.

This means that you can use them to create perpetual kepresses without having to move a button or hotspot off screen.

 
What is PostUrl()

Like most Authorware developers, I found the distinction between ReadURL() and PostURL() to be a little fuzzy until I started doing more straight HTML work.

If you look at the FAQ page of my site, you will find the form where you signed up for this list. If you view the source of that page, you will find the line <FORM action="http://pub45.bravenet.com/elist/add.php" method="post">. This is the opening tag of a form.

What it tells the browser is that when the form is submitted, send the contents of the form directly to "add.php." When the php page gets this information, it is in no way visible to the user (in other words, it does not show up in the URL).

What are the contents of the form, then? Between the Form open and close tags, you will see several lines that look something like this <input type="text" name="ename" size="25" maxlength="60"/> . This tag means that the php page will receive the contents of that text field as a variable called ename.

In the php page, this value will be contained in $HTTP_POST_VARS['ename']. In the more familiar asp, that would be Request.Form("ename"). The php page then communicates with the database and adds the new user to the mailing list.

When you use PostURL(), Authorware is basically pretending to be an HTML form with a post method. The back-end page (asp, php, cfml, cgi, or whatever) does not know or care how that information was sent.

If you need information back from the database, the back-end page will need to send a response. In PHP, this looks like <?php print $QueryResults; ?>. In ASP, it would be Response.Write QueryResults.

So, what all this means is that when you use Myvar := PostURL("http://www.myserver.com/myfile.asp", "username="^UserName, 20), what you are saying is send UserName to the asp page as if it came from a form field called "username" and wait for 20 seconds to see if the asp page has any feedback based on UserName. If there is, put that feedback in MyVar. Depending on what the asp page is designed to do, this can be "ok", a list of previous results for this user in this course, or his address.

So what about ReadURL()? ReadURL cannot communicate directly with the back-end page, so you must add anything you want to tell the page to the end of the URL. This is equivalent to a "get" form method. So you would use Myvar := ReadURL("http://www.myserver.com/myfile.asp?username="^UserName, 20). However, you cannot expect that the page will react identically to the two statements. This is because the value of username can't be read from the same place at the back-end page. In php, this will be $HTTP_GET_VARS['username'], while in asp this would be Request.QueryString("username"). For more information on php, try PHP from the Ground Up. For more on asp, look at Your First Database.

 

Next Scheduled Chat is Saturday, May 4th

The Future of Authorware

The chat will beSaturday, May 4. The chat will start at 1:00 pm CDT. For the rest of the world, that is 6 hours earlier than current UK time and 5 hours earlier than GMT. In the US this is 2:00 pm Eastern, noon mountain, and 11 am pacific. Expect the chat to last around two hours.

Our special guests are Chris Swenson of Dazzletech and the Authorware Advisory Council and Mike Baker from the Authorware Engineering team. Be sure to come by and contribute your input for the next release of Authorware.

To get to the chat room, go to my website. Click the CHAT button at the top of the page, just under the logo.

 

Blog

In a previous newsletter, I told the story of my cats and their reaction to large quantities of catnip. I thought you might like to meet them.

This is Jake, the older of my two cats. Just because she is 7 does not mean that she does not run and play with the best of them (though you would not know it to look at her waistline). Don't let the name fool you. She is a girl!


Quick Links

Links to other Authorware sites at Authorware.com

Goodies and toys from Stefan van As and others: Authorware Extensions



  http://www.Authorware-Amy.com