The Back Room
Bruce

Automated Testing of Bar Code Scanners for Flash Museum Installations.

by Bruce on Jul.22, 2010, under Hardware, Software

We have a Flash application that takes an input from a bar code scanner via serial keys in windows. Each time a ticket is read by the scanner, it’s translated into a keyboard input, and that is sent to the Flash application. The application can then analyze the string of characters, validate them through php with a Microsoft SQL database, and return whatever info we need. It’s a good example of integrating Flash with an external input device – the scanner. Although the scanner we’re using requires a few pieces of software to send keyboard command (because of the way it works with the touchscreen), most just emulate a keyboard input when an item is scanned.

Because what we’re making has to work hundreds of times a day, every day, we needed a way to do some solid stress testing. It wasn’t practical to have one of us sit in front of a computer with a ticket and scan it every 5 seconds to make sure that our application and the hardware were functioning properly. So, Charles came up with the idea to trigger a small servo motor to scan a ticket every XX number of seconds. In about two hours, he had the device you see below. It is pretty utilitarian, but  the main function is to just make sure the ticket scans properly, so it doesn’t have to be too sexy. The program is actually a modified version of the servo motor example that ships with the Make Controller that we have used in a few exhibits. The controller is pretty handy for connecting Flash to all sorts of external devices.

We’re not showing the actual program we’re testing, but instead you can see the input from the scanner appear on notepad. It helped us assure that our software could take the continuous input of thousands of scans a day and still be functioning well.

5 Comments :, , , , more...

Bruce

Interactive Developer Job Opening at Boston Productions

by Bruce on Jun.28, 2010, under Software

Interactive Developer Job Opening

About Boston Productions, Inc
Boston Productions is a multimedia production company that produces videos, interactive programs, and immersive theater experiences for museums across the United States. We are looking for an experienced interactive developer to join our staff. Recent clients include: Connecticut Science Center, Hershey Chocolate Company, Smithsonian Institution, College Basketball Hall of Fame, and the International Spy Museum.

Description of the Position
Our work combines Flash, video, content management, and occasionally giant chocolate machines. We’re looking for someone to join our team with a broad range of technical abilities. This is someone who is comfortable with PHP and SQL programming, but also can get their hands dirty with Actionscript and Flash development.

Here are some examples of some of the challenging projects we’ve done:

–a theatrical experience that let’s up to 32 people use touch screens to interact with a 3 screen immersive video projection with lighting and atmospheric effects

–a multi-user map table that allows up to four users to explore the history of the town of Hershey through photos, video and other rich media.

–an interactive presidential desk that teaches visitors about Teddy Roosevelt’s policy decisions and allows them to photograph and email an image of themselves as president.

As an interactive developer, you will program touch-screen applications, websites, and other multimedia programs.  You’ll also be key in building custom applications to allow institutions to manage their own content and allow the programs to grow over time. As a valued member of the production team you will participate in creative development, programming, prototyping software and hardware, and ensuring proper QC of deliverables.

Qualifications
The interactive developer should have a broad knowledge of interactive technologies and in-depth software knowledge in Flash, Dreamweaver, and Photoshop and in technologies like XML, ActionScript, PHP, SQL, CSS, and HTML.

Helpful skills include familiarity with video encoding for the web and stand-alone applications, the ability to diagnose and solve computer problems, and the poise to deal with problems you may have never heard of before. We realize there are a lot of Flash animators and designers out there, as well as pure PHP coders, but this position is for a person who can work with both, and integrate them to create seamless experiences.

Excellent communication skills and the ability to collaborate are extremely important as a project team may include a producer, video editor, graphic designer, scriptwriter, and the interactive developer.

We don’t need you to know it all, but an adventurous spirit is important.  We take on a lot of challenging projects that are different than anything we’ve done before, so if you like sticking to just web development, or don’t feel comfortable with integrating graphics and Actionscript, then this probably isn’t the job for you.

