Got injured and cannot go out anywhere make you feel stress is a situation that nobody wants to experience it. You feel that your world is stopped because you do not know anything outside there. Do not worry about that anymore because there is one best satellite TV which will make you know everything which happen outside.
Direct TV provides you with their many channels which will make you like you were out there see the events by yourself or become really know lots of information without have to read magazines or newspapers. You can laugh why their comedies programs, explore your knowledge trough their science programmers, or see your favorite movies through your satellite TV. They give you some interesting packages that you can choose. With those packages you can choose which packages will suit you more. DirectTV is the best satellite TV among the others. They give you lots of benefits when you choose them as your satellite TV provider. You will be able to know what going on out there, because Directv channels will give you their best programs to be enjoyed.
So, even though you cannot go out because of your condition, do not worry to become out of date with the new information or news, you still be able to know them trough your satellite TV. Visit directtv.com to be able to b the updates person.
No Comments »
In most cases, you can actually accomplish the same task with either pair of properties. Here is some code that accomplishes the same thing that the previous example did, but by setting _width and _height instead of _xscale and _yscale. You can see it on the CD-ROM as 07mousescale2.fla.
onClipEvent (enterFrame) {
// get the distance from the center of the mc to the mouse
dx = _root._xmouse-this._x;
dy = _root._ymouse-this._y;
// set the scale of the mc
this._width = dx*2;
this._height = dy*2;
}
As you can see, this code is much simpler than the previous example. It doesn’t even use the onClipEvent(load) handler because the original width and height don’t need to be stored. This is clearly a case where using _width and _height has an advantage over using _xscale and yscale.
Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours
No Comments »
Notice that this code includes two new properties of a movie clip that we have not yet seen. _width and _height are values that return the current width and height, in pixels, of the movie clip. We need to grab and store these values in the onClipEvent(load) handler because this is the only point where we can get the original values for this movie clip. If we were to get the _width and _height later, they would reflect the changed values as the user moves the cursor around.
Width and Height Properties
You can also set the _width and _height properties of a movie clip. This gives you two ways to stretch or shrink a movie clip.
The difference between using _xscale and _yscale versus _width and _height is simple. The scale properties have a normal value of 100, representing 100 percent of the width or height of the movie clip. The _width and _height properties have pixel values instead of a percentage.
So if a movie clip is 75 pixels wide and 40 pixels high, its _width and _height properties will be 75 and 40, but its _xscale and _yscale properties will both be at 100.
Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours
No Comments »
The example movie 07mousescale.fla contains the most complex script that we have seen so far. It checks the _xmouse and _ymouse properties to get the location of the mouse. Then it determines how far away the mouse is from the center of the movie clip. It uses this distance, both the horizontal and vertical components, to calculate a percentage of scale to apply to the movie clip. The result is that the movie clip stretches and shrinks so that the bottom-right corner matches the location of the mouse. Here is the code:
onClipEvent (load) {
// get the original width and height of the mc
origWidth = this._width;
origHeight = this._height;
}
onClipEvent (enterFrame) {
// get the distance from the center of the mc to the mouse
dx = _root._xmouse-this._x;
dy = _root._ymouse-this._y;
// calculate the percentage of scale
sx = 100*dx/(origWidth/2);
sy = 100*dy/(origHeight/2);
// set the scale of the mc
this._xscale = sx;
this._yscale = sy;
Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours
No Comments »
You can also change the horizontal and vertical scaling of a movie clip. This means that you can stretch it and shrink it, changing its width, height, or both.
Scale Properties
The properties for doing this are _xscale for the horizontal scale of the movie clip and _yscale for the vertical scale of the movie clip.
The values you need to set these two properties to is a percentage. That means that 100.0 is 100 percent of the original scale of the movie clip. You can use smaller values, such as 50, to shrink the movie clip. Or, you can use larger values, such as 200 to stretch the movie clip. You can even use negative values to flip the movie clip.
Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours
No Comments »
You can easily write a movie clip handler that rotates the movie clip at a constant rate. All you need to do is increase the _rotation property.
Start with an empty Flash movie.
Place a simple movie clip in the middle of the screen. Don’t use a simple circle, though, because it will not appear to change while it rotates.
Attach the following script to the movie clip:
onClipEvent(enterFrame) {
this._rotation += 1;
}
When you run the movie, the movie clip rotates 1 degree per frame. This means that it will take 360 frames to rotate completely around. At 15 frames per second, that’s 24 seconds for a complete turn. That is, of course, if your computer can handle the full rate of animation. If you keep the movie clip and any other elements in the movie simple, this should not be a problem.
To make the movie clip spin twice as fast, change the 1 to a 2. Try other values as well.
To make the movie clip rotate in the opposite direction, change the number to a negative value, such as -1. Alternatively, use -= instead of +=. Check out the example movie 07rotation.fla to see an example.
Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours
No Comments »
Another property like _x and _y is the movie clip property _rotation.
The _rotation property accepts a value in degrees. A circle is divided into 360 degrees. The values used by _rotation range from -180 to 180. You can use integers or floating point values.
The value of _rotation always stays between -180 and 180, no matter what you set it to. For instance, if you set it to 179, it stays 179. However, if you set it to 181, it wraps around to -179.
To change this property, simply set it to a value. You can also use operators such as ++ and += to change the value. Here are some examples:
myClip._rotation = 90;
myClip._rotation++;
_root["myClip"]._rotation = 45;
this._rotation += 0.5;
Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours
No Comments »
Now that you know how to get the mouse location, and you know how to set the location of a movie clip, you can combine these two pieces to make a movie where a movie clip follows the cursor around the screen.
Create a new Flash movie.
Make a simple movie clip. Something like a small circle will do.
Attach the following script the to movie clip:
onClipEvent (enterFrame) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
That’s all there is to it. Check out the sample movie 07followthemouse.fla. When you test the movie, the movie clip immediately snaps to the location of the mouse, provided that the mouse is over the test window.
In Hour 13, “Rollovers,” we’ll look at how to use a similar technique to create custom cursors.
Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours
No Comments »
Here is the code inside the example movie 07mouse.fla. It contains a movie clip with this script on it. In every frame that passes, the script will write the x and y location of the mouse to the Output window, followed by a blank line to separate the pairs of numbers.
onClipEvent (enterFrame) {
trace(_root._xmouse);
trace(_root._ymouse);
trace(”");
}
When you run this movie, you will see the pairs of numbers stream through the Output window. Move the mouse around and watch the numbers change. Bring the cursor up near the upper-left corner of the screen to see them get close to 0, 0 and then to the lower-right to see them get close to 550, 400.
Notice that if you move the cursor outside the Flash test window, the values of _xmouse and _ymouse don’t change. If you move the cursor from the center of the movie to a point outside the movie fast enough, the old value stays until the cursor re-enters the active area. This is an unfortunate fact of life with Flash and something that you will have to plan for when using _xmouse and _ymouse.
Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours
No Comments »
But what are they properties of? If used by themselves, _xmouse and _ymouse are properties of the object they are contained in. So if you use them in the main timeline, they are root properties. If you use them in a movie clip, they are movie clip properties.
What’s the difference? Well, _xmouse and _ymouse measure the mouse location from registration point of the object. So if you are using the root properties, you get the location of the mouse from the upper-left corner of the movie. If you use them inside a movie clip, you get the mouse location from the center of the movie clip.
In most cases, you will want these properties as they relate to the main movie. To ensure this, you can use _root._xmouse and _root._ymouse.
Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours
No Comments »