Author Archives | solo1artist

Create A Flash Countdown Timer in AS3 Using A Class

Create A Flash Countdown Timer in AS3 Using A Class

Due to the popularity of one of my earlier posts, I’ve decided to extend the topic with a helpful Countdown Timer class. This handy utility provides a flexible and easy way to tie in countdown timer functionality into just about any design. It is designed to handle the grunt work of developing a Countdown Timer. It is not meant to replace the Countdown Timers available to the Flash community. It is purely meant to easily implement Countdown Timer functionality to you own custom design without reinventing the wheel.

Features Include:

  • Easily define a new Countdown Timer instance
  • Access to the countdown’s remaining days, hours, minutes and seconds
  • Easily update the target end date
  • Custom events that trigger upon Countdown updating and on complete

Getting started creating a fresh Countdown Timer

Implementing your new countdown timer design will require minimal ActionScript as the this utility will handle key events and updating of the remaining time.  All you need to implement this countdown functionality is a design and some time.  Enjoy!

Step 1: Importing the necessary classes

In order to use this utility within your Flash file, you would need to import the following two classes: CountdownTimer.as and CountdownEvent.as. Note: Make sure that the classes are local to your .fla file or if you are more comfortable modifying your ActionScript settings to accommodate the location of the classes, feel free doing so.

// Importing of the CountdownTimer Class
import com.flashspeaks.utils.CountdownTimer;
// Importing the CountdownEvent (used to update and notify upon countdown completion)
import com.flashspeaks.utils.CountdownEvent;

Step 2: Creating a new Countdown Timer Instance

Creating a new instance of the Countdown Timer is as easy as defining a new Countdown Timer instance and providing the target end date within the parameter. The values needed are the target year, month, and day. There are also optional hour and second values just in case you needed extreme flexibility in the target end date.

// This creates a new CountdownTimer instance and sets it target end date
var myCountdown:CountdownTimer = new CountdownTimer(year, month, day, hour(optional), second(optional));

Step 3: Retrieve the remaining days, hours, minutes, and seconds

In order to provide flexibility, I have provided public properties to obtain the days, hours, minutes, and seconds remaining separately allowing you to determine how you would like to display the remaining time. There is also a property called time that will return the remaining time as a whole number separated by colons. (00:00:00:00)

In order to retrieve the time, a new COUNTDOWN_UPDATE event listener needs to be established as it will be mapped to a function that will update upon every tick. It can be easily done like so.

myCountdown.addEventListener(CountdownEvent.COUNTDOWN_UPDATE, onCountdownUpdate, false, 0, true);

function onCountdownUpdate(e:CountdownEvent):void {
 // Update on screen visuals like text
}

Countdown has expired…what to do?

One of the requested key features was a way to easily determine when the countdown had expired. Some wanted to load a new timer, change on screen text to read 00:00:00:00 ,etc. Setting this up using CountdownTimer is fairly easy. To do so, you would essentially create a new COUNTDOWN_COMPLETE event listener and supplying what it is that you would like to occur within the event handler function. Check it out below!

countdown.addEventListener(CountdownEvent.COUNTDOWN_COMPLETE, onCountdownComplete, false, 0, true);
function onCountdownComplete(e:CountdownEvent):void {
 // Countdown finished...
 // HAPPY NEW YEAR
}

Change the target end date on the fly

Another huge request was to provide a solution to easily update the target end date via run-time. CountdownTimer provides a function called updateEndDate(new Date()) which allows you to simply provide a new target end date through its parameter. Your on screen visuals will automatically update to accommodate the new end date.

For example, let’s say you wanted to add a month to the target end date every time that it has expired you can to so by simply adding one month to current month within the onCountdownComplete event handler.

Complimentary Flash Countdown Timer design

What’s good Countdown Timer functionality without a good Countdown Timer design? Here’s a complimentary design that I will be providing with the download. It includes the example source and provides all of the source from this tutorial. Feel free to implement your own design! I’d love to see them!

