Jul2008
18

iTunesU Site Utility in C# (.NET)

by John Dyer

In the process of moving Dallas Seminary's content to iTunesU, I created a very simple application to edit site details via the Web Service API. It currently has the following functions:

  • Add/Edit/Delete Sections
  • Add/Edit/Delete Courses
  • Add/Edit/Delete Groups
  • Upload/Edit/Delete Tracks

There are a lot of things it doesn't do, like let you edit themes or add images to courses, but it is really helping us get started. Here's a screenshot:image

You just enter your shared secret and domain name, press "Load Site Tree" and then right click on the various items to add/edit/delete.

And here's what it looks like in iTunes.image

Download & Installation

Links

  • iTunesU Support Site - Here's where I started
  • iTunesU Java Library - this is much more fully featured and documented than my code.
  • Woolamaloo - Rich Wolf's Mac tool which is much more fully featured than this tool. He also has a Windows app, but as far as I can tell it only lets you login.

My source code is very rough, but it someone needs it, I'm happy to provide it. Also, our iTunes U site is not yet public, but it will be in a few weeks.

Jun2008
2

Online Education Player Design Considerations

by John Dyer

Dallas Seminary has been doing video-based online education for about 5 years now. One of the initial goals was to replicate the classroom teaching experience as much as possible by including the video and the professor's illustrations (Powerpoint, Keynote, etc.). Beyond that, we also wanted to enhance the experience by adding things like a transcript and editing down the video to the most important segments.

Our initial player was created by Yahoo!'s Broadcast.com division and it used HTML frames and Windows media. This limited us to Internet Explorer, but there was no other option at the time. Then Flash 7 came out with video support and I custom built the player below. Since then, video on the web has come a long way, and the introduction of H.264 support means that we only need one format for playing on the web and on the desktop.

Here is the original design using 320x240 video and 480x360 slides:

  • image

Here are some changes we wanted to make:

  • Move from Flash 8 to 9 - use AS3 and enable fullscreen support
  • Use H.264 video - to simplify our workflow
  • Increase the video size, quality, and availability
  • Some users found the auto-scrolling transcript distracting and we need another option for them
  • Many classes don't have slides, so we need to de-emphasize those, yet also provide a good slide navigation system.
  • More narrow player - the current design is about 850px which makes it hard to have many more windows open at the same time.

Here are wireframe mockups of various design proposals

  • First player (2003) using Yahoo!'s Broadcast.com using HTML/Frames/WMV
    Obviously, WMV is limited to really working in IE, and we were stuck with Yahoo!'s platform.
    image
    old_online_ed_Yahoo_Video_Skin
  • Flash player with 320x240 video
    This player is wider since the slides are bigger, but the transcript is more narrow column which makes it easier to read.
    image 
    image

