Loading and Manipulating FlashPaper 2.0 SWFs into Flash

This tutorial demonstrates how to load and manipulate (resize in this example, but once you have access to the API you can do a whole lot of other things) FlashPaper 2.0 SWF files with ActionScript 2.0.

You will need:

  • Flash MX 2004 or Flash 8
  • FlashPaper 2.0

Click here to see the example in action.
Click on the attachment to download sample files.
In this example, we will simply load a FlashPaper 2.0 document and scale it to fit the size of our Flash Movie.

Here’s an article about using FlashPaper documents.
For more details see the documentation on the FlashPaper API.

Add the following code to the first frame of your movie.

// Creating the MovieClip into which we’ll load our Flash Paper document.
this.createEmptyMovieClip( "testMovie_mc", this.getNextHighestDepth() );

// callback functions for this clip
var mcObjListener = new Object();
mcObjListener.onLoadComplete = function(){
    testMovie_mc._visible = false;
}
mcObjListener.onLoadInit = function( arg_target:MovieClip ):Void{
    trace( "running the onLoadInit callback" );
    trace( "arg_target = " + arg_target );
   
    // We’ll have to wait until the first page of the flash paper document has loaded
    // before we have access to the FlashPaper API
    // To do so, we’ll set up an interval that will check for it’s existence.
    // Then run the setSize method
    var var_intervalID = 0;
   
    // Our check function
    function checkFlashPaperLoaded(){
        // Hide the holder clip until it is loaded
        // eval( arg_target )._visible = false;
       
        // Getting a reference to our FlashPaper object
        var var_flashPaperObj = eval( arg_target ).getIFlashPaper();
        trace( "var_flashPaperObj = " + var_flashPaperObj );
       
        if( !var_flashPaperObj ){
            return;
        }
        else{
            trace( "We now have access to our FlashPaper API" );
            clearInterval( var_intervalID );
           
            // Resize the doc
            var_flashPaperObj.setSize( 800, 600 );
           
            // Show it
            eval( arg_target )._visible = true;
        }
    }
    var_intervalID = setInterval(checkFlashPaperLoaded, 100);
};

// Here we create a new MovieClipLoader Object
var var_movieClipLoader = new MovieClipLoader();
           
// Here we add the listener to our new MovieClipLoader Object
var_movieClipLoader.addListener( mcObjListener );
       
// Now we use our new MovieClipLoader object to load the swf into the movieclip holder
var_movieClipLoader.loadClip( "build.it.and.then.tell.them.swf", "testMovie_mc" );

Make sure you have a FlashPaper 2.0 SWF of the appropriate name in the same directory and compile to see you document in Flash.

Remember that the FlashPlayer security settings will not allow you to view this example in a browser locally.  To see it in a browser, publish a .html file with it and post to your webserver.

Using Michael Jordan’s Open Source Captioned Skins for the FLVPlayback Component in AS 2.0

Following is a quick tutorial on how to set-up and use the set of captioned FLVPlayback skins created by Michael Jordan.

This tutorial covers using the skins with ActionScript 2.0 cuepoints.

First off, download the set of skins.  I’ve included them with this blog entry (because Adobe is notorious for moving and deleting pages), but there may be a newer version out there so check out this page, and/or Michael’s page.

Once you’ve downloaded and installed the skins fire up Flash and open a new document.

Import your .flv video and place an instance on the stage.

Name your FLVPlayer instance flvInstance.

In the Component Inspector set your skin to one of the Captioned skins you just installed.

Add the following code to the first frame of your movie, or add it to an .as file and include it into your .fla file.

// —————————————————————————-

/*
Defining cue points
We must define an ActionScript cuePoint object and a parameters object that contains the caption content
*/

// Example of a cuepoint that includes a speaker indicator:
var var_cuePoint_00_content:Object = { en: "Here we define our first cuepoint.", spk: "Ryan" };
// Now we define our time, the name of the cueoint and add the aforementioned object as the cuepoint’s parameters
var var_cuePoint_00:Object = { time: 2.05, name: "caption", type: "actionscript", parameters: var_cuePoint_00_content };

