Welcome to Mediasparkles

News : Flash

Pictures of the Macromedia buildings in San Francisco

Over the last six months or so I have taken a few pictures of the various Macromedia buildings. Why?

1. Because I love taking pictures.
2. Because I love putting stuff online that might be interesting to people who are interested in Flash.

There are currently three buildings with Macromedia offices in San Francisco: 600 Townsend aka The Headquarters, 606 Townsend aka The Flash Shack, and 99 Rhode Island aka The Black Enigma. Then there is an additional building of interest, 601 Townsend aka The New Building, which Macromedia is in the process of acquiring and will be moving people into at some point, as announced in August. I hope you find these pictures somewhat interesting.

Show me the pictures already!

 posted by Vera (1/27/2004 10:56:00 PM);




Notices and Blast, continued

After some reader comments I have decided to expand my Central Sample app slightly. Julian asked about setting up a link from a Notice back to the app. So the Notices now have engage links that will send info back to the app. The Notices also disappear after 30 seconds so that they don't clutter your screen.

Here is the new code on the app and pod side that creates a notice (changes in bold):

notice = new Object();
notice.name = "The console said hi!";
notice.description = "This is an example of a Central notice.";
notice.timeout = 30;
notice.engageString = "React";
notice.navigate = true;
notice.alert = true;
vShell.addNotice(notice);


The engageString property specifies which text to display as the engage link inside the Notice. In order to handle the user engagement, you have to write an onNoticeEvent function in either the app, the Agent, or the Pod or all of them, depending on which part of your app you want to handle the Notice event. I only included it in the app itself, and it looks like this:


onNoticeEvent = function(event, noticeData) {
   if (event.type == "engage") {
      star.gotoAndPlay("dance");
   }
}


Very simple. It just plays a little animation in the main app window, indicating that the engage link was clicked.

Adam asked how to use a Blast in another app once it has been blasted. So I made a new Central app that can receive the blasted zip code from the Sample app, the Zip & Area Code Info app. It also can receive zip code Blasts from Hilary Bridel's PostalCode Search app. Again, it's very simple and certainly no killer app; I was just trying to show how to use a Blast sent from another app. As you can probably guess, it is set up to receive a zip code from the Sample app and then do something with it. It connects to a web service to look up information about any U.S. zip code. It can also look up information about U.S. area codes, but I didn't set up a Blast for that.

To receive the zip code Blast from the Sample app, I have the following inside the Zip & Area Code Info app:

// function that is called when a Blast is received
onSelectedItem = function (data) {
   // loop through the data
   for (var i = 0; i<data.length; i++) {
      // this app only accepts addresses, so check for that
      if (data[i].address != null) {
         // display the received zip code in text field
         var zip = data[i].address.postalCode;
         container.selectedChild.inputText.text = zip;
         container.selectedChild.blasted._visible = true;
      }
   }
}


I also have to make a correction to my last post: For a Blast to work correctly, the <supportedTypes> element is only needed in the product.xml file of the app receiving a Blast. It is not necessary in the one sending a Blast.

Downloads:
Sample App v1.1
Sample App source files, updated (164K)
Zip & Area Code App v1.0
Zip & Area Code App source files (378K)

 posted by Vera (1/11/2004 12:56:00 PM);




Where is the Flash .NET community?

Aleks from dotnet-project.com emailed me recently asking where all the English-speaking community sites dedicated to Flash and .NET were. I told him that I didn't really know of any. There is the book, there is a small .NET forum on were-here.com, David Bisset just posted about a relevant article, but other than that, information on Flash and .NET is sparse. Aleks told me that there is a lot of crossover between the French Flash and .NET communities, and that the members of each help each other out.

Do you know of any good Flash .NET resources? If not, can I interest you in starting one? :)

Also, while we're on the topic, if anyone knows if there is a special setup required to have Apache/PHP and IIS/.NET running on the same machine, and if so, what exactly that setup looks like, please email me.

 posted by Vera (1/10/2004 10:45:00 AM);




Central Dev Chat shirt - my size, too!