New Designs

  • Swapped video and slides sizes, controls at the bottom
    This swaps the video and slide sizes. It's nice, but the transcript is far away and the slides are hard to read. The player is also still very wide.
    image
  • Larger video size, small slides on the side
    To make the video even bigger, the transcript is now a single line like closed captioning on TV. Rather than give the slides their own dedicated space, the slides have a tray on the right and the full size slide appears over the video for a few seconds. The width is slightly smaller, but not much.
    image
     
  • Coverflow Style Player
    To make the player more narrow (for multi-tasking), we move the slides to the bottom and use the Apple CoverFlow to show a lot of them at once. This makes the player more narrow which is good, but also taller. To shorten it, we've moved all the controls on top of the video that appears/diasppears on mouse hover.

     image

    Here is a screenshot of a fairly common desktop size (1680x1050) with MS Word and a preview version of this player open. (note: I've made sure the controls are visible for the screenshot, but they are hidden normally) 
    image
    image

This seems effective, but there is a possible drawback in that the Coverflow might be somewhat distracting to some students (it can be turned off). Also, some may prefer the older style transcript with more than one line visible at once.

Links to preview the players:

Another future goal is to build the player as an AIR application so that videos can be downloaded for offline use.

May2008
12

The Best Way to Demo Websites for Clients

by John Dyer

For the last few years, my web team has used a projector to collaborate on web projects. We use it for going through our weekly work items, demoing designs, doing training, and so on.

Unfortunately, it was an old projector with a weak bulb so we always had to turn out the lights to use it. Even then it was hard to see because the contrast and color depth were poor, and the resolution was only 1024x768. So last year I budgeted to get a new projector to solve these problems.

Instead of getting a new projector, I decided to get a LCD HDTV and use it as a monitor. I found a killer deal at Sam's Club on a 65" Olevia. The screen isn't quote as nice as something like a Sony, but for what we are doing, it is absolutely amazing. The 1920x1080 resolution and super bright LCD screen is perfect for looking at web designs. In this pic, We have our task app on the right and a full size web page on the left. Even though the text is tiny it's readable from about 8' away:

IMG_3278 

IMG_3279

I have an old PC running the display, and I'm using a few little utilities to make enhance presentations:

  • PowerStrip - Some PCs and Macs can't natively display 1920x1080 resolution. This little Windows app helps out and can usually enable even really old machines to do HD resolutions.
  • ZoomIt - this is a little app by the former SysInternals.com guys. It lets you zoom into a screen with the mouse scroll wheel and draw on the screen. This features are invaluable for mockups.
  • Zune Theme Modified - I also used a modified Zune theme, because I like how the dark colors make the UI fade into the background and focus attention on the design.

On the fun side, we can occasionally use it for things other than web design. Since we're in a basement, we don't have a good way of getting an antenna to pipe in some HD goodness, but we can watch trailers in full 1080p goodness!

IMG_3281

May2008
6

Web Marketing using Facebook Ads and Video for Dallas Seminary

by John Dyer

Note: This blog is usually fairly technical, dealing with ASP.NET, Flash, and JavaScript code samples, but this is a brief deviation into the broader world of the web as a technology platform for communicating an institution's message.

For Dallas Theological Seminary, we've been experimenting with "branding" and reaching different audiences by producing some new videos and experimenting with Facebook's relatively new targeted advertising.

Marketing for Seminaries?

Advertising and marketing for churches and seminaries can be a tricky thing, because it seems rather sacrilegious to "market" something spiritual. We've all seen late night and afternoon televangelists that make us cringe. But DTS isn't offering a "product" that someone buys; rather its mission is to train pastors, professors, and missionaries for a lifetime of service. If you call an admissions counselor and ask why you should go to DTS, you won't get a sales pitch. The admissions counselor will tell you that you should go to the school to which God is calling you. The admissions person will then mention some of DTS's strengths, but stay away from comparisons with other schools or "selling DTS."

Still, it is important for DTS to inform prospective students on what kind of school it is and what it's strengths are. Basic marketing ideas can help convey this, and naturally the web is a great place to start.

Context for the Advertisements

Any time you create an ad for a "company," it is important to know the background of the business and the historical context in which the ad is situated. This history of seminaries and churches in America is key to understanding what ads will communicate to the seminary audience. image 

In the early 1900s, was a debate in the Christian church between "fundamentalists" (those who believe certain truths are the most important thing about Christianity) and "liberals" (those who believe certain actions are the most important thing about Christianity). In this debate, it seemed that the "liberals" forgot that Jesus asked Christians to believe something (that he is the savior and the Son of God), while the the fundamentalists often forgot that Jesus asked Christians to do something (love others).

DTS was started in the 1920s during the fundamentalist movement. Unfortunately, many of the seminaries which started during this time period have a reputation of caring about teaching the Bible, but neglecting to meet real world needs. By the 60s and 70s, some Christians wanted to balance the emphases of both the liberals (loving) and fundamentalists (truth), and there they were called "evangelicals." Today, this term has become politically decisive and has less positive connotations in many places, so the word "evangelical" communicates something different than it used it.

Today's students who are considering seminary are more concerned than ever about balancing these two things and so DTS needs new ways to communicate that it wants to care about Christian beliefs and Christian practices without making one too dominate. These students also don't read traditional Christian publications, so DTS needs to shift from print publications to Internet and from top down communication to allowing prospects to connect to real students.

A New Tagline

The older taglines for DTS have been things that primarily emphasize Biblical teaching such as "Standing Strong for the Truth" or "Training You Can Trust. Leaders You Can Follow."

We wanted something shorter and somewhat pithy that emphasized both aspects of truth and love. Here's what we came up with.

  • Teach Truth. Love Well.

Not too revolutionary, but hopefully it's clear and it communicates. Here's how Google sees it :)

