Archive for the ‘Tutorial’ Category
Moving a flash object
Moving an object in flash is easy, but it’s an essential part of learning flash and actionscript. So in this tutorial I will learn you how to move flash objects with the arrow keys. In this tutorial I only coded the right arrow, you must code the other arrows. You must paste the code in the movie clip you want to control. If you’re too lame to read the whole tutorial here’s the complete code. Just reading code can be more valuable than reading the whole tutorial, because in the end you must learn to understand the code not only what it does.:
onClipEvent (enterFrame) {
if(Key.isDown(Key.RIGHT))
{
this._x += 1;
}
}
To move an object over the x-axis you use:
this._x += 1;
1 is the speed, this._x is the position on the x-axis of the object where the action scrip is in and += is the operator for add.
To capture mouse input you use:
if(Key.isDown(Key.RIGHT))
{
this._x += 1;
}
Key.isDown(Key.RIGHT) checks if the right key is down. So if you change it to Key.LEFT it will check for the right key.
But before you can add this code to a symbol you have to put onClipEvent (enterFrame) { around it, it makes sure it will run every time the frame passes:
onClipEvent (enterFrame) {
if(Key.isDown(Key.RIGHT))
{
this._x += 1;
}
}


July 23rd, 2008 · Tags Tutorial | No Comments »
Setting transparency of a movie clip.
I just started learning flash and didn’t really find what I was looking for immediately on google. So I decided to just post everything on flash I can’t find directly here on DeviantFlash blog. This is my first post on setting transparency of a movie clip. It’s just one line of code but I had to type 5 different things in google to find what I needed.
With this code you can change the transparency (alpha color) of a movie clip. Just enter this where you need it:
this._alpha = 40;
If you only want to change visibility use:
this._visibility = true;
or
this._visibility = false;
It’s worth noting that a lot of things can be set with this. you just have to know what to type :PÂ So here’s also a list with other this. properties.
_alpha _currentframe _droptarget _focusrect _framesloaded _height _name _quality _rotation _soundbuftime _target _totalframes _url _visible _width _x _xmouse _xscale _y _ymouse _yscale
June 21st, 2008 · Tags Tutorial | No Comments »




