// Example of item without a speaker:
var var_cuePoint_01_content:Object = { en: "Here is the second cuepoint" };
var var_cuePoint_01:Object = { time: 4.05, name: "caption", type: "actionscript", parameters: var_cuePoint_01_content };

// Adding our cue points to our FLVPlayer instance
flvInstance.addASCuePoint( var_cuePoint_00 );
flvInstance.addASCuePoint( var_cuePoint_01 );

// Adding a listener for our FLVPlayback instance so you can see what’s going
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object) {
    trace( "Elapsed time in seconds: " + flvInstance.playheadTime + "\n" );
    for( var prop:String in eventObject ){
        trace( "Property  [" + prop + "] = " + eventObject[prop] );
        if( prop == "info" ){
            trace( "the info property" );
           
            for( var infoProp:String in eventObject[prop] ){
                trace( "Property [" + infoProp + "] = " + eventObject[prop][infoProp] );
            }
        }
    }
};
flvInstance.addEventListener("cuePoint",listenerObject);

// —————————————————————————-

Compile your .swf, click on the "CC" button, play your FLV and you should see your captions as your video plays

Setting Up an IIS Webserver under Windows XP Pro

I recently had a client who was hosting a site on IIS under Windows XP Pro using .NET and ASP.

As a result, I needed to set up an appropriate development environment to test and debug the site before handing it over.

I opted for setting up VMware install that was running the necessary OS and software.

Following is a quick how-to on setting it all up.

Installing IIS 5.1 and .NET 2.0 on Windows XP Pro:

  1. Go to Add/Remove programs
  2. Put the WinXP Pro install CD in the machine
  3. Click on Add/Remove Windows Components and click on the check box next to Internet Information Services (IIS)
  4. After installation you should be able to open up a browser and type "localhost" and get the default welcome page.
  5. If you get either a "You are not authorized to view this page" or a user name and password prompt, make sure that the user account with which you are currently logged in has administrator rights and that you have a password set for that account.
  6. Install .NET
  7. Register .NET with IIS
    1. Open a command prompt window, change dir to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 (or whatever other version you are registering)
    2. Run the following commands in sequence:
      1. aspnet_regiis -i
      2. aspnet_regiis -s W3SVC/
  8. Make sure to include the .aspx extension on your files and you should be all set to start developing .NET applications.
  9. To enable other machines to connect to your new webserver go to Control Panel/Security Center/ and click on "Windows Firewall" under Manage Security settings for:
    1. Go to the Advanced Tab
    2. Click on the "Settings" button next to the "Network Connection Settings" and click on the check box next to "Web Server (HTTP)".

Your Most Popular Entry Page and Its Impact on Layout and Design

Knowing your most popular entry point helps you determine the kind of content that is driving traffic to your site.  This in turn helps you determine what kind of changes and additional content you should add to your site to help boost your success.  There are a number of different tracking and reporting packages that can answer this question.  NBI provides a hosted tracking solution called goalTracker which enables you to answer that and many other questions about your website traffic.  However, regardless of whether or not you know what your most popular entry page is, there are still a number of things you can, and should, do to your site to help increase its effectiveness.

As I mentioned, more often than not, the most popular entry page on your site is not the home page.  Search engines categorize and provide links to every single page on your site.  People will post links to various pages in forums and send links to their colleagues in e-mail.  As a result, your ENTIRE WEBSITE should be geared towards being an entry point for a new visitor.