image

Facebook Page and Ads Summary

DTS has traditionally run ads on large Christian website like ChristianityToday.com and OnePlace.com. But to reach younger students, we moved over to Facebook.

Also, in the past, a traditional DTS ad might have emphasized something like "Want to be a Pastor?", but many of today's seminarians are going into non-traditional forms of ministry. DTS grads still have a very strong emphasis on teaching the Bible, but more students are doing this outside the traditional church pastor role. The first few ads we ran emphasize these other forms of ministry. We ran each one for around a week and paid per click with click-through rates of around 0.10%.

image image

Which one do you like more?

The second ad turned out to be more successful (higher click-through rates). This is probably because the image is more appealing and "Dallas Seminary" doesn't show up until later in the text of the ad.

In addition to advertisements, we also setup a Facebook Page for DTS. Rather than aggressively market to students through physical mail or email blasts, this allows interested students to check out DTS and ask questions of current students and alumni before talking to an admissions counselor. On the GoingToSeminary blog, there is a great post about connecting to a current student to get real answers. Below is an example of a prospect asking a question that a current student answered on Facebook. That person got a real answer from a real student without ever needing to visit the main seminary website.

image

Connecting with Video

DTS's excellent AV team has also produced several videos that communicate the "Teach truth. Love Well." message. These are sent to alumni and supporters via email every few months.

Ben Stuart
Ben leads a college ministry called BreakAway which is attended by about 5,000 Texas A&M (my alma mater) students. His story is classic DTS and emphasizes "Teach Truth".

Christ in North Africa
Where Ben highlights "Teach Truth," Christy highlights "Love Well." She is an English teacher North Africa, but never "teaches" Christianity verbally; she does it by loving the girls in her classes.

William "Duce" Branch
"Duce" Branch is a pastor who ministers to the hip hop generation through his music.This is a guy who took 120 hours of course work and still managed to keep his love for his culture. He really embraces both elements of "Teach Truth. Love Well."

This last video also has a great metaphor for communicating to different audiences where the president of the school is shown on an upper-middle-class HDTV while Duce is shown on various older TVs. They both are working for the same goal with the same message, but the context and transmission system changes to be audience appropriate. Good stuff.

I hope this is a helpful summary of how DTS works and how the newer media forms can be used to communicate to changing audiences.

Apr2008
14

Dallas Seminary Mobile Site

by John Dyer

Since Microsoft and Apple finally decided to allow/license versions of Flash Lite 3.0 for their mobile devices (Windows Mobile and iPhone), I created an initial build of a mobile site for Dallas Seminary which will eventually use Flash Lite 3.0 for all the audio and video content.

The goal was to make it look like an iPhone application using the list format, but have it work properly on other mobile devices by not specifically targeting the iPhone's screen size such as Windows Mobile and Blackberry. It's a bit more cramped on the smaller WM screen, but it works well.

Here are a few screen shots:

iPhone Windows Mobile
image dts_wm_home
image dts_wm_media

 

There is one gotcha on the iPhone that doesn't show up using Safari. The iPhone may try to startup zoomed out like it would need for a normal website. If your <div> tags are set to expand, the iPhone will stretch everything out and then zoom out.

 image

To fix this add the following:

<meta name="viewport" content="user-scalable=no,width=320,scale=1.0" />
Feb2008
21

Implementing Map Mashups with Mapstraction

by John Dyer

image A few years ago, I made my first map mashup with Google Maps for Dallas Theological Seminary. It allows visitors to search for churches around the world where DTS alumni are serving. Recently, we decided to update the mashup with several features in mind:

  1. Larger map - 2 years ago we were using a 800px wide layout and now we can use a 1024px layout
  2. Use updated API - Google has changed APIs since then
  3. Implement other maps - Yahoo and Microsoft each have good points
  4. Use custom icons - we are not just showing churches now, but also schools and counselors

