a Tuesday feature

by William Hurley

A Look at Some of the Macromedia Code and an Update on our New Transition

November 12

This week I discuss some of the code Macromedia supplies in the Director 5.0 XDK. For those of you who have programmed in C or some derivative of C, this will be very straitforward. If you do not have any C programming experience, don't panic. All will be revealed in time.

Some Questions about the Macromedia code

Let's start by answering a few questions some of you have asked me about the code supplied by Macromedia.

Where do you get the code for creating Xtras?

This comes from the Macromedia site. They have done an excellent job of supplying almost all the materials needed to create your own custom Xtras--sorry, creativity not included; innovation sold separately. You can download the Xtras XDK files from the Macromedia website.

Will I be able to obtain the code for the internet.com Xtra?

Yes! As we progress through this series of columns, we will make all the code available so that you can compile a version of the Xtra we are creating yourself.

Do I have to know C to create an Xtra?

Well, in a word yes. Macromedia's information is great, but I'm not one to suggest that you could just hack an Xtra together. A solid understanding of C and programming is going to be needed when creating Xtras. If you want to get an idea of what the code looks like, just check out the section below.

A Look at Some of the Macromedia Code

We really aren't going to talk about too much here. The main idea is to expose those of you who have not programmed before to what some of the code looks like. In response to the requests I've received from readers asking if I could supply some code so that they could get an idea for what it looks like, I present the following code.


/***************************************************************************
**
* Copyright (c) 1994-1996 Macromedia, Inc. All Rights Reserved
*
* You may utilize this source file to create and compile object code for use
* within products you create. THIS CODE IS PROVIDED "AS IS", WITHOUT
* WARRANTY OF ANY KIND, AND MACROMEDIA DISCLAIMS ALL IMPLIED WARRANTIES
* INCLUDING, BUT NOT LIMITED TO, MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT WILL MACROMEDIA BE LIABLE TO YOU
* FOR ANY CONSEQUENTIAL, INDIRECT OR INCIDENTAL DAMAGES ARISING OUT OF YOUR
* USE OR INABILITY TO USE THIS CODE.
*
* Name: strchxtra.c
*
* Purpose: Initialization code for the stretch transition xtra.
*
* History:
*
* 18dec95 dac Recreated.
* 1Jan96 ji Updated to current XDK, recreated as standalone sprite template
* 29Feb96 trp Modified for use in new template project scheme.
*
*
*************************************************************************** */

#include "regglue.h" /* glue file defining the registration class */
#include "initglue.h" /* glue file defining the initialization class */
#include "asstglue.h" /* glue file defining the asset class */
#include "trctglue.h" /* glue file defining the transition actor class */

#include "classdef.h"

#include PROJECT_IMP_H

#if defined( MACINTOSH ) && defined( __MWERKS__ ) && !defined( powerc )
#endif /* MACINTOSH && MWERKS && !powerc */


/*************************************************************************** **
* BEGIN_XTRA/END_XTRA
*
* These macros provide the main() entry point for your macro. This code is
* similar for all Xtras. Between BEGIN_XTRA and END_XTRA, define each class,
* and each interface of each class, provided by your Xtra.
*************************************************************************** */

BEGIN_XTRA
END_XTRA

#if defined( MACINTOSH ) && defined( __MWERKS__ ) && !defined( powerc )
#endif /* MACINTOSH && MWERKS && !powerc */


An Update on Our New Transition

Our new transition is coming along just fine. I want to keep some of it a surprise, but I think each one of you will enjoy it. We will start looking at the code for our transition next week (baring any unforeseen problems). Stay tuned.

Past installments of Simply Shocking

http://www.internet.com/