AS3 Basic Setup

July 4th, 2008 by graeme

Writing your first Actionscript 3.0 application with Flash CS3? Here is a quick guide to get the basics set up.

The basic set-up includes one .fla file and one .as file.

First create a fla. You can name this whatever you like. Maybe myFirstApp.fla. At this point you could start writing code directly into a frame on the timeline however best coding practice is to define a document class.

The document class can be specified by entering the name of a class into the property panel for the document. This is the same place where you would specify the size of your swf. Think of a name for your document class, maybe: myFirstApp. The document class doesnt have to have the same name as your main fla there is no link between them.

By typing myFirstApp into the property panel you are telling flash to create an instance of the myFirstApp class when the fla runs.

When compiling your fla flash will go and look for the code for the myfirstApp class. It will look for a file called myFirstApp.as by searching the directory the fla is in or in the directories specified under classpath from preferences.

The next step is to create the myFirstApp.as file. This just a text file with the extension changed to .as. Place the file in the same directory as your fla.

Contents of myFirstApp.as

package
{
import flash.display.Sprite;
public class myFirstAppextends Sprite
{
public function myFirstApp()
{
trace(”hi”);
}
}
}

The package tag places the myFirstApp class into the root package. Which means this class wont be stored in a subfolder just in the same directory as the fla.

The myFirstApp class extends Sprite. This means that the document class as well as having any further methods and propertys that you define will also have all the methods and properties of a Sprite. The import flash.display.Sprite statement lets the flash compiler know where to look for the definition of Sprite at compile time.

Note that the myFirstApp.as file should only contain a class called myFirstApp or you will get errors.

The document class unlike other classes must extend Sprite because the document class automatically represents the swf stage. Any movieclips instances you name and place on the stage at author time become properties of the document class and can be accessed by name from actionscript inside the class.
This part defines the constructor for the myFirstApp class.

public function myFirstApp()
{
trace(”hi”);
}

The constructor function for a class is a function that has the same name as the class and is called whenever an instance of the class is created. For the document class an instance is created when the swf runs. This means that the constructor is the entry point for our application and the trace statement is the first line of code to be executed at runtime. The creators of flash have borrowed these concepts from the java world.

And thats the basic set up!

Posted in flash | No Comments »

Positions at ECI

March 7th, 2008 by mark

The time has come for us to expand! We have had a fantastically busy time of it and now we require to add to our existing 3 man team.
Web/Multimedia Developer
We have a position for an exceptional developer to join our small but expert team. Industry experience of Flash, video and web development combined with fluency in a range of programming languages on both server and the client side e.g Actionscript, javascript, PHP, .Net, Coldfusion, Ruby or python (you get the general idea). Must be able to understand and integrate multiple technologies into state of the art web applications. An unhealthy interest in the future of the web and cutting edge technologies is encouraged. The ability to have a boring technical conversation about Rich Internet Applications will also excite us.
Designer/Account Holder
We also require a designer with the ability to multitask to work alongside our design team. We are looking for someone who lives and breathes web design and knows what they’re doing with valid XHTML/CSS, plus has an eye for contemporary graphic design for the web. Any experience with flash or with web development is most definitely a bonus. We expect this candidate to also have experience of communicating directly with clients and becoming a first point of contact, so confidence, persona and technical ability are all equally important here.
Both roles
It is important that any candidates are sociable and friendly, driven, fit in with the team and are absolutely passionate about what they do. We expect enthusiasm, creativity, ideas and a laugh. In return we offer a highly creative working environment and all the kit you need to get the job done. We are an open environment, we trust our team implicitly and we love to exceed client expectations. We also enjoy going for a drink/food/game of pool from time to time. Sound like fun? Send us examples of your work, a covering letter and a c.v…Remembering that we are seeking inventive, creative and nice people…surprise us!

The Contact Details

Post: Suite K, 5 Golden Square, Aberdeen. AB10 1RD

Email : info@ecinteractive.co.uk

Posted in ECI | No Comments »

Adobe launches Flash Media Server 3 (plus linux install notes)

January 29th, 2008 by Mike

Adobe have released the next version of their advanced streaming and interactivity server, Flash media Server (also previously known as Flash Communication Server). This release splits functionality between two versions - Flash Media Interactive server and Flash Media Streaming Server.

Read the rest of this entry »

Posted in audio, flash, server, video | 10 Comments »

Coldfusion 8 Launches

July 30th, 2007 by mark

The wait is over for the next major release of Coldfusion. Version 8 boasts some fantastic new features, integration with other technologies and some cool AJAX features, (we sneakily built a google suggest type application in about 30 minutes in our development environment for example). Go check it out here: http://www.adobe.com/products/coldfusion/

Posted in coldfusion | No Comments »

css shorthand

July 26th, 2007 by mark

ok, next up in our exciting tips and tricks for css is my personal favourite…”css shorthand”…why is this my favourite?…because this reduces the amount of code we have to write and also streamlines our css by making the file smaller and hence load faster.

There are several areas within css where you can use shorthand, I’m not going into them in great depth here but i will mention what they are, give you an example and you can feel free to investigate them further, this is not intended to be a complete and concise reference, merely a guide to help you on your way.

Read the rest of this entry »

Posted in xhtml/css | 2 Comments »

css classes and id’s

July 25th, 2007 by mark

css classes and id’s - which to use?

An id is used to define a unique element in a page, this is a requirement of xhtml and should be observed. In the xhtml we name it by stating the following:
id=""
and in the corresponding css we select it with the hash symbol(#item{})

A class may be used as many times as desired in a page. In the xhtml we name it by stating the following:
class=""
and in the corresponding css we select it with the full stop symbol(.item{})

here comes the science….

Read the rest of this entry »

Posted in xhtml/css | No Comments »

Wordizzlifier - words & images

April 4th, 2007 by Mike

I was pratting about with textorizer and thought It’d be nice if you didn’t have to mess about with a command line purely to textify your image. So here we have ‘wordizzlifier’ a combination of textorizer and imagemagick with ghostscript and some php, slapped behind a flash front end.

Type in a list of words, click ‘up’ to select a jpg image (lees than 200k / 1000px x1000 px), and about 20 secs later it should load the image back in. Once it’s loaded, you can click ‘down’ to get at the jpg.

Here’s an example pic of me and stu in Snafu on the lash, and its wordizzlified output.

Read the rest of this entry »

Posted in ECI | 2 Comments »

Adobe CS3 Launch webcast

March 27th, 2007 by Mike

It’s time for the next generation of Adobe creative products to be announced, “2 years + 80 million lines of code” they say, I’ve just watched their live webcast . . some things that caught my eye . .

Read the rest of this entry »

Posted in flash, multimedia, video, web talk | No Comments »

Debugging live swf

March 25th, 2007 by Mike

There are many times in a complex application done in flash you need to see how it responds in the field using live data on the web rather than purely tracing results in the Flash program itself.

My current toolbox includes:
Read the rest of this entry »

Posted in flash | No Comments »

Business Awards Ceremonies in glorious panoramic view

March 21st, 2007 by Mike

A couple of business awards ceremonies I attended last year, presented in a custom built flash panoramic viewer. The viewer has two modes (accessed via right clicking), one for slow pc’s (default) and one for faster pc’s using flash8+’s displacementMap effect to emulate perspective distortion a la quicktime VR. There’s a nice ‘lens flare’ type thing added to some lights too. Read the rest of this entry »

Posted in ECI, flash | No Comments »