To handle all of this, especially the implementation of other multiple map engines, I chose to use mapstraction, a JavaScript layer which allows developers to program against a common API for all mapping engines. It turns these two proprietary mapping code blocks:

// Google maps specific code
var gmap = new GMap2(document.getElementById("map"));
map.addControl(new GMapTypeControl());
gmap.setCenter(new GLatLng(37.4419, -122.1419), 13);
var gmarker = new GMarker( new GLatLng(37.443, -122.166) );
gmap.addOverlay(gmarker);
// Microsoft Live maps specific code
mmap = new VEMap('map');
mmap.SetDashboardSize(VEDashboardSize.Normal);
mmap.LoadMap();
mmap.SetCenterAndZoom(new VELatLong(37.4419, -122.1419), 10);
var shape = new VEShape(VEShapeType.Pushpin, new VELatLong(37.443, -122.166));
map.AddShape(shape);

into this single common set of code:

// universal map API, just change 'google' to 'yahoo', 'microsoft', etc.
var mapstraction = new Mapstraction('map','google');
mapstraction.addControls({ pan: true, zoom: 'large', overview: false, scale: true, map_type: true });
mapstraction.setCenterAndZoom(new LatLonPoint(37.4419, -122.1419), 12);
var marker = new Marker(new LatLonPoint(37.443, -122.166));
mapstraction.addMarker(marker);

In addition to Microsoft, Yahoo, and Google maps, you also get free access to a 3D map called Freeearth which is an amazing implementation of a 3D globe map (like Google Earth) using Papervision3D.

Examples

Here are examples using all four mapping engines. The only unique code is the shadow on the icons under Google maps. Also, prototype (which is used throughout the site) is handling the AJAX calls.

image image

image image

Try it out

Links

Dec2007
31

C# Template for Creating Google Video Sitemap

by John Dyer

Earlier this month, Google introduced "Video Sitemaps" as an extension to the Sitemap Protocol standard. It allows website owners to expose their video content (including embedded video) to be indexed and included in Google's video search (here is Google's spec). Embrace and extend ;)

I just added this to Dallas Theological Seminary's site: http://www.dts.edu/videositemap.xml and I thought it might help to share the template to speed someone else's development:

using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
using System.Web;
using System.Xml;
using System.Text;

namespace YourNamespace
{
    public class VideoSiteMap : IHttpHandler
    {
        public VideoSiteMap()
        {
        } 
        
        public void ProcessRequest(HttpContext context)
        {
            XmlTextWriter writer = new XmlTextWriter(context.Response.OutputStream, Encoding.UTF8); 
            context.Response.ContentType = "text/xml";

            writer.Formatting = Formatting.Indented;
            writer.WriteStartDocument(); 
            writer.WriteStartElement("urlset");
            
            // add namespaces
            writer.WriteAttributeString("xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9");
            writer.WriteAttributeString("xmlns", "video", null, "http://www.google.com/schemas/sitemap-video/1.0");
            
            // fake loop
            for (int i=0; i<10; i++) {
                writer.WriteStartElement("url");

				// required
                writer.WriteElementString("loc", "http://mysite.com/myplayer.aspx");
                writer.WriteStartElement("video", "video", null); 
                
                // start:optional
                writer.WriteElementString("video", "title", null, "Video Title");
                writer.WriteElementString("video", "description", null, "a great video");
                writer.WriteElementString("video", "thumbnail_loc", null, "http://mysite.com/myvideothumb.jpg");
                writer.WriteElementString("video", "family_friendly", null, "Yes");
                writer.WriteElementString("video", "content_loc", null, "http://mysite.com/myvideo.flv");
                writer.WriteElementString("video", "duration", null, "100");                    
                
                writer.WriteStartElement("video", "player_loc", null);                
                writer.WriteAttributeString("allow_embed", "true");
                writer.WriteString("http://mysite.com/embeddedplayer.swf");
                writer.WriteEndElement(); // video:player_loc
                // end:optional
                
                writer.WriteEndElement(); // video:video
                writer.WriteEndElement(); //url
            }
            
            writer.WriteEndElement(); //urlset 
            writer.WriteEndDocument();
            writer.Close();
        }
        public bool IsReusable
        {
            get { return false; }
        }
    }
}