I got the coolest T-shirt today - a Macromedia Central T-shirt with the Dev Chat icon on the front. I really think it's going to be one of my favorite T-shirts from now on. The best part about it is that it is a women's size. It actually fits! It's not big and clunky like all the other Macromedia T-shirts I have. Kristin mentioned just the other day that all the people in her neighborhood think that her husband is this hot shot programmer when he is seen sporting one of her geeky T-shirts she has collected over the years that are all way too big for her. I am proud of Macromedia for having included women's sizes in their Central spring line. I finally have a geek-shirt I can actually wear. Thanks, Mike!

Central T-shirt - front

Central T-shirt - back

 posted by Vera (1/08/2004 09:01:00 PM);




Picture from the Macromedia booth at Macworld

Macromedia at the Macworld conference, San Francisco

Please excuse the horrid quality; the picture was taken with my phone.

 posted by Vera (1/08/2004 08:04:00 PM);




Central sample app to teach you and me

I have noticed that although there are about one or two new Central apps out there a week, not a lot of developers make the source available. But if we want Central to spread like wildfire, we need to make it easy for people to learn. This is why I have made a little Central app for the sole purpose of demonstrating how the building blocks of a Central app work together. All the source files are available for download. The app doesn't really do anything besides open a pod, connect to an Agent via LCService, send notifications on button click, and blast! a zip code when you tell it to. I assumed that you know Flash and ActionScript, which is why the application doesn't really have any meat. And I am sure you have your own ideas for useful Central apps. This one is just for you to pick apart and learn from.

Here are some of the things I struggled with.

1. It took me a while to get the LCService connection to work. After reading Ethan Malasky's article titled Understanding and Using the LCService Library, I finally got it. Be sure to read that if you're running against a wall. The correct syntax is


// Creating the client, usually the app itself
serviceName = Central.LCService.createClient(agentName, clientName, this, false);
// Creating the server, usually the agent
serviceName = Central.LCService.createServer(agentName, this, false);


The variables serviceName and agentName MUST be the same on both the client side and the server side. Note that if you want this to be a synchronous service, the last parameter should be true on both sides.

2. I couldn't figure out how to make sure that only one pod is running for the app. I make a call to viewPod() during onActivate(). But I couldn't figure out how to determine if the pod was still open from the last time you viewed the app. I kept ending up with multiple identical pods whenever I started the app consecutive times without closing down Central inbetween. Here is how I finally solved that with the magical getViewedPods():


// get array of pods
pods = shell.getPods();
// there is only one pod for this app, so it must be the first in the list
myPod = pods[0];
// get viewed pods
viewedPods = shell.getViewedPods();
if (viewedPods.length == 0) {
   // if the array of viewed pods has a length of 0, no pod is currently
   // open for this app, so it's safe to open one; otherwise don't
   shell.viewPod(myPod.id);
}


So every time the app activates, I check if there are any viewed pods. I open the pod only if there aren't any.

3. After I set up the Blast! data according to the docs, I still wasn't getting the clickable Blast! icon in the lower left corner of the console. I knew I had followed the instructions properly. But there is something else you have to do that isn't in the docs, and Mike Chambers himself had to clue me in: You have to include some tags in the product.xml file that indicate that your app or your pod is set up to send out Blasts.


<supportedTypes namespace="http://www.w3.org/2001/XMLSchema" schema="http://download.macromedia.com/pub/central/schemas/CentralData.xsd">
<type>any</type>
</supportedTypes>


If the blastable data originates in the pod, you insert it in the <pod> tags. If it originates in the app itself, you insert it in the <application> tags. For my example, I put it within the <application> tags, and my Blast! feature was complete.

Let me know if you have any questions about this app.

Installer
Download source files

 posted by Vera (1/07/2004 08:53:00 PM);




Happy (MX) 2004!

Happy New Year, Flash community! It feels sort of weird saying Happy "New" Year 2004. Many of us have been living in 2004 at least since August.

 posted by Vera (1/01/2004 05:00:00 AM);