Get Adobe Flash player

Download example files

Posted in Custom Classes, Flash Tutorials0 Comments

How To: Reverse Any Given String Using AS3

How To: Reverse Any Given String Using AS3

Reversing a string is not something you might implement on a daily basis, however, having a handy way of doing so is always a great go to option. Here is a function that allows you to input a string of any length and it will then be outputted being reversed. This is definitely one function to add to your Flash utilities.

Enjoy!

Reverse Any Given String

function reverseString(tString:String):String {
var tmp_array:Array=tString.split("");
tmp_array.reverse();
var tmpString:String=tmp_array.join("");
return tmpString;
}

Source Demonstration

Get Adobe Flash player

Download source

Posted in Snippets3 Comments

Adobe Wave: A Wave of Content Right On Your Desktop

Adobe Wave: A Wave of Content Right On Your Desktop

At last year’s Max conference, a new Adobe technology called Adobe Wave was revealed that demonstrated how web content publishers could easily publish notification to their user’s desktops.  The Adobe Wave client is built on Adobe AIR allowing users to receive near real time notifications of new content, a new social interaction, or another notification that the publisher would like to let you know about.

Earlier this summer, this previewed technology was added to Adobe Labs for both users and publishers.  For those of you that have ever used Growl notifications for Mac OS X, the style of notifications is very similar.

Adobe Wave ScreenshotThe Potential of Adobe Wave

Personally, I feel that Adobe Wave has some legs and if widely adopted can provide a streamlined connection with the content publisher and user.  As web users, we are always looking for a way to stay on top of the web’s content.  Adobe Wave simply provides content publishers the right tool to do just that in almost real time.

Overall, I think this is an exciting technology and indicates that our needs of how we receive our content are evolving.  This is definitely something I will be keeping a close eye on.  Don’t forget to check out, the video overview for both publishers and consumers.  Also, for more information, visit Adobe Wave on Adobe Labs.

Posted in Adobe AIR Applications, Latest Adobe AIR News0 Comments

Flash Making Its Way To The iPhone?

Flash Making Its Way To The iPhone?

The day that many Flash Developers/Designers have been waiting for is finally approaching.  Well…not quite exactly.  Earlier this week at Adobe Max 2009, Adobe provided a sneek-peek to some of the new features that Flash CS5 will be shipping with.  The one feature that is getting many excited(and for good reason) is the ability to export your Flash applications into Apple iPhone applications.

Export to iPhone

Flash Professional CS5 will allow you to set your publish settings to “iPhone”. This will compile your movie as a native iPhone application that can be submitted to the Apple AppStore.

A New Door Has Opened

This opens a whole new door for Flash Developers/Designers. The ability to get your content displayed to an already trendmously large iPhone user base.  Hey, if this is the compromise of not having a Flash Player based within Safari on the iPhone, then I can definitely live with that.  Quite honestly, this might turn out to be even a better solution.

Additonal New Features Shipping With Flash CS5

Along with being able to create iPhone applications, Flash CS5 provides some other sorely needed features like:

  • Improved ActionScript editor
  • Code Snippets panel
  • Flash Builder integration
  • XML based FLA files

Resources:

Article: Developing for the Apple iPhone using Flash

Aditya Bansodof of Adobe breaks down how this all came about.  He gives a breakdown on the technology behind this conversion and how to go about creating/submitting a Flash generated iPhone application.

Video: Building Applications For iPhone With Flash Professional CS5

Learn how Adobe is working to bring Adobe technologies out of the desktop and onto a the iPhone. Learn how Flash Professional and the Flash platform will add capabilities to help developers iPhone enable, test, and publish their content.

Current Flash Apps Already Available via the Apple App Store

Fickleblox Flash iPhone GameLoving the hype!  You can already check out a handful of Flash generated iPhone applications via the Apple App Store.  The list of Applications include Chroma Circuit, Trading Stuff, Fickleblox, Just Letters, South Park, That Roach Game, and Red Hood. Enjoy!