Just add this class to your web.config and you're all set:

<system.web>
   <httpHandlers>
      <add verb="*" path="videositemap.xml" type="YourNamespace.VideoSiteMap, YourNamespace"/>
   </httpHandlers>
</system.web>

Hope that helps!

Sep2007
6

New Embedded Flash Player

by John Dyer

We just finished an initial version of a Flash embedded player of our DTS media. All of our chapels and dialogues will now be embedded into blogs. We've made room for an intro and possibly announcements at the beginning and end. In this way, we can use the advertisement concepts in other embedded players (Brightcove, upcoming YouTube ads, etc.) to send messages to students, faculty, staff, and other listeners. Here's a sample from a "giant" of a professor, D. Jeffrey Bingham:



We'll finish the styling of the player over the coming weeks.
Jun2007
1

Papervision3D Experiment: 3D Campus Map

by John Dyer

I've been experimenting with Papervision3D in order to make a 3D version of our campus map. On of our artists has worked up an extremely detailed map in Google Sketchup. I've rebuilt the model in Sketchup using texture maps so that its around 1000 triangles and is to scale in Google Earth. Sketchup allows exporting to Collada files (which it uses in it's own files for Google Earth) and Papervision will parse Collada. Here's the result:

 

I have not finished texturing the entire model, so there are some plain yellow walls.

UPDATE: I've also added a driving mode! 

Dec2006
15

2006 Design Awards

by John Dyer

This year, my team won two awards for the Dallas Theological Seminary website. Hopefully, we can pull in a Webby someday!

Interactive Media Awards
Best in Class-University

 

Web Marketing Association's 2006 WebAward
Best Faith-based Website


Sep2006
30

Making Design Decisions Based on Visual Mouse-Click data from CrazyEgg.com

by John Dyer

For the last two weeks, I've been running some tests of DTS's website (which was featured on godbit and just won an best of the web award!) with CrazyEgg.com. We tested our two most important pages, the front page, and the Admissions page. The following information could be discovered via standard analytics but is is far more intuitive and easier to "see" with CrazyEgg's visual tools.

DTS Front Page

 Click map Heat map
DTS Front Page Click map DTS Front Page heat map

For those who've never worked on a University website (DTS stats: 2000 students, 200 faculty/staff, 11,000 alumni), the front page must function as: 1) an attractive, informative call-to-action for prospective students, 2) an information portal for current students, alumni, and staff, and 3) a public relations piece for the public and donors. In other words, a University front page needs to convey a lot of information for several very different audiences. Our Lead Designer, Tim Kimberley (of HeLives.com) has done an incredible job laying out all this information. Now, with the CrazyEgg.com data, we've learned a few things that justify our design decisions and will hopefully lead us to make it even better:

1) Be careful with links that don't look like links - In the lower half of the page, the headers "dts family", "feature items", "calendar" are all clickable links that take you to pages with more information in those categories - but, not many people click on them. Perhaps not many users "gets" that those are links since there is no underline. A possible solution is to add a "more" button next to each heading.

2) Unused menu items - From the heatmap, it's pretty easy to see that the top left menu is very popular and that some items are more popular than others. This would be harder to "see" using analytics. The "Become a Student" area is really working and prospective students are using all three sub links. But we also noticed that the "donate" button is not very popular. We may need to rethink how we word that area since it takes up so much valuable real estate.

3) Unexpectedly popular links - The "campusnet" link is a lot "hotter" than we would have guessed. Campusnet is separate website where students login and register for classes. We thought they would just go directly to the website by typing in the URL(campus.dts.edu), but it appears that a lot of them go through this link. In the design phase, I didn't want to include this link, but I'm glad we did (note: we filtered out all web traffic coming from our campus to skew the data toward external visitors, so this link might have been even more popular if we had included students, faculty, and staff using campus computers.)

4) Search - Although we know that many users like to search, it's nice to be able to visually see that the search box is important and heavily used. (note: we also track what the most common search terms are and we display "Popular links" at the top. Ex: fees and bock)