Please email your resume, cover letter explaining why you’d be a great addition to our team, and your favorite candy bar to Bruce Spero at bspero @t bostonproductions d0t com. No phone calls about this job please. We’re NOT looking to contract out work to other companies or development firms. We’re looking for an individual to work out of our Norwood, MA office, so please make sure this is a possibility before applying.

Leave a Comment more...

Charles

Create Your Own Candy Bar Is Now Open At Hershey’s Chocolate World

by Charles on Jun.15, 2010, under Uncategorized

Guests at Create Your Own Chocolate Bar Watch The Chocolate Enrober

Guests at Create Your Own Chocolate Bar Watch The Chocolate Enrober

I am proud to announce the opening of Create Your Own Candy Bar at Hershey’s Chocolate World.  This exciting experience allows visitors to design their very own Hershey’s chocolate bar complete with custom chocolate types, a variety of included ingredients, and a unique wrapper.

The best part is that after using the kiosks to design your wrapper and bar, you get to watch a real assembly line complete with robotic arms, hydraulic pumps,  and lasers build and package your custom bar!

This is definitely a one of a kind attraction that I would recommend to anyone in Hershey, PA.

Charles's personal wrapper

Charles's personal wrapper

Leave a Comment more...

Charles

Rich Media Multi-Screen Object Theaters and Film.
We do That Too.

by Charles on May.07, 2010, under Hardware, Miscellaneous

Coacoochees Story at Creative Cow

Coacoochees Story at Creative Cow

This journal has mainly focused on the interactive development work that Boston Productions does.  However, our roots are in immersive film and video production.   There is a good chance that while Bruce, Dave, and I are programming away on interactive exhibits; Boston Production’s editors and other creative talent are hard at work on a film, television commercial, or immersive multimedia presentation.  Two of the most recent samples of award winning work Boston Production’s has done are the documentary, In Pursuit of a Dream and the immersive theater at the Tampa Bay History Center, Coacoochee’s Story.

An article about Coacoochee’s Story by one of our talented editors, Mike Sullivan; has been featured in Creative Cow Magazine this month.  The article describes the production process of Coacoochee’s story and will be sure to please the technical oriented readers out there.  Interesting topics covered include a custom sideways camera mount, mixing 7.1 audio, editing for multiple screens in an Avid DS, motorized gigantic turntables, and modern multimedia storage and playback devices.

The introductory article focus says it all: “Highly complex multi-media installations – at least the successful ones – are only possible through careful planning, intense cooperation, and a willingness to turn the picture on its side”.

You can read the full article at Creative Cow in “The Future is NOW Issue”.

Coacoochees Story In Action at the Tampa Bay History Center in Tampa Florida

Coacoochees Story In Action at the Tampa Bay History Center in Tampa Florida

Leave a Comment :, , more...

Bruce

Choosing an Identity on Social Media Sites for Museums, Zoos, Aquariums, and Visitor Centers

by Bruce on Apr.07, 2010, under Web

Along the social media vein that I was talking about in my last post, I came across a great tool that institutions should consider checking out if they’re diving into the social media/networking world. If you’re building an online brand for your museum, consistency is important in helping people know how to find you. If you have one user name on Twitter, another of Flickr, and a few others for Facebook, Digg, etc. Then when a user goes to look for you online, they’ll probably have only marginal luck finding you in these places. Check this out …

http://namechk.com/

You can check the availability of user names across almost 150 popular sites, including Youtube, Facebook, LinkedIn, Twitter, and Wordpress. Some of the sites might not be applicable for what you need to do, but if you haven’t established an identity yet on a number of these sites, then use namechk.com to see what user name would be available on the majority of sites. It saves a ton of time going to each one, and you can quickly try multiple names to find one that works.

1 Comment :, , , , , more...

Bruce

Social Media and Social Networking in Marketing for Aquariums, Zoos, Museums and Visitor Centers

by Bruce on Mar.19, 2010, under Web