That might sound like a tall order but there are a few simple things that you can do with your site to make sure that every page provides the necessary information to your new website visitors.  Add the following to each page on your site:

  • Include your logo and a tagline:  Answer the question who are you and what do you do?  Make sure to have your logo (or some other indication of your business?s name) and a tagline prominent on each page.  Some sites have web pages that include pop-up pages, or pages that are only supposed to be viewed from another page on the site that don?t include the basic information about the company.  Someone might start their visit on that page, and if they can?t quickly figure out who you are and what you do for them, you may lose out on a new prospect.
  • Include links to pages that are valuable to your visitors:  What information are they most likely looking for or is of value to them?  One of the most important things you can do is to make your site a resource for people who might be looking for your products or services (see this article: “Write Your Website Content with Your Visitor In Mind” for more info).  Do you have a Free Resources section?  A Blog?  List of Articles or other content for your visitors?  If so, make sure there is a prominent link to that section on each and every page.
  • Include a top and/or side navigational bar:  What are the most important pages on your site?  Include them in some sort of prominent navigation that is on every page.  In many cases that navigation will include something like: Home, About Us, Services, Products, Free Resources, Contact Us.  This makes it easy for someone to quickly see what you have to offer and to easily get around on your site.
  • Conspicuous Specials, Features, or other important links:  If you have a specials page, or an important upcoming event, make sure to include a link.
  • Include a Footer:  A footer is content that appears at the bottom of each page on your site.  In many cases you will want to include the following information.
    • The geographic area that you serve
    • Your phone number
    • Your address
  • Avoid frames: If your site is designed in frames consider a re-design.  A frames based website displays a number of different independent web pages on a single screen.  This is fine as long as someone started their journey on the appropriate web page, but many times a search engine will categorize and provide a link to one of those pages and that page will not have any navigation, logo, tagline, or other information to give the visitor somewhere else to go.

Once you make these changes to your site every page will be a great entry page.

Most people assume that a visit to their website begins on their home page. The reality is that most website visits begin on other pages on the site and that those pages are not effective entry pages.

Do you know what your most popular entry page is?

Does the layout and design of your site enable those who enter any page to easily find out more about you and your offerings without leaving in frustration?

Regardless of whether you can answer the first question, there are a number of things that you can do to your site that will help you make the most out of your traffic no matter what page people use as an entry point.
Knowing your most popular entry point helps you determine the kind of content that is driving traffic to your site. This in turn helps you determine what kind of changes and additional content you should add to your site to help boost your success. There are a number of different tracking and reporting packages that can answer this question. NBI provides a hosted tracking solution called goalTracker which enables you to answer that and many other questions about your website traffic. However, regardless of whether or not you know what your most popular entry page is, there are still a number of things you can, and should, do to your site to help increase its effectiveness.

As I mentioned, more often than not, the most popular entry page on your site is not the home page. Search engines categorize and provide links to every single page on your site. People will post links to various pages in forums and send links to their colleagues in e-mail. As a result, your ENTIRE WEBSITE should be geared towards being an entry point for a new visitor.

That might sound like a tall order but there are a few simple things that you can do with your site to make sure that every page provides the necessary information to your new website visitors. Add the following to each page on your site:

  • Include your logo and a tagline: Answer the question who are you and what do you do? Make sure to have your logo (or some other indication of your business name) and a tagline prominent on each page. Some sites have web pages that include pop-up pages, or pages that are only supposed to be viewed from another page on the site that dont include the basic information about the company. Someone might start their visit on that page, and if they cant quickly figure out who you are and what you do for them, you may lose out on a new prospect.
  • Include links to pages that are valuable to your visitors:? What information are they most likely looking for or is of value to them? One of the most important things you can do is to make your site a resource for people who might be looking for your products or services (see this article: “Write Your Website Content with Your Visitor In Mind” for more info). Do you have a Free Resources section? A Blog? List of Articles or other content for your visitors? If so, make sure there is a prominent link to that section on each and every page.
  • Include a top and/or side navigational bar:? What are the most important pages on your site? Include them in some sort of prominent navigation that is on every page. In many cases that navigation will include something like: Home, About Us, Services, Products, Free Resources, Contact Us. This makes it easy for someone to quickly see what you have to offer and to easily get around on your site.
  • Conspicuous Specials, Features, or other important links:? If you have a specials page, or an important upcoming event, make sure to include a link.
  • Include a Footer: A footer is content that appears at the bottom of each page on your site. In many cases you will want to include the following information.
    • The geographic area that you serve
    • Your phone number
    • Your address?
  • Avoid frames: If your site is designed in frames consider a re-design. A frames based website displays a number of different independent web pages on a single screen. This is fine as long as someone started their journey on the appropriate web page, but many times a search engine will categorize and provide a link to one of those pages and that page will not have any navigation, logo, tagline, or other information to give the visitor somewhere else to go.

Once you make these changes to your site every page will be a great entry page.