5) Flash? - CrazyEgg.com does not currently have a way to detect flash clicks. We may want to change out the flash rotator to a JavaScript rotator so that we can see more clicks (jCarousel?). (Note: we use unobstrusive JavaScript to ensure users without Flash have a good experience).

Admissions Page (Become a Student)

 Click map Heat map

The Admissions page is probably the most important page on a University website. Once the user has made it past the front page, this is our best chance to layout the information they need and the steps they need to take in order to find out if our school is the best for them. We've done a few things there not found on most sites. In the left column (campus picture and stats) functions to convey a sense of the school and nothing there is clickable. In the right column, we put together some videos about the school and a few interesting links in order to convey a sense of the people at DTS. The center column is focal area where the user can begin to do something. The most important things, "apply" "catalog" and "get information" are prominent icons and the major degree programs are clearly laid out. Lastly, there is a bottom section containing a lot of additional information and links to various admissions related pages. Here's what we learned:

1) Prominent icons work - The center column is heavily used and seems to be functioning perfectly. In our old site, these links were text-only. From the heatmap, we can also see that some users click on the text "apply online" and others click on the graphic.

2) Links don't always need an underline - In the green degree box, users click the "learn more" link under each degree more than they click the title of the degree. Here, users seem to "get it" and both links work.

3) Sometimes icons don't work - The links in the lower right (the two students and one professor) are the least-clicked links on the page. We'd like to keep the faces there, but perhaps we can link to more compelling content to better utilize the space.

4) Lists work if they are clear - The bottom of the page is more utilized than I would have guessed. Users click on all of the links and, because they click on some more than others, we can tell that they are actually reading the links. A glance at the heatmap shows that "Expenses" and "Online Education" are two of the most hit pages. We need to spruce up both of these pages since they are heavily trafficed and also perhaps give them even more prominence (maybe put them in place of #3).

5) Don't rely on anaytics alone! - The "visit campus" link is fairly "hot." Just looking at this data, I probably wouldn't change anything. But, we found out from our Admissions team that if a student visits campus he or she is extremely likely to matriculate. Therefore, it would make a lot of sense to promote this link as well, although we couldn't have known that just from the click data.

Summary

It is much easier to quickly understand which links users are clicking with a visual tool like CrazyEgg.com than with a standard analytics tool where one has to manually analyze the data. It's also much easier to justify tough decisions to non-web developers (administrators, presidents, etc.) using a heatmap than a bar graph. But we also know that analytics (visual or non-visual) do not tell the whole story. Standard analytics, user surveys, and interdepartmental communication are still essential tools for web designers. CrazyEgg's visual tools are a welcome and powerful addition to that lineup.

Links

Jun2006
21

Outlook 2007 and Novell GroupWise

by John Dyer
About 2 years ago, DTS moved from using Exchange with Office 2000/XP to Novell Groupwise 6.5. The decision was due to the cost of upgrading Exchange to the 2003 version and the additional needed hardware and licenses. I really love the three pane layout of Outlook 2003 and later, but I found that with some upgrades to GroupWise, I could no longer use Outlook 2003 to communicate to with the GroupWise server. I was hoping Outlook 2007 would solve this. Unfortunately, I have only been able to get it to read messages so far, but I cannot get it to send mail. I am using GroupWise's caching mode, so I might try to change back to the default client/server setup and see if that will work.
Apr2006
25

Lightbox usage for calendar

by John Dyer

I just made my first implimentation of Lightbox ("Gone Wild" edition). Lightbox (original, gone wild) is a small JavaScript tool for making accessible modal windows. I've implimented a slighlty tweaked version it in a calendar page (see pics below) and on a page that shows faculty member's publications (example). I've also used some IE hacks to get IE6 to properly use alpha PNGs for a nicer overlay. Rather than use the full-fledged ASP.NET calendar component, I wrote a custom ASP.NET control that renders a CSS-only table. I would have liked to make the calendar URL-hackable (have the ability to move through months via URLs like /calendar/2006/09/) but for now I'm using postbacks.