I am a pretty connected guy. I have accounts on Twitter, YouTube, Facebook, etc. I have my iChat set up on my computer to my AIM account, Google Chat, and Facebook Chat. I have an iPhone, plan on getting an iPad, and my desk has 4 screens on it right now that are all connected. One for my Mac laptop, two for my PC, and one for a Ubuntu Linux box I have running to play around with a content management tool called OMEKA for a project we’re working on here. I like that I can get a hold of almost anyone I know very quickly, find any piece of information in a snap, and take in vast amounts of information all at once. Despite all of this, sometimes I can’t manage to talk with my parents, because they don’t realize what call waiting is and won’t click over, and haven’t checked their email in a few days. No matter how much I use technology to connect and communicate, none of that matters if the person on the other end doesn’t. I can draw a similar line to incorporating social networking and media into museums and other institutions. Sure, some people are going to eat it up and really embrace it, but, as hard as it may be to imagine, there are millions of people that don’t use this as a method of communication, and may get very little or nothing out of the experience.  Nina Simon has some great stuff on her site, Museum 2.0 that is probably deeper than I can go, but I did want to offer a few high level thoughts.

There are a couple different aspects to consider when thinking about social media. How can you use it to market and promote your product (museum, aquarium, etc.), and how can you use it to create content inside your institution, like designing dynamic exhibits and new ways that visitors explore your message? For this article, I’ll first focus on things to consider on the marketing and outreach perspective.

Should you create your own system to create or can you leverage existing platforms to accomplish what you want?
I can’t get over how many web sites now let you create a log-in, and then want you to create a profile and interact with users, share videos, etc. With the vast majority of these sites, so few people are going to actually do it, that it makes very little sense. Sure, someone might sign up for a login and post something once, but the number that will make your own site part of their daily routine? Honestly – VERY few. You must have a powerhouse of a site to really attract people to visit daily. Why try to reinvent the wheel here? As cliche as it is, it makes much more sense to use things like Twitter, Facebook, YouTube, etc. They are existing platforms that you could integrate into your website or on-site exhibit media. They have rich API sets, are time tested, and people are familiar with them and many already have logins and make them daily visits. Facebook just passed Google as the #1 web site in this country.

Are you generating content that people care about?
If you’re going to start a Facebook group, Twitter feed and the like, why are you doing it? If it’s just because, “that’s what the kids are doing these days,” then it’s not worth it. You have to have some reason behind it and some vision for how you’re going to use it. Starting a Twitter feed and posting your gallery hours, lunch specials, etc. over and over doesn’t really seem like a great use of the medium. People have to want to follow you and hear from you on a regular basis. Make sure you’re posting fresh content and making people want to follow you, not block you. We get enough junk mail as it is.

This page is like a federal highway project. Always "Under Construction".

This page is like a federal highway project. Always "Under Construction".

Are you going to keep with it?
You know what really drives me nuts? Under construction pages on the web. At least they’re not using that same icon with the orange diamond with a line drawing of some guy shoveling. Also, sites with a bit of content with “coming soon” sections, notes about how more will be up in a month, etc. 95% of the time, it is NOT going to happen.

So, going along with that theme, don’t start down a road that you can’t sustain, and don’t start before you’re ready. When we started this site, I told the guys here that we were going to update it regularly, and made it part of their jobs to make sure we were keeping this content fresh. If you’re going to start posting videos monthly on YouTube and promote it as some sort of recurring feature, you’d better keep doing it, because if people subscribe to your channel hoping to get new stuff, and it stops after two months, they may not come back. Follow through and keep with it long enough to let it work or fail. If after a year you’re getting 14 views per video, then maybe it’s time to pull the plug.

Do you know what you’re doing?
In my previous job, I worked for the in-house production department of a very large company. We had a request come from a VP that she wanted to do a podcast because, “that’s what people are doing.” Except, she had nothing to say and no reason to do one. We also had someone start a YouTube site for the company with a name that didn’t connect to either the company or the products it produced. If you’re going to dive in, make sure you know how the system works, and talk to some people who may have done it. People, especially kids, can spot people who don’t know what they’re doing and it can be embarrassing. A certain presidential candidate had a MySpace page that was put up hastily, and used graphics that were linked from another person’s site. What do you think happened when that person realized the graphics were being used improperly and went ahead and changed them in the background? Yeah, a presidential candidate had a MySpace page promoting issues that were the opposite of what he believed.

