| Subcribe via RSS

Create Cool Line Effects using Actionscript 3.0

May 19th, 2009 | 2 Comments | Posted in ActionScript 3.0, Flex

In this tutorial, you will learn the basics of architecting a simple Line Effect, using Flash CS4 or Flex Builder 3. We try to cover the basics on the simplest way, so everyone will be able to step in the scripted animation with actionscript 3.0. The fact of using only code to generate animation and effects, will result on a very small file size, which will improve the loading performance on the browser and enables a better interactivity experience.

This is description that the http://www.thetechlabs.com/ makes for this tutorial. Well, this tutorial is made by me and if you want to learn something new , have a look - Click for Tutorial-.
And the final result you can see here: Tags: , , , , , , ,

As 3.0 Line Effect

January 13th, 2009 | 10 Comments | Posted in ActionScript 3.0

Hi everyone and welcome again to my blog. Well, this is a very simply effect applied to a line. This is the code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
	 * Author: Horatiu Condrea ( http://www.flashdesign-store.com )
	 * Description: AS 3.0 Line Effect
**/
 
    // -------------------------------------
    // Variables
    // -------------------------------------
 
// I created these 2 variables(bmd and bm)
// Because the filter must know where to act
// If you whant a full effect, the stage size must be equal in the script
 
var bmd:BitmapData = new BitmapData(550, 400 , true, 0X000000);
var bm:Bitmap = new Bitmap(bmd);
addChild(bm);
 
var sp:Sprite = new Sprite();
addChild(sp);
 
var bf:BlurFilter = new BlurFilter(3,3,3);   // Set the BlurFilter Effect
 
var cmf:ColorMatrixFilter = new ColorMatrixFilter   // Set the ColorMatrixFilter Effect
([1, 2, 1, 5, 1,
  0, 1, 2, 2, 3,
  2, 0, 2, 2, 0,
  0, 0, 0, 0.83, 0]);
 
    // -------------------------------------
    //  Methods
    // -------------------------------------
 
stage.addEventListener (MouseEvent.MOUSE_MOVE, curveLine);
// Now, add an ENTER_FRAME event listener that
// will allow to add the filter
addEventListener(Event.ENTER_FRAME, loop); 
 
function curveLine(event:MouseEvent):void
{
 
// Set the line settings
   sp.graphics.clear();
   sp.graphics.lineStyle(1.5, 0xffffff);
   sp.graphics.moveTo(mouseX, mouseY);
   sp.graphics.curveTo(stage.stageWidth / 2, stage.stageHeight / 2,
                    stage.stageWidth / 2, 0);
}
 
function loop(e:Event):void
{
        // Apply the filter effects to line
	bmd.draw(sp);
	bmd.applyFilter(bmd, bmd.rect,new Point(),bf);
	bmd.applyFilter(bmd, bmd.rect,new Point(),cmf);
	bmd.scroll(2,1);
}

Here is the final result: Tags: , , ,

Get Adobe Flash playerPlugin by wpburn.com wordpress themes