VB6 Code for Openning an External File

The following VB6 code will open an external file with it’s associated application.  This assumes that there is an application on the system that is already associated with a specific executable.
Under your General Declarations:

‘ Runs an external file/launches it’s associated app
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

On whatever Form/Button/Event

Dim FileName As String
FileName = "C:\path\to\some\file.pdf"
ShellExecute 0&, "open", FileName, "", "", vbNormalFocus

Creating MovieClips with Button States in AS 2.0

Here is a quick tutorial on how to create MovieClips that act like buttons using ActionScript 2.0.  Attached is a sample .fla file with a complete, working example.

  1. Create a new Flash document for AS 2.0
  2. Create whatever graphic/shape that you would like and convert it to a symbol.  Double click on on it with the selection tool, and then press F8 to open the create symbol dialog box, or right click on it and select "Create Symbol".  Make sure that you create it as a MovieClip.
  3. Double-click on the new MovieClip to enter the symbol edit mode.
  4. Rename the existing "Layer 1" layer that contains the base graphic "bg".
  5. Create three new layers above that one in this order:
    1. labels
    2. actions
    3. text
  6. On the labels layer:
    1. Create a keyframe at frame 10, 20, and 30
    2. In frame 1, enter the following label: _up
    3. In frame 10, enter the following label: _over
    4. In frame 20, enter the following lable: _down
  7. On the actions layer create a keyframe at frame 10, 20, and 30 and put a stop(); action in frame 1, 10, and 20.
  8. On the text layer, create a keyframe at frame 10 and 20.
    1. Add the following text to each keyframe:
      1. Frame 1: Steady State
      2. Frame 10: Over
      3. Frame 20: Down
  9. Go back to your main timeline, by clicking on the "Scene 1" button.
  10. Select your MovieClip and give it an instance name of button_mc.
  11. Create a new layer in the main timeline and name it actions
  12. Add the following actions to it:
    1. button_mc.onRelease = function(){
          trace( "Click" );
      }
  13. Test your movie and when you rollover and click on the clip you will see the different states displayed.

Doing a Little Something to your Site is Better than Doing Nothing

Recently, I have gotten back into roadracing motorcycles after a 7 year hiatus (here are some photos that Yermo took this past weekend, 2008-09-20).  Before the weekend, I had to get some minor repairs done to my leathers.  I called and talked to Connie at Vanson (the company that made the leathers) and they asked me the last time that I’d given them a cleaning.  I had to admit that it had been quite a long time.  A full-on “proper” cleaning is moderately involved and can take some time, of which most racers don’t have a lot of.  Connie said that a quick and easy thing to do was to hit them with any furniture polish and a soft rag.  She went on to say that because it was so quick and easy to do that the benefit of the quick cleaning a few times a season was far better than doing nothing at all.

That got me thinking about small businesses and websites, and that the same axiom applies.  You are far better coming up with a strategy to make regular, even minor, updates to your site than doing nothing at all.
As I have mentioned in previous articles, your website should become a valuable resource to people who are looking for information about your product or service.

The best way to further that goal is to just fill it with content.  Unfortunately, most small businesses that I know just don’t have the time to spend weeks or months when they redesign, or redevelop their site to write content.  Moreover, many of them do not have their website set up with a CMS (Content Management System) that enables them to easily make updates and changes without having to know how to write HTML/CSS/server-side code, navigate FTP programs, and get everything working properly with their hosting environment.  The typical result is that because it is so time consuming that the website is never updated.

The solution:  get your small business website set-up so that you can use one of the many CMSs out there and come up with a plan whereby you can set aside 20 – 30 minutes a couple of times a month to add a few things to your site.  Like cleaning my leathers with furniture polish vs. the full-on “proper” cleaning, it’s far better than doing nothing at all.

In the case of your website, it will continue to grow on a regular incremental basis that fits into your schedule and will hopefully increase your search engine ranking, your relevant traffic, and ultimately your bottom line.

— Ryan Chapin
President, Nuts & Bolts Interactive, Inc.

An Open Letter to MoveOn.org

I am just as much progressive as everyone of the hard-working people at MoveOn.org and am doing what I can to help elect Obama.

However, I think that MoveOn might make a bigger impact if you learned from the masters, and by that I mean the Republicans.

I’ve seen a number of recent e-mails lamenting the horrible ads and slander of the McCain campaign that beg the membership to donate so that the truth can be told.

With all due respect, you guys just don’t get it.  It is much easier to sew doubt that convince someone of something.  As a result, your efforts would be much better spent generating media that generated doubt about him.

Something like this video ad:

Sinister, or perhaps old-timey music fades in (I’d have to think about the music some more)

McCain video with him saying that the economy is sound and strong, with date in bottom – left.

fade to:

McCain video that shows him admitting he doesn’t understand the economy, dated

fade to:

Stuttering video of him being clueless about how many houses he owns, dated