Nestle digs out of a Facebook sized hole.

Nestle digs out of a Facebook sized hole.

Are you ready for the consequences?
Social media has a broad reach, and can help disseminate positive reviews, experiences, etc. BUT, it also can do the same for bad experiences. You’ll lose control over some of what might happen on your Facebook group, responses on Twitter, or any other public forum. Part of what makes online social media unique is that people are free to make comments, interact, etc. without being censored or held back. If you start deleting unflattering posts or only accepting people who give your institution good reviews, that will really rub people the wrong way. So, make sure you’re ready to deal with a public debate if your ticketing system goes down and causes a two hour wait for entrance into your exhibit halls. You can be sure that you’ll hear about it on your Facebook page, and everyone else reading that page will hear about it too. Be ready to publicly respond to these types of things and be up-front and take responsibility for it to smooth the path. A recent example of some Facebook PR trouble can be found with Nestle Corporation’s Facebook Slip.

I’m a big fan of making sure you do things right. Maybe it’s because I work in this field, or some childhood frustration of watching people not finish tasks, but it really strikes a cord with me. Social networking is a great way to get the word out about what you’re doing in your institution. It facilitates connections, gets people talking, and can really grow your membership. It’s also a very public arena, so you should do it right the first time. How would you feel if you sent out a bunch of fliers to your membership and they all had typos and incorrect information? Content on the web can be seen by millions, so take care of your image there and you’ll have a better chance of success.

1 Comment :, , , , , , , , more...

Charles

Introduction to Open Source Hardware and Software in Museums and Visitor Centers

by Charles on Mar.05, 2010, under Electrical Engineering, Hardware, Software, Web

One of the ever increasing trends for visitor centers and museums, especially in the public sector, has been the inclusion of open source software and hardware into their exhibits, user stations, and infrastructure.  At face value, it seems like open hardware and software systems should be considered over closed hands-down.  There are a few high level considerations to take into account when making the decision to utilize a certain open source project.

What is open source software?
Open source software means that the original source code for a software product or tool is made available.  An open source software project may or may not have a corporate entity backing it.  Traditionally open source software is volunteer based unless there is a corporate entity actively developing portions of a project.

The Openfire XMPP Server

The Openfire XMPP Server

An example of a corporate backed open source software project is Jive Software’s Openfire Server for XMPP (an instant messaging protocol).

An example of a volunteer based project is the multimedia encoder/decoder/transcoder ffmpeg.

Open source software usually does not provide typical avenues for support.  At a bare minimum there will be a developer’s mailing list that may or may not have active participants who can provide helpful support.  My recommendation is that the amount of documentation for a project should be carefully examined prior to becoming involved with it.

What is open source hardware?
In this context I am referring to open source hardware as circuit boards.   So this may include special electrical converters that allow an exhibit to do external communication, control something remotely, turn on and off devices and lighting, and several other operations dealing with management of electricity.

Open source hardware means that electrical schematics, part lists, gerber files(standard circuit board fabrication CAD file format) and potentially low level code are made available with hardware.  Basically all of the necessary items are provided in open source hardware so that anyone with the ability to fabricate circuit boards could produce and potentially sell or use the piece of hardware.  A very popular piece of open source hardware is a little circuit board for hobbyists, students, and professionals known as the Arduino.

The Sparkfun Electronic's Section for Arduino

The Sparkfun Electronic's Section for Arduino

The Sparkfun Electronics product page for Arduino shows the power of open hardware as there are several variants and accessories of the popular kit.

Important Questions You Should Ask When Considering Open Software and Hardware
1.  Will the open source software or hardware work for you as-is?
If you decide that you would like to expand or modify an open source project, then make sure you have the manpower and expertise to do so.

2. If modifying an open source project; would it be faster to do your own implementation?
If an engineer is not familiar with an already implemented solution, then there is an additional cost of time for the engineer to learn how to modify the open source project.  Many implementations in software are built on strict templating systems that an engineer will have to figure out how to work with.