For more additional resources and an update on release of Flash CS5, check out Flash CS5 on Adobe Labs.  Also, Flash CS5 beta is expected to be released prior to year’s end so be sure to sign up to get notified when that does happen.

Posted in Industry News1 Comment

Adobe TV Redesigned and Looking Fine!

Adobe TV Redesigned and Looking Fine!

Adobe TV gets a long awaited redesign that I am sure all users will come to love and appreciate.  While the original Adobe TV got the job done, it simply was not up to par in comparison to other popular video sharing sites.  I personally feel these new features add so much more value to Adobe TV.  It now feels more natural of an experience.

New Features Added to Adobe TV are:

  • Loading speeds vastly improved
  • Easier/faster search capabilities
  • Customizable home pages
  • Save your favorite videos to a personal library
  • Post videos directly to your favorite social network

Video: Adobe TV Wasn’t Built in a Day

Check out this video and let the Adobe ones break down these new feature upgrades.  Also, don’t forget to visit Adobe TV to experience these new features yourself.

Posted in Industry News1 Comment

Having Fun Promoting Adobe MAX!

Having Fun Promoting Adobe MAX!

With Adobe Max 2009 slowly approaching, there is nothing like a little promotional humor.  With all the personalities in the industry, it is always nice to catch them in a moment of humor.  Check out this promotional Adobe Max video starring Lee Brimelow, Phillip Kerman and the PR guy.  Funny!

Posted in Industry News6 Comments

FluidHTML: A Markup Language That Generates Flash Content

FluidHTML: A Markup Language That Generates Flash Content

“FluidHtml is a text-based markup language (like HTML) that lets you dynamically generate Flash  content. This is an extraordinarily powerful idea.  It means that anyone can build highly animated websites, ads, media players and 3D animations quickly and easily.”

FluidHTML looks to be an innovative concept and may address current issues related to Flash content on the web.  However, I believe web designers/developers who currently use HTML/CSS might find this much more attractive than Flash designers/developers.

I really like the concept of offering an extensible API and opening it up to developers, but is this going to be a viable markup language 5 years from now or is it just a phase.  As ActionScript libraries that support browser-like functionality improve and as Google and Yahoo’s search engine’s begin to recognize the text within Flash files, does FluidHTML really fix anything that isn’t already steadily improving.

I believe FluidHTML does have potential however, I am not sure if Flash designers/developers will buy into the concept.  Check out the introductory video below on FluidHTML.  I’d love to hear how you guys feel about FluidHTML after viewing the video.  Would you consider using it?

Posted in Industry News13 Comments

Flash and Flex Developer’s Magazine

Flash and Flex Developer’s Magazine

Flash and Flex Developer’s Magazine is one of few magazines that target Flash and Flex development.  It offers tutorials, product reviews, and articles from the industry’s talent.  Recently, this up and coming magazine subscription has gone digital and completely FREE!

September marks the first month of this free digital publication.  They are also, providing downloads from previous months.

Download your copy now!

Current Issue: Study of Flash Media Server

Flash & Flex Magazine 05 2009

  • Putting “Brains” into Flash Apps…
  • News Digital Media Toyota Tarago Campaign Driving a Difference…
  • Working with MySQL Database from Flash Media Server Server-Side
  • Adobe Flash Media Server 3.5…
  • Streaming to Flash and iPhone with Wowza Media Server 2 Advanced…
  • Wowza Media Server…
  • Options When Planning a Video Application With FMS…

Previous Issue: Branding for Developers

Flash & Flex Magazine 04 2009

  • Creating a game using WOW-Engine…
  • How to monetize your game?…
  • So you’ve written your AIR application, now what?
  • Five Reasons Enterprise Developers Learn Flex…
  • Bring Flash content into the social realm of Facebook…
  • Rich Components with Flash and Flex…
  • ActionScript 3.0 programming paradigms, and code organization Through OOP