fade to:

Video of him saying that the economy is having a hard time, dated

fade to some horrible press photo of him looking clueless on one side, with a montage of people who are bumming that fade in and fade out on the other side.

Voice-Over:

Does McCain really have a handle on the economy?  Can a man who doesn’t even know how many houses he ownes have any idea of what you are experiencing in these troubled times?  Do we want to give the Republicans four more years?

Voila!  Doubt!  Not lies, just using the rich fodder that McCain has practically given us on a silver platter.

Unfortunately, we live in an era where truth and issues have been replaced with spin and attack ads, and if we (meaning all progressives) don’t catch a clue fast, we are going to lose yet another election (and we can kiss the supreme court goodbye).

When I was a little boy, I got beat up on the playground at school almost everday.  I tried talking to the bullies, tried hiding from the bullies, tried everything I could.  I didn’t get left alone until I broke one of there noses.  Know why?  Because that’s all they understood.  It wasn’t their fault, I didn’t want to do it, but they gave me no choice.

The progressive movement in this country is in the same position.  If we don’t take the gloves off and start bloodying some noses, we are all sunk.

How to Reorganize Your Website Without Reducing Your Traffic


Nobody keeps the same website forever.
  Websites get redesigned and on a regular basis.  Websites also need their content updated or reorganized to keep up with a growing business or organization.

When you change the structure of your site (move pages, rename them, or delete them altogether) you could be losing valuable traffic and costing your business or organization signups, purchases, or more.

One of the primary ways that a site generates traffic is from people clicking on links to it
from search engines, other websites, or e-mails.  The search engine part is obvious.  Links from other sites could come from your website being listed on someone else’s site, or links posted on blogs and forums.  Links in e-mails are simply that, a link to some page on your site, sent to someone in a e-mail.

A link is simply the address, or URL (Uniform Resource Locator), of a given page or website.  In this case we are talking about links to specific pages on your site.

The reason why rearranging the structure of your site could cost you traffic is because there are very likely many different links to specific pages on your site posted on other websites.  Moreover, all of the search engines have those specific pages categorized in their databases.

For example: let’s say that your about us page’s URL is http://somedomain.com/about.htm and during a redesign it is changed to http://somedomain.com/company/about_us.html to make it a sub-page of a new "Company" page.  Now that you’ve made that change, all of those links to http://somedomain.com/about.htm on other sites, search engines, and e-mail no longer work.  Visitors will get a 404 (file not found) error, and you will likely lose any search engine ranking that you had with the content on that page.

This can cost you big time!

That’s not to say that you can’t reorganize and revamp the structure of your site, you just have to do so intelligently.

There are two ways to go about it:

  1. Leave any existing URLs alone and just add new content to those pages.
  2. Set up redirects for the old URLs to the new ones so that when someone tries to access an "old" link, they are redirected to the new page, and so that the search engines know to update the entry for that specific page without losing your search engine ranking.

So, when you decide to do some clean-up and re-organizing on your site, just make sure you take a few minutes to note the existing URLs of your pages so you can set up any redirects and this will keep you from losing valuable traffic to your site.

Ryan Chapin
President, Nuts & Bolts Interactive, Inc.

Creating a Mac/PC Hybrid CD-Rom with Roxio Toast

The following is a quick tutorial on how to create a hybrid CD under Mac OS X.
Using Toast, you can fairly easily create a hybrid CD with which the Mac OS will only see Mac specific files and the PC OS will only see the PC specific files.  This preserves the Mac resource fork and icon data as well as the PC icon data.

  1. Create a disk image into which you will place all of your Mac OS files.
    1. Open up the Disk Utility program in Applications/Utilities/Disk Utility.
    2. Click on the "New Image" button in the top bar of the Disk Utility window.
    3. Determine the size of your disk image and create it, making sure it has read/write permissions.
  2. Mount the new disk image and copy any Mac data onto it.  Leave the image mounted.
  3. Fire up Toast
  4. In the left-hand sidebar, click on the "Advanced" button.
  5. Click on the "Custom Hybrid" radio button.  The main Toast window will now display two buttons "Select Mac…" and "Select ISO.."
  6. To add Mac files:
    1. Click on the "Select Mac…" button.
    2. Choose the newly created disk image/Mac volume that you created and into which you copied your Mac files.
  7. To add PC files:
    1. Click on the "Select PC…" button
    2. An "ISO 9660" dialogue box will appear.
    3. Click on the "Files" button and then drag and drop your PC files into this window.
    4. To specify the name of the PC cd as it will appear, double-click on the text to the right of the CD graphic/icon (the default should be My CD).  Enter any new text and hit enter.
  8. Unmount/Eject your Mac data volume before burning.
  9. Burn CD, smile, do victory dance.  🙂

Using FlashPaper .swf files in ActionScript 2.0