3. Does the licensing for the project fit your intended use case?
There are many different open source licenses that all come with their own restrictions.  Some allow you to do whatever you want.  Some place strict guidelines on what is and isn’t allowed.  Some require you to release your source code/schematic changes if they are requested.

1 Comment more...

dnelson

Waiting for your Document Class to Instantiate and Controlling Flash Component Visibility

by dnelson on Feb.18, 2010, under Software, Web

Recently, while creating a content editor I had a problem setting the visible property of components. Since much of the content editor’s functionality is dependent on previously entered content, I had the need to hide many of these components at certain stages of the application. I needed my editor to start by only showing a few options, while hiding most of the other components on the stage. I added a function in the constructor of my document class that would set the .visible property of these components to false. This did not work.

After a few minutes of scratching my head I came to the conclusion that the .visible = false commands I was giving were being overwritten by something else. I then remembered a workaround I have used in the past when I had needed to determine the size of the stage upon loading the application. The trick was to wait for the document class to fully instantiate itself before the stage properties become available. The same was the case with the components. Flash was rendering my .visible = false in the constructor, but since the document class hadn’t fully instantiated itself, the components would then reset to their default settings, as seen in the component inspector, upon loading complete.

The Solution:

Listen for the loaderInfo Complete event in the constructor and then have it call an initialization function.

public function MyDocClassConstructor():void
{
// listen for initial load to insure settings are active to set into global vars
loaderInfo.addEventListener(Event.COMPLETE, init);
}

private function init(e:Event):void
{
// remove the listener
loaderInfo.addEventListener(Event.COMPLETE, init);

// set your components visibility to false
myComponentBtn.visible = false;
}

By doing this you allow the application to complete loading before you start modifying attributes of your display objects.

Leave a Comment more...

dnelson

Unplugged
Developing For Museum Kiosks vs. Developing For the Web

by dnelson on Feb.04, 2010, under Software, Web

My name is Dave Nelson, and I am “the new guy” here at Boston Productions filling the role of interactive developer. Over the past few months, I have begun to adjust my methodology to be more in tune with developing compiled .exe files used in standalone kiosks. I thought in my first entry for the Back Room, I could share some of the simple differences between scripting for the Web versus a kiosk.

LOADING THE APPLICATION

One of the first and most obvious differences between the two is that many of our interactive programs are not meant to be viewed in an Internet browser. This instantaneously removes the need to detect bandwidth, create loading segments and develop for a full gamut of hardware and software capabilities. I now have the ability to develop on the machine that will be running the program, so I can observe the same experience that any end-user will encounter.

On the subject of loading, it’s possible to include more graphical assets in the Flash library, with less of a need to load graphics “on the fly.” Typically, in a Web application, I would try to get the .swf to load as quickly as possible and then load further assets as needed. This begets multiple loading screens. Oftentimes when developing for the web, it is better to have multiple short-loading segments, as opposed to a slow screen on the initial load. Many of today’s Web users will not wait very long and may get frustrated, ultimately navigating away from the site.

Typically, museum kiosks are started up once a day in the morning, before the museum opens. This means that despite a longer loading time, the compiled .exe file has to load only once a day, when no one is waiting for immediate information. During this initial load, the major graphical assets are loaded and will be available throughout the day; however, it is important to ensure your program is efficient and can run for a full day without excess scripts building on top of one another.

ADJUSTING TO TOUCHSCREENS

Another large difference is the use of touch-screens versus a computer mouse and keyboard. Of course, touch-screens have no “hover state,” and any graphical change or animation that occurs on a mouse event is typically associated with a “MOUSE_DOWN” listener. The “MOUSE_DOWN” event will typically trigger a highlighted state, while a “MOUSE_CLICK” listener will trigger the action derived from clicking on the interactive interface.

Before starting here, I didn’t imagine how programming for kiosks would be different from a Web application. As I continue developing interactive programming with Boston Productions, I look forward to contributing more to the Back Room.
Dave

 

Leave a Comment more...

Charles

How to Smooth The Adobe Air HtmlLoader

by Charles on Jan.29, 2010, under Software

