Skip to content

Posts tagged ‘Flash’

21
Oct

Fun with the Flash Media Server

We have Flash Media Server 3 to dish out our streaming videos. Eventually, the company also wants to develop a live streaming video service that lets people watch any event we are covering: conventions, shows, meetings, etc. With the Flash Media Encoder, it takes literally seconds to set up a live streaming video. The main downside to the Encoder is its platform. The convenient little application is only available on Windows XP. And, from what I read in the forums, it doesn’t work on Vista. Since it’s a free application from Adobe, there is no official support for it and they aren’t planning on developing it for other platforms either. Too bad, really, because a Mac version would be nice to have.

It didn’t take long for my boss to ask if we could custom build our own Flash application that could do what the Flash Media Encoder did. I started with the basics, but without all the tools to build what we need, I can only create a wooden wheel. I have Flash and FTP access to post files. For anyone else starting with the rudimentary tools and access like my situation, you might find these articles handy.

How does live streaming video work and where do I need to put my files?
Overview of streaming with Flash Media Server 3

How do I build my own application that works similar to the Flash Media Encoder?
Building a Simple Live Video Broadcaster and Receiver

Other tutorials are offered on Adobe’s site, but these two did the best job of answering all of my questions. The second article builds the application in ActionScript 2 and does a better job of explaining why and how it works.

6
Dec

Help Resources

There are days when tutorials just won’t cut it. Is your question too advanced for the forums? Need to talk to a person instead?

Try connecting to a community of developers. Yahoo! Groups and the Figleaf Mailing Lists are great ways to find and talk to the pros. The ones I subscribe to are:

Some quick tips before asking your first question:

  • Search the archives. Chances are good that someone else had the same trouble.
  • Be specific. If your question is too broad, it won’t get answered.
  • Be brief. 2 page diatribes aren’t read. They’re trashed. Bonus points for clear, concise messages.
  • Try a format. E-mails that can be skimmed are good. The ones that get responses are similar in format: a short paragraph to explain your problem, a question at the end of it, a few lines of code after. Complex questions sometimes have 3 paragraphs, a question or two, then some lines of code.
  • Mark it OT if it’s a discussion question or off-topic. It signals to others that its something to read at leisure, not a pressing issue.
10
Jul

Adobe AIR Beta Released!

Once code named Apollo, this project has been unveiled to the developing community and will be officially announced tomorrow. Download it here.

What is the big deal about AIR? The Adobe website defines it as “a cross-operating system runtime that allows web application developers to use their existing web development skills (HTML, Javascript, Adobe Flash, Adobe Flex, Ajax) to build and deploy rich Internet applications to the desktop.”

Why is this a big deal for web developers? Because the ability to take one’s web programming knowledge offline and apply it to the desktop is huge. And, it is not browser or platform dependent. Say goodbye to addressing Internet Explorer bugs or being forced to rehash the discussion of Mac-vs.-Windows.

What are you waiting for? Check out the showcase for some amazing ideas already brought to life.

5
Jul

Having a little fun

Here is a fun little project I worked on in my spare time for Cheryl Klein, the continuity editor of the Harry Potter books. Thanks to Melinda (who knows I am a fan of the books) for so thoughtfully connecting the two of us!

29
Mar

Taking a Crack at Flash Components: DateField Components

Informal Tutorial – Intermediate

DateField Components

Learn how to calculate days in between two dates, using two DateField components.

After learning some basic concepts with the DateChooser component, it took me less time to build the ADG calculator using two DateField components. Unfortunately due to some legal concerns I can’t show my finished calculators just yet. I won’t bore you with the details, we’ll just get on with the tutorial.

Once again, using Flash Pro 8 and ActionScript 2.0 in an actions layer. For larger projects I would export the code, but for smaller ones it’s easier not to have to keep track of an .as file and a .swf file.

  1. Create three layers: Components, Text and Actions.
  2. In the Components layer, drop two DateField components onto the stage, instance names my_df and my_df2. Drag a plain button onto the stage. Give it an instance name of calculate_btn.
  3. In the Text layer, create a dynamic text field, instance name message_txt.
  4. In the Actions layer, add this code:
import mx.controls.*
var my_df:DateField;
calendar = new Object();
calendar.change = function(eventObj){
	date1 = my_df.selectedDate;
	year = date1.getFullYear();
	month = date1.getMonth();
	day = date1.getDate();
	my_df2.disabledRanges = [{rangeEnd: new Date(year, month, day)}];
}
my_df.addEventListener("change", calendar);

var my_df2:DateField;
calendar2 = new Object();
calendar2.change = function(eventObj){
	date2 = my_df2.selectedDate;
}
my_df2.addEventListener("change", calendar2);

function calculateIt(){
	totalDays = date2 - date1;
	numDays = Math.floor((date2 - date1)/86400000);
	trace("totalDays var = " + totalDays);
	trace("numDays var = " + numDays);
	message_txt.text = "Number of days in between are " + numDays;
}

calculate_btn.onRelease = function(){
		if(isNaN(date1) || isNaN(date2)){
			message_txt.text = "Pick dates.";
		}
		else{
			calculateIt();
		}
}

You can see some of the elements from the DateChooser tutorial are repeated here. Skipping down to the first new line of code:

my_df2.disabledRanges = [{rangeEnd: new Date(year, month, day)}];

this line prevents the second calendar from picking a time in the past of the first chosen date. Handy feature that is often seen when you book your flight/hotel/car online. The calculator button serves two purposes in this example. One is screening out a basic error and the other is to run the

calculateIt()

function. This function is has been simplified to the basics, but this is where you would put the more complex error checking and error messages in. Next we have:

	totalDays = date2 - date1;
	numDays = Math.floor((date2 - date1)/86400000);

While the first line does the actual calculation, the second puts it back into readable form – converting it from milliseconds to days. And that’s it! You can use this plain vanilla .fla for reference if you are having trouble.

Questions, comments and complaints are welcome. Let me know what I can do to improve this tutorial.

Related Posts: