background preloader

Tutos

Facebook Twitter

Getting Warmer: Smart Aiming With Heat-Seeking Missiles. In the previous tutorial we had a homing missile chasing after a single target. This tutorial will show you how to convert your homing missiles into heat-seeking missiles for multiple targets. If you haven't read the first Homing Missile tutorial, you may download this .zip file, which contains the source code we'll be starting with on this tutorial. Final Result Preview Let's take a look at the final result we will be working towards: Step 1: Modify the Cannon Graphic The only Movie Clip in the Library we'll need to change is the Cannon, since we'll make it aim at the closest target before shooting. Remember that 0° of rotation means pointing at the right, so make the graphic accordingly. Step 2: Declare Distance Variables for the Cannon Now the targetX and targetY variables will be already declared for the playGame function: Step 3: Make the Cannon Point Towards the Target Now the cannon rotates in relation to the target's position.

Step 4: Match the Missile's Rotation with the Cannon's. Build Better Flash Banners | Activetuts+ Flash banner development is often plagued by multiple files, fragmented code and messy timelines. This tutorial will show you how you can create a project template to serve as a solid base which will help you develop robust flash banners quickly, freeing you up to focus on bringing the creative idea to life. Step 1: Setting Up Project Folder Structure When building multiple flash banners, good file management is essential to keep your workflow efficient.

Start your banner project template by creating the folder structure shown below: Step 2: Creating A Photoshop Template Now we are going to create a set of Photoshop templates to use when starting to design a flash banner campaign. The Wide Skyscraper (160px wide x 600px tall)The Medium Rectangle (300px wide x 250px tall)The Leaderboard (728px x 90px tall) Let's start by creating the template for The Wide Skyscraper. Step 3: Adding Layer Groups Step 4: Save Now your template is ready to save. Step 5: Creating Your Flash Project Now (at last!) Create a Mac Dock Style Menu with AS3. In this tutorial I'll show you how to create a menu like Apple's Dock using AS3 classes. We will create a single AS file that will perform all the magic, extending it to add new features. Republished Tutorial Every few weeks, we revisit some of our reader's favorite posts from throughout the history of the site. This tutorial was first published in March of 2010. Final Result Preview First, let's take a look at what we'll be creating.

Roll your mouse over the icons to see how they move and scale. Step 1: Create a New ActionScript File Begin by creating a new ActionScript file and saving it as "DockItem.as". Note that our document root (where the .fla lives) will be c:/macmenu; the folder /org/effects will form the package for the DockItem class. Step 2: Create a New FLA Create a new ActionScript 3.0 Flash File and open it, so that we have both DockItem.as and this .fla file opened. Step 3: Import Icons Now we import or draw some icons to the .fla. Step 4: Begin Converting Icons to Symbols. AS3 Button | How-To-Code.com. Written by Philip AS3 Button Tutorial Coverage AS3 Buttons are buttons that are created in ActionScript 3. Actionscript 3 is of course the coding language used to program the Adobe Flash Platform, which Flex and AIR are part of.

If you are using Flex you may want to create a Flex button, which I do not cover below, but is covered here It will cover: i. Ii. Iii. Note : We will not cover creating a button within the Flash IDE. What is an IDE? New to Actionscript 3, Flash, Flex or AIR? If you are new to Actionscript, Flex, or AIR and you do not have enough cash to purchase the full license for Flash Builder, FDT or IntelliJ, like me!

Which is an open source development environment for Flash, Flex and AIR. Ok now lets get this show on the road. AS3 Button creation using Actionscript 3 First step is to create your graphic that you will use as a button. Let's import the flash graphics class. 01. 04. 07. 10. 1. 1. David Stiller’s blog » Blog Archive » How to Load External Flash Video (FLV) Files (AS2) Note: This article has a companion piece, “How to Control Video (FLV) without a Component.” An ActionScript 3.0 version of this article is located in a more recent entry of this blog.

It has been possible to load external video into a movie since Flash MX (aka Flash 6). Loading FLV files, however, isn’t nearly as intuitive as loading other external media, such as SWFs, JPGs, MP3s, and the like. The MovieClip.loadMovie() method, for example, loads an external SWF with a single line of code. Not so for FLV. So how is it done? Many people take the route of one of the Flash MX/Flash MX 2004 Media Components or the Flash 8 FLVPlayback Component. An answer, short and sweet Let’s get to business, then. Click on the Options menu of your Library panel (the square-ish icon in the upper right corner) and choose New Video….Drag an instance of your new video object to the Stage. How it works NetConnection is designed to provide playback of streaming FLVs from a local drive or HTTP address. AS3 Avoider Game Part 5: A Score and a Clock — Michael James Williams. Table of contents for AS3 Avoider Game Tutorial (This tutorial is also available in Spanish) Introduction In this part of my AS3 conversion of Frozen Haddock’s avoiding game tutorial, we’ll add a score and a clock, to give the player some mark of their skills.