In a recent project we worked on; the client was very adamant about being able to display a plethora of different types of unstructured data inside of a kiosk.  This included information that contained tables and images inside of the same display at the same time.  The content also included a plethora of font variations.  The length of content was greatly variable and really didn’t have any defined or repeatable structure.

If you are familiar with the flash text fields htmlText capabilities, you will see that it can render basic html.  However, this just wasn’t enough for this project so we decided to implement the Adobe AIR HtmlLoader which; from my understanding runs an instance of webkit inside of AIR.  It’s awesome being able to load web content directly into a project; but there is one huge problem with the HtmlLoader.  You can’t smooth the HtmlLoader!  If you rotate or resize the loader, you will quickly find yourself with an ugly, poorly rendered mess.

After thinking about the issue for a while, I came up with a solution.  The trick is to load the web content inside of the HtmlLoader, then use the BitmapData, and Bitmap classes to render out a bitmap of the HtmlLoader.  You will then be able to apply smoothing, size, and rotate the newly created bitmap without much distortion.

When using this technique you lose the ability to scroll and navigate web content.  Our whole point was to not let people know there was a web page being displayed inside the kiosk; so this methodology worked very well for us.
Below I have provided the class that I use in order to implement the smooth html loader functionality.  Be careful because my class is using some external references.  Namely Tweener as well as GenericNotifyEvent.