Macromedia Studio 8 shipped with Macromedia FlashPaper 2.0, a pretty cool app that will take PDF and other documents and convert them into .swf files that you can load into other flash/swf applications.

The following is a quick tutorial on how to load FlashPaper swf files into Flash applications in ActionScript 2.0.

This tutorial assumes that you know the basics of FlashPaper 2.0 and have a usable FlashPaper .swf file.

Essentially, you will include an ActionScript file that will provide the functions to allow you to load in and scale the FlashPaper .swf and then include a few configurations and lines of code to load in the FlashPaper .swf.

First, create a new ActionScript file, save as "flashpaper.loader.as" and copy and paste the following code into it:


function loadFlashPaperSWF( arg_flashPaper_conf:Object ):Void{
    trace( "\nFrom loadFlashPaperSWF" );
    trace( "arg_flashPaper_conf.flashPaper_SWF " + arg_flashPaper_conf.flashPaper_SWF );
    // 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 to fit the size of the stage
                var_flashPaperObj.setSize( arg_flashPaper_conf.flashPaper_width,
                                          arg_flashPaper_conf.flashPaper_height );
               
                // Setting the document to fit to height:
                // var_flashPaperObj.setCurrentZoom( "page" );
               
                // 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( arg_flashPaper_conf.flashPaper_SWF, "testMovie_mc" );

}


Then, create a new Flash file (ActionScript 2.0) and add the following to the first frame of the timeline:


#include "flashpaper.loader.as"

// ============================================================================
// Configurations:
//
// Our config object
var obj_flashPaper_conf:Object = new Object();

// The flash paper swf to load:
obj_flashPaper_conf.flashPaper_SWF = "files/flashpaper_docs/flashpaper.swf";

// The width and height of our flashpaper doc
obj_flashPaper_conf.flashPaper_width = 650;
obj_flashPaper_conf.flashPaper_height = 320;

// ============================================================================

// Loading our Flash Paper SWF
loadFlashPaperSWF( obj_flashPaper_conf );


Edit the configurations to specify the location of the FlashPaper .swf and the size that you want it to be displayed and you are good to go.

The Nuts and Bolts of Domain Name Ownership

That’s not to say that the proper care and feeding of a domain is overly complex. But before we get into the those details let’s go over some core domain related terminology:

  • IP Address:  A unique numerical address for a server that hosts any Internet service.
  • DNS: Which stands for “Domain Name System.” The primary purpose of DNS is to make it easy for people to access web pages and send e-mails.  DNS translates a given domain name into the IP address of the computer that is hosting the given web service (website, e-mail, etc).  Without it, you would have to remember the IP address of each website that you wanted to visit.
  • Registrar: An organization that maintains Internet domain name records.  It is through these organizations that you purchase a domain name.  And the registrar is who you pay to keep your domain current.  The registrar keeps track of who owns a domain, their contact information, and the key DNS information for a domain.

With that in mind, let’s take a look at the three most important aspects of domain name ownership and maintenance:

  • Keeping it Current:  By far the most common problem that we see is letting a domain expire.  Simply, someone forgot to pay the bill from their registrar to keep the domain current and the registrar turns off the lights.  Usually, they never saw an e-mail from their registrar, or a third party who was “helping” them with it dropped the ball.  When this happens, any Internet service related to the domain becomes inoperable; website(s), e-mail, chat servers, etc., all go dark.  This can usually be resolved by renewing the domain.  Most registrars give you a grace period of up to a month to renew your domain before revoking the domain ownership from you.  That’s not to say that you should ever let it expire if you can help it.  Make sure that you have someone who is on top of it and keeps it current.
  • Ownership:  The person listed as the owner of your domain is the individual or organization who has the ability to make changes to it, and is the legal owner of the domain.  Sometimes it is the business or organization itself.  Often times it is another organization that has registered the domain in proxy and is managing it for them.  NBI typically registers domains for it’s customers, especially those that do not have internal IT departments and don’t want to have to worry about keeping it current and managing the technical details.  NBI also helps it’s clients establish their own domain accounts and transfer them from other third parties if need.
  • Login Information:  Most registrars provide you with a login to their website where you can renew your domain and update your contact information.  Make sure to keep this in a safe place as you will need it anytime you need to renew, and/or move your website to a new provider.

To do a lookup on your domain, click here and enter your domain name.

Double-check the Registrant (the organization listed as the owner, which is different from the registrar) and Expiration Date.  If you do not have your login information for your domain, and you are listed as the registrant, give the registrar a call and they can usually reset your password.

If it is going to expire soon, make sure to renew it right away.

If your domain’s Registrant is as an organization other than yourself and that organization isn’t a current, trusted, service provider, get in touch with an Internet technology professional who can help you gain direct ownership of the domain.

If you have any questions or ever need any help with your domain, feel free to send me an e-mail.

Ryan Chapin
President, Nuts & Bolts Interactive, Inc.