It’s a long part, but there’s a part in the middle that’s a good point for you to break off and come back later, if you don’t feel like doing the whole thing now. Click the image below to see the result of this part in action: If you’ve not been following the tutorial so far, grab the zip file of the game so far here and extract it somewhere. Open the FLA file, and let’s get started. Everything Counts When you think about it, a clock and a score are basically the same thing. If we made a Clock class and a Score class, they would therefore both contain a variable, of type Number, for storing time passed or points scored. They’d also both need to have three functions in common: What they probably won’t have in common is the visual display.

Use and Performance of the Timer Class in ActionScript 3 and Flash. One of the new classes introduced in ActionScript 3 is the Timer class. The class, in essence, replaces the AS2 setInterval and clearInterval functions. (Those functions are still present but deprecated in AS3.) In this How-To, we show a simple example of using the Timer class and discuss briefly performance issues related to the Timer class.

Download Download all the well-commented source file corresponding to the applet above, eztimer.fla. eztimer.fla The Code in eztimer.fla The file eztimer.fla was created in Flash CS3 with the standard frame rate of 12 fps. Var startTime:Number; var timeElapsed:Number; /* We enable tabbing for the two input textboxes and disable it for the button. TxtRepeatCount.tabEnabled = true; txtMilliseconds.tabEnabled = true; btnGo.tabEnabled = false; /* We restrict the characters that can be entered in the input boxes.

TxtRepeatCount.restrict="0123456789"; txtMilliseconds.restrict="0123456789"; var tm:Timer = new Timer(100); function timerFires(te:TimerEvent):void { ActionScript 3 Event Listeners Tips & Tricks | Almog Design. Loading images and Library assets with ActionScript 3. While the previous example is simple and functional (and you can continue to create new Loader object instances each time you add an external image), there are other, more robust strategies you can use. Creating Loader objects that are more flexible and efficient requires a thorough understanding of the loading process. Within the Loader object instance, the bitmap data from the referenced image is placed within a Bitmap object.

Loader objects load images as bitmap data, but then place the data in a Bitmap object (again, a Bitmap object references a BitmapData object). The Bitmap object instance is the content (child) of the Loader object instance. The hierarchy for this structure looks like this: Loader object > Bitmap object > BitmapData object. The Loader is now the primary display object for the image data. This example simply makes one call to the external image. Specifically, the following example sets up some variables to use in the functions of the provided code. Example. Create a typewriter effect with AS3 | FlaDev. Adobe Flash CS4 Professional * Add video to Flash. [AS3] Load External swf into MovieClip & Play/Pause/Forward/Rewind and Stop it at LastFrame from Main Flash Movie | Ali Qureshi's Blog. Feb Loading external swf into a MovieClip inside your main Flash movie is a routine job and ActionScript3 allows you to do that quite efficiently.

What AS3 does not provide you are the built-in functions to control loaded swf file timeline from your main movie. I initially tried to find some built-in functions to control the loaded swf timeline but found nothing because there are none available. After a bit of head banging, solution turned out to be a very simple one. I just needed to create a MovieClip Object to store the loaded swf reference, Type casted the loaded content of swf into a MovieClip and simply added the Event Listener for itself to control the timeline on entering every frame. Simple! Isn’t it? Now enough with the logic, let’s get to the actual AS3 code and see how I managed to do all of this.

Create a new MovieClip Symbol, and name it “swfPlayerBt”, check the ‘Export for ActionScript’ checkbox and click ok. Hope that helps. Cheers! Using the Drop Shadow Filter in AS3. By kirupa | 14 June 2009 Flash has had what are known as filters for quite a while. Filters are basically pre-made visual effects you can apply to your movie clips, and you probably know them more commonly as just Blur, Drop Shadow, Glow, Bevel, etc. The most common way for you to use filters is via the Filters category in your Properties panel: You can quickly point, click, and modify any properties your filter exposes for you: Like many things, there are times where you will use filters entirely via the UI as seen in the screenshots above.

For applying a Drop Shadow filter, the following shows the least amount of code you will need to make all of this work: function init() { var dropShadow:DropShadowFilter = new DropShadowFilter(); myMovieClip.filters = new Array(dropShadow); } init(); All you need to do to use the above code is replace myMovieClip with the instance name of the movie clip you are interested in using. Var dropShadow:DropShadowFilter = new DropShadowFilter(); Need Help? Share. GotoAndLearn() - Free video tutorials from Lee Brimelow on Adobe Flash. ActionScript 3 Tutorials.