Before clicking the link
Before pressing the link
After clicking a lightbox link
After clicking on a calendar entry
Mar2006
14

Cross Domain Flash 8 BitmapData

by John Dyer

This week, we added a feature to our online education player that creates small thumbnails of upcoming slides (see sample class video).

To do this, I used a new feature in Flash 8 that allows copying a MovieClip as a bitmap in three simple lines:

// copy from source_mc -> target_mc
var bitmap = new flash.display.BitmapData(source_mc._width, source_mc._height);
bitmap.draw(source_mc);
target_mc.attachBitmap(bitmap, 1);

The only problem is that if a SWFon domainA tries to copy a MovieClip loaded from domainB (source_mc) and source_mc has any content from another domain (domainB), BitmapData won't work. The online education player loads the slide images from different domain (domainB) than that which hosts the player (domainA), so initally the BitmapData code didn't work. If we were loading SWF files from domainB, we could add the following code to the domainA fla/swf:

System.security.allowDomain("domainA");

But this doesn't work for JPGs, PNGs, etc. since you can't add this code to an image file. Macromedia suggested putting all the images inside SWFs, but that would not be feasible since we have 1000s of slides. Based on some code and a few emails from Frédéric v. Bochmann, we were able to get around this by creating a wrapper flash file that loads the images I wanted and then returns a BitmapData.

Instead of domainA.swf doing:

container_mc.loadMovie("domainB/image01.jpg");
bitmap = new flash.display.BitmapData(container_mc._width, container_mc._height);

domainA now does this:

container_mc.loadMovie("domainB/loader.swf?filename=image01.jpg");
bitmap = container_mc.getBitmap();

Then in domainB/loader.swf, the code looks like:

System.security.allowDomain("domainA");
this.createEmptyMovieClip("container_mc", 1);
this.container_mc.loadMovie(this.filename);
function getBitmap() {
    return new flash.display.BitmapData(container_mc._width, container_mc._height);
}

This is a simplified example, so you should add some code to check for the loaded state of the image01.jpg file (Frédéric v. Bochmann does this in his example). Also, when passing the filename=image01.jpg, you must use a fully qualified domain name (such as domainB/image01.jpg), or else the domainB.swf will try to load the file from domainA and Flash will throw error about cross-domain loading.

Try it out

Jul2005
11

Latitude/Longitude Distance Calculation in SQL Server

by John Dyer

Originally, my Google Maps church search page was finding the nearest churches by making an approximate square around the zip code's latitude and longitude. For large distances (over ~25 miles), this proved pretty inaccurate. To fix this, I created a SQL Function so that I could run a query like this:

SELECT * 
FROM 
dts_Alumni_Churches
WHERE 
dbo.CoordinateDistanceMiles(Latitude, Longitude, @ZipLatitude, @ZipLongitude) < @Radius

Here's the SQL function:

CREATE FUNCTION CoordinateDistanceMiles(
@Latitude1 float,
@Longitude1 float,
@Latitude2 float,
@Longitude2 float
)
RETURNS float 
AS  
BEGIN 
-- CONSTANTS
DECLARE @EarthRadiusInMiles float;
SET @EarthRadiusInMiles = 3963.1
DECLARE @PI  float;
SET @PI = PI();
-- RADIANS conversion
DECLARE @lat1Radians float;
DECLARE @long1Radians float;
DECLARE @lat2Radians float;
DECLARE @long2Radians float;
SET @lat1Radians = @Latitude1 * @PI / 180;
SET @long1Radians = @Longitude1 * @PI / 180;
SET @lat2Radians = @Latitude2 * @PI / 180;
SET @long2Radians = @Longitude2 * @PI / 180;
RETURN Acos(
Cos(@lat1Radians) * Cos(@long1Radians) * Cos(@lat2Radians) * Cos(@long2Radians) + 
Cos(@lat1Radians) * Sin(@long1Radians) * Cos(@lat2Radians) * Sin(@long2Radians) + 
Sin(@lat1Radians) * Sin(@lat2Radians)
) * @EarthRadiusInMiles;
END

If anyone has a faster method for use in SQL Server, I'd love to see it.