Posted in Industry News0 Comments

FlashEff 2 Giveaway: Win a Premium Unlimited License

FlashEff 2 Giveaway: Win a Premium Unlimited License

Thanks to the guys over at Jumpeye, I have two premium unlimited licenses(valued at $99) that I will be distributing to two lucky users.  To win a license, be sure to provide a comment stating how FlashEff can be useful to you.  There must be an unlimited amount of ways to integrate FlashEff into your project workflow, let’s hear yours.

Comments entry will be closed next Friday, September 18th.  Users will be notified the following Monday.  Good luck!

Update:

Two winners, Nicolas and  Paulo Figueiredo, were selected with the ‘true random’ number generator at random.org and have been notified via email.  Thanks to those that commented.

Posted in Contest Giveaways10 Comments

Creating a Button Using FlashEff 2

Creating a Button Using FlashEff 2

In a previous post, I introduced the release of FlashEff 2 as an innovative Flash animation tool. In an attempt to prove my point, I am going to demonstrate how you can use FlashEff 2 to create a button using a MovieClip object.

OK, I know some of you might be thinking, a button? Well, creating a button in AS3 can be somewhat of a pain. After you get through creating your buttons, adding its functionality along with creating its appropriate event listeners; this process can get very old and tiring. Since FlashEff is here to simplify your workflow, why not let FlashEff handle your button’s functionality, animation and event listener creation.

Using Button Mode

In FlashEff 2, you can edit a button using its Button mode. This mode will allow you to assign your button some actions like following an URL, calling a function, or even going to a different frame whenever it gets clicked. All this without one single line of ActionScript. Here’s how!

Creating a Button Object

I am going to take a button graphic/design and create a MovieClip out of it. Once created, I will go into my Component Panel and drag a copy of the FlashEff2Button component onto my newly created MovieClip. One other great thing about FlashEff is that upon dragging a copy of its component onto the target object it will snap to the target’s 0,0 position.

FlashEff: Snap to Object

Now it is time to toy around with the FlashEff Panel.

Using the FlashEff Panel

The FlashEff Panel is where all of the magic happens. Here you can select any of the preset effects/animations that an object can have. Once you’ve added a preset, you can then preview an example of it via the live preview feature of the panel.  Take it for a test drive.

FlashEff Panel

Adding my Button Effect/Animation

In this example, I will select the “HappyTurn” preset. Now, if I wanted to I can modify the presets; allowing me to then save my own “custom” preset.  (Feature available only if you have the Premium Plus license) You can also adjust the tween type and speed for the up, over, and down button states. Just to keep things simple, I won’t be doing any of that.

FlashEff: Happyturn Preset

Adding Commands to the Button

FlashEff’s Button mode comes equipped with its assortment of commands that you can trigger upon press. They include adding a sound, calling a function, going to a keyframe, navigating to a URL, playing back a sound, and switching objects. Also, you can even stack these commands which will allow you to trigger a sound, call a function, and navigate to a URL on one press.

In this example, I will be adding a sound playback on press along with an event to navigate to a URL upon double clicking the button object. When attaching a sound you can identify that sound through a linkage ID or path.

FlashEff: Custom Commands

Overview

Below, you can find the final result of this mini demo.  Basically, the button, upon rollover, triggers the HappyTurn animation, then on press a click sound will trigger.  Now, if you double-click it will take you to the designated destination, Google’s homepage.  The custom possibilities are endless.  The more you use FlashEff the more situations you can picture yourself using the tool to simplify your project’s workflow.  To learn more on what FlashEff can accomplish, visit FlashEff.com.

Get Adobe Flash player

FlashEff 2 Giveaway Opportunity

In the upcoming days, you are going to have the opportunity of winning 1 of 2 FlashEff 2 unlimited premium licenses.  Stay tuned…

Posted in Flash Tools, Flash Tutorials0 Comments

Page 1 of 2812345...Last »