package com.bostonproductions.web {

import flash.display.MovieClip;
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.events.Event;
import flash.html.HTMLLoader;
import flash.events.HTMLUncaughtScriptExceptionEvent;
import flash.geom.Matrix;

import com.bostonproductions.events.GenericNotifyEvent;
import com.caurina.transitions.Tweener;

public class smoothHtmlLoader extends MovieClip {

public static var HTMLREADY:String = “smoothHtmlLoader_HTMLREADY”;
private var theBrowser:HTMLLoader;
private var htmlToRender:String;
private var smoothCap:Sprite;
private var rawSmoothCap:Bitmap;
private var scrollPosition:int = 0;
private var tryCenter:Boolean = false;

private var targetHeight:Number = 650;
private var targetWidth:Number = 720;

// Alter the native height based on the resize ratio
private var HeightResizeRatio:Number = 1;

public function smoothHtmlLoader(_HeightResizeRatio:Number = 1, _targetWidth:Number = 0, _targetHeight:Number = 0):void {
HeightResizeRatio = _HeightResizeRatio;

if (_targetWidth != 0) {
targetWidth = _targetWidth;
}

if (_targetHeight != 0) {
targetHeight = _targetHeight;
}

createHtmlViewer();
}

/*
* DATE: 10/14/2009
* AUTHOR: Charles Palen
* NAME: displayHtml
* DESCRIPTION: Tries to fit all the html into the instance of
* the HTMLLoader.  If it cant fit it all, it MUST return the
* non-fitting html.
*/
public function displayHtml(_HtmlToDisplay:String):String {
var nonFittingHtml:String = “”;

htmlToRender = _HtmlToDisplay;

loadTargetLocation();

return nonFittingHtml;
}

/*
* DATE: 10/15/2009
* UPDATE: 10/28/2009
* The html parser now splits html up into chunks in instances where there are tables and images
* If this occurs – especially in the case of a table – we want to be able to CENTER it.
*
* Added optional boolean to specify we want to examine the content height, and resize/center the browser
* based on it!
*
* AUTHOR: Charles Palen
* NAME: setScrollPosition
* DESCRIPTION: Stores what should be the vertical scroll for this.  Once the html content loads it can be set.
*/
public function setScrollPosition(_VerticalScroll:int = 0, _TryCenterBrowser:Boolean = false):void {
scrollPosition = _VerticalScroll;
tryCenter = _TryCenterBrowser;
}

private function createHtmlViewer():void {
theBrowser = new HTMLLoader();
theBrowser.width = targetWidth;
//theBrowser.height = targetHeight;

theBrowser.placeLoadStringContentInApplicationSandbox = true;

theBrowser.addEventListener(Event.COMPLETE, htmlLoaded, false, 0, true);
theBrowser.addEventListener(HTMLUncaughtScriptExceptionEvent.UNCAUGHT_SCRIPT_EXCEPTION, scriptException, false, 0, true);
theBrowser.addEventListener(Event.LOCATION_CHANGE, htmlClicked, false, 0, true);

theBrowser.paintsDefaultBackground = false;
}

private function destroyHtmlViewer():void {
if (theBrowser != null) {
theBrowser.removeEventListener(Event.COMPLETE, htmlLoaded);
theBrowser.removeEventListener(HTMLUncaughtScriptExceptionEvent.UNCAUGHT_SCRIPT_EXCEPTION, scriptException);
theBrowser.removeEventListener(Event.LOCATION_CHANGE, htmlClicked);

theBrowser.cancelLoad();

if (contains(theBrowser) ) {
removeChild(theBrowser);
}

theBrowser = null;
}
}

private function loadTargetLocation():void {
if( theBrowser != null ) {
theBrowser.loadString(htmlToRender);

}
}

private function htmlLoaded(e:Event) {
// Remove the event
e.currentTarget.removeEventListener(Event.COMPLETE, htmlLoaded);

// Set the vertical scroll
theBrowser.scrollV = scrollPosition;
// If the try resize boolean is set – lets try it!
// Dont center – just shrink it if possible
if (tryCenter == true) {
var resizedHeight:Number = theBrowser.contentHeight;
var resizedWidth:Number = theBrowser.contentWidth;

if (resizedHeight > targetHeight) {
resizedHeight = targetHeight;
}
if (resizedWidth > targetWidth) {
resizedWidth = targetWidth;
}

theBrowser.width = resizedWidth;
theBrowser.height = resizedHeight;
targetWidth = resizedWidth;
targetHeight = resizedHeight;
}

theBrowser.width = targetWidth;
theBrowser.height = targetHeight * HeightResizeRatio;
//var bitmapAsset:Bitmap = e.target.content as Bitmap;
//bitmapAsset.smoothing = true;
Tweener.addTween(this, { alpha:1, time:.1, onComplete:generateSmoothVersion } );
}

private function generateSmoothVersion():void {
// Create the smoothed version
var tmpImage:BitmapData = new BitmapData(targetWidth, targetHeight, true,0×000000);
// Draw it – the last parameter set to true is SMOOTHING – tmpImage will be smoothed
var transformMatrix:Matrix = new Matrix();
//transformMatrix.translate(0, 500);
tmpImage.draw(theBrowser, null, null, null, null, true);
//tmpImage.draw(theBrowser,
// Create the bitmap
rawSmoothCap = new Bitmap(tmpImage);
rawSmoothCap.smoothing = true;
smoothCap = new Sprite();
smoothCap.addChild(rawSmoothCap);
//rawSmoothCap.x = 50;
//rawSmoothCap.y = 50;
addChild(smoothCap);
// Destroy the heavy html components to free up some memory
destroyHtmlViewer();
//swapChildren(theBrowser, smoothCap);
//theBrowser.alpha = 1;
//smoothCap.x = 300;
//smoothCap.y = 100;
// Broadcast so that we know its ready
if(tryCenter == true) {
dispatchEvent(new GenericNotifyEvent(smoothHtmlLoader.HTMLREADY, false, true, true));
}
}

private function destroySmoothVersion():void {
if (smoothCap != null) {
if (rawSmoothCap != null) {
if (smoothCap.contains(rawSmoothCap) ) {
smoothCap.removeChild(rawSmoothCap);
}

rawSmoothCap = null;
}

if ( contains(smoothCap) ) {
removeChild(smoothCap);
}

smoothCap = null;
}
}

private function htmlClicked(e:Event):void {
// Auto go back to wherever we were
//theBrowser.reload();
//loadTargetLocation();
}

private function scriptException(e:HTMLUncaughtScriptExceptionEvent):void {
trace(”ScriptException:” + e);
}

public function destroyInternals():void {
destroyHtmlViewer();
destroySmoothVersion();
}
}
}

4 Comments :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...