There are three main ways to send data to a Flash movie:
FlashRemoting
LoadVariables
Appending to Object Tag querystring
The latter two methods are old-school techniques, and they have their advantages/disadvantages. LoadMovie and FlashRemoting allow you to load fresh data from the server, but they also require an event-handler. This event-handler is asynchronous (not immediate, not tied to timeline) so that your movie will know what to do at a later point in time when the data has finished loading.
If you want your data to load immediately, you'd use the querystring technique to append a URLEncoded querystring to the PARAM and EMBED tags in the Flash webpage's HTML code. This technique works well if you want to insert data *immediately* into a Flash movie before it plays. However, it pollutes the _root scope with variables, which deviates from good OOP programming style. The biggest problem, however, is caching... if you want a Flash movie to receive new data every time the user visits the site, then the appended querystring will force the user to download a new copy of the SWF.
Here's an example of what you'd see in your browser cache if each Flash webpage contained a different querystring in the OBJECT tag:
beta.swf?myvalue=1
beta.swf?myvalue=2
beta.swf?myvalue=3
beta.swf?myvalue=4
These are actual files you'd find in your TemporaryInternetFiles folder of your browser. If each swf took up 100kb, then your users would have downloaded 400kb for the sake of putting a unique value into a single variable. Doh!
With Flash 6, users can download a SWF movie once, and still be able to receive new URLEncoded information at the time of loading. Instead of appending the querystring of URLEncoded name/value pairs to the OBJECT Tag, however, you can use the Flash 6 tag called "FlashVars". Simply create a new param tag with the name "FlashVars", and set the value with the querystring. End result: same querystring, different location, users can now cache the swf.
For non-Microsoft browsers, simply create an attribute called "FlashVars" in your EMBED tag, and insert the querystring as its value.
Complete instructions can be found on the Macromedia technote# 16417 at http://www.macromedia.com/support/flash/ts/documents/flashvars.htm
This might be old news, but not everyone is aware of the features available in the new Flash player. I gave up looking for the URL to the player release notes, but suddenly found it again today. Please be aware that these notes refer to r40, and that a newer player has come out. However, most of the important changes came with r40, which is why I'm referring to that technote instead. For more flash player information, visit http://www.macromedia.com/support/flash/.
Here are upgrades to the Flash Player that I found most significant to my work, so I've selectively listed them here:
Universal Upgrades:
1. FSCommand and Javascript->Flash supported in Netscape 6.
2. ID3 support for imported mp3 files
3. Support for masking device fonts (only Actionscript-created masks)
4. Sound.start() works after calling Sound.stop()
5. Buffered streams can change volume
6. Textfields consume less memory!!!
For Windows:
1. Optimized for Pentium 4
2. Flash movies can play in Outlook Express
3. Flash is interactive inside IE layer with wmode attribute enabled (very important, I'm doing some crazy stuff with IFrames right now).
I think the ID3, buffered streaming volume, device font masking, and Netscape 6 javascript support are the five most significant reasons for users to update their players. I don't have any links to player detection scripts, but if you know of some good ones, feel free to post them in the comments section.
Finally figured out how to use WiFi cards to share an ethernet connection between my old laptop and the Thinkpad that the company gave me.
So finally moved into Chicago. Living in the suburbs takes some getting used to, especially after spending two years as a pedestrian in a happenin' college town like Ann Arbor.
Bevel Components Version 2.0 is coming out by the end of this week, without the free-style polygon component. The polygon bevel will take awhile longer (math is tricky), probably packged into Bevel Components 3.0 later. For now, I'm just going to include all the fixes, and add all the suggestions, including the one about a parameter to fade out the background area.
Every day at work is spent on Flash Communication Server. Back to work...
I'm still in the process of packing and moving, but in the meantime, just wanted to let you know that I've moved the Bevel Panel components to the top of my priority list. It seems that a lot of people are using the bevel panel components, and I've received many suggestions on how to improve them. Here's a partial list of planned upgrades for bevel components version 2:
1. Disable tab selection
2. Add public method to invert bevelling
3. Add documentation (as soon as I can use CyberSage's FlashDoc software to document my code)
4. Optimize the rendering, even though it's pretty optimized already
5. Create a user-defined polygon bevelling component, so that you can create angular shapes more complicated than regular rectangles.
6. Create a component with the ability to save, retrieve, and set StyeFormat properties of other specific components on stage.
If you have any other ideas, code fixes, or patches, just let me know. I guess we're going to develop these components the open-source way :)
-Sam
I'm in the process of packing for the big move to Chicago next week. Here's an update of current projects, and some hints of upcoming projects to be announced very soon:
1. Live Preview source code added to the Bevel Components. Click here for the updated article with links.
2. Official website of OOP Actionscript Book with downloadable source code - we're working on it, and the book's coming out soon. The website will also feature extra materials that we haven't announced yet.
3. I've grown quite addicted to developing applications with the Flash Communication Server these days. My new job focuses heavily on building real-time collaborative environments with FlashComm and Flash, so you can expect plenty of tutorials and source code for multi-user Flash over the next year. I can't describe how thrilling the past 4 days have felt, as I've finally started seeing the "big picture" behind FlashCom technology. Like any new technology, the learning curve is steeper because we're breaking new ground. Don't worry though... I plan to document my own progress step by step, as I learn new patterns and techniques for multi-user applications with Flash MX / FlashCom Server.
4. Internet controlled Lego robot with wireless camera - This project is still ongoing. Once I gain more experience and knowledge with the FlashCom technology, you will see a whole lot more than robots. I've got plans to wire up my entire apartment with wireless cameras, and design an interactive floor-plan with real-time transmissions. Actually, I've got crazier plans than that, but some of it involves R&D for my new employers, so I can't talk about those ideas yet.
5. Packing for the big move to Chicago. If anyone has suggestions for a good broadband ISP, please email me. I plan to run a server, and have considered Speakeasy.net for their high quality DSL service.
6. Preparing to speak at Macromedia DevCon in September. They invited me to speak about a topic that I'm very passionate about: Information Visualization with Flash. I'll cover topics like Exploratory Data Analysis, Actionscript techniques for data-generated graphics, and real-time visualization of multi-user events. It's going to kick ass. 'nuff said ;-)
Tune in next week for more fun stuff!
-Sam