Senin, 28 Januari 2013

test

test

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" height="170" width="210"><param name="movie" value="http://www.swfcabin.com/swf-files/1332494254.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#cccccc" /><embed src="http://www.swfcabin.com/swf-files/1332494254.swf" quality="high" bgcolor="#cccccc" width="210" height="170" name="flash" align="middle" play="true" loop="false" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>

ActionScript 3 Button

In a previous tutorial, I demonstrated how to create a Movie Clip button in Flash. Movie Clips are much more flexible than Button Symbols, so it often makes more sense to use a Movie Clip and treat it as a Button. However, even the previous tutorial was a little limited in its possibilities in that it still relied heavily on the Timeline. Today, I want to demonstrate how break free from the Timeline and create a truly dynamic button that can be reused with very few changes to the original. We're still going to create a Movie Clip button, but the functionality for this particular button will rest entirely in the ActionScript 3 code that we will apply to it.

Creating the Button

For the purpose of this tutorial, I want to keep the button's text separate from its background. This will allow us to animate the width of the background without affecting the text.
Step 1 - Create the background. Let's keep it simple. Using the Rectangle Tool (keyboard shortcut 'R'), create a rectangle, applying whatever visual attributes you prefer. Switch to the Selection Tool (V) and hit F8 to convert the rectangle to a Movie Clip symbol. This Movie Clip will contain only the background for the button, so name it "btnBG" and set the registration to the center, like so:

(Note: If you want your button to expand out to the right instead of from the center, set your registration point to the left when converting your shape to a Movie Clip.)
Give your new background Movie Clip an instance name of "bg_mc". This is the name we will use to refer to the background in our ActionScript.
Step 2 - Label your button. Create a new text field using the Text Tool (T) and align it to the center of the button using the Align Panel. To make things really dynamic, make your text field dynamic. If you're using Flash CS4 or earlier, make your text field a Dynamic text field in the Properties Panel. If you're using CS5, you can use the new TLF Text property. With your text field selected, give it an instance name of "label_txt".
Step 3 - Embed Your Fonts. This is a very important step if you want your text to show up properly. With your text field still selected, click on the "Embed" button in the Properties Panel. In the popup, select Uppercase, Lowercase, Numerals, Punctuation, and any other options that you might end up using in your text field. Click "OK" to apply your changes.
Create your Movie Clip button. Using the Selection Tool (V), select both your button background and your text field and hit F8 to convert your graphics to a symbol. Again, set your registration point to the center, choose "Movie Clip" for the symbol type, and give it the name "mcButton". Select your new Movie Clip button and give it an instance name of "button_mc".

Coding the Button

Double check to make sure your instance names are all the same as mine. Once this is confirmed, create a new layer named "Actions", click on frame one of this new layer, and hit F9 (or Option+F9 on a Mac) to open up your Actions Panel. (Additionally, you can also access the Actions Panel from the Window menu.)
Add the following code to frame one of your Actions panel:

import caurina.transitions.*; import flash.events.MouseEvent; import flash.net.URLRequest; button_mc.buttonMode = true; button_mc.label_txt.text = "home"; button_mc.addEventListener(MouseEvent.MOUSE_OVER, hover); button_mc.addEventListener(MouseEvent.CLICK, clicked); function hover(e:MouseEvent):void { Tweener.addTween(button_mc.bg_mc, {scaleX:1.5, transition:"easeOutElastic", time:1}); button_mc.removeEventListener(MouseEvent.MOUSE_OVER, hover); button_mc.addEventListener(MouseEvent.MOUSE_OUT, out); } function out(e:MouseEvent):void { Tweener.addTween(button_mc.bg_mc, {scaleX:1, transition:"easeOutElastic", time:1}); button_mc.removeEventListener(MouseEvent.MOUSE_OUT, out); button_mc.addEventListener(MouseEvent.MOUSE_OVER, hover); } function clicked(e:MouseEvent):void { navigateToURL(new URLRequest("http://www.schoolofflash.com"),"_self"); }

The first three lines of our code import the necessary ActionScript classes. Note that I have decided to use the Tweener class for our animations instead of the traditional Tween class. The Tweener class is much easier to use, not to mention much less buggy. Click here to learn more about the free Tweener class. Line 1 of our code imports the Tweener class, as well as other classes in the caurina.transitions package. In line 5, we set the buttonMode property to "true". When we do this, we make our Movie Clip behave more like a Button symbol in that it causes the mouse cursor to turn into a hand cursor whenever you hover over the button. Line 6 sets the label text of the button to read "home". The next two lines create our hover and click events, which trigger the "hover" and "clicked" functions, respectively. Inside the "hover" function, we want to animate the width of the button background to get that elastic, bouncy animation. We do this using the Tweener.addTween() method. This method takes two main parameters: the instance name of the object being animated and an object containing information on the animation itself. In this case, we want to animate the background of the button by itself. If we just applied the animation to the button, then the text would animate, too. We don't want that, so we're pointing to the bg_mc Movie Clip within the button_mc Movie Clip. The second parameter is a little more complicated, because it contains numerous property/value pairs that define our animation. The documentation on the Tweener class describes a number of different properties that you can include here, but for this animation, we just want to look at the property of the Movie Clip that we want to animate, the easing function we want to use, and the duration of the animation itself. For this animation, we just want to animate the width of the background; but instead of using the width property, notice that I referenced the scaleX property, which allows you to modify the width of the object as a percentage of its original width. In this instance, I used 1.5 to scale it up to 100% of its original width. To scale it back to its original width in the out function, simply animate the scaleX property back to a value of 1. Another property commonly used within the Tweener.addTween() method is the "transition" property. By default, if you choose not to specify a value, the Tweener classes uses a simple ease out. If you don't want any easing at all, you would set the transition to "linear." Again, the Tweener documentation contains a description of all the different transition types--which are much more robust than the easing options available with the traditional Tween class. If you decide to use the Tweener class on a regular basis (which I do), then I highly recommend these handy little cheat sheets, which I keep posted on my desk. The third property I used in this example is the "time" property, which determines the duration of the animation. This number is in seconds, so our button animation will last 1 second. Note that this does not have to be a whole number. If you want your animation to last half a second, you can enter a value of 0.5. After creating your new Tween, be sure to remove the event listener for the MOUSE_OVER event and add a listener for the MOUSE_OUT event. Try to stay in the habit of removing unneeded listeners. When you're already hovering over a button, you no longer need the MOUSE_OVER event using up processing power. Just remember to add the event back after you move your mouse away from the button (as seen in the out() function). By now, you should be able to figure out what's going on inside the out() function. When the user moves the mouse cursor away from the button, we simply play the reverse of the previous animation, returning the button to its original width. Then we remove the MOUSE_OUT event and restore the MOUSE_OVER event.

Credit : School of Flash

Fake 3D

A couple years ago, I accidentally discovered method for giving Flash text an extruded, 3D look, and it's insanely easy to do.
Step 1 - Create Some Text – Easy enough, right? In this case, I want to put a gradient on the text, so to keep things simple, I'm just going to break the text apart by going to Modify > Break Apart, or by hitting Ctrl+B on the keyboard. (Make sure everything is spelled correctly first. You can't edit the text after you do this.) This will break your text field up into multiple single-character text fields, so you'll need to break apart a second time in order to get the raw shape that we're looking for. Broken apart, your selected text should look like this:
Step 2 - Color Your Text – I'm going to apply a simple, top-to-bottom gradient to make our text a little more interesting. To do this, make sure your text is selected and open the Color panel (Window > Color). Click on the paint bucket icon in the Color panel to make sure the fill is selected, and then change the drop-down menu from "Solid color" to "Linear gradient." Click on the left handle and select a bright red color, then select the right handle and choose a darker red, like so:

By default, you may notice that the gradient on your text is moving from left to right. I want it to move from top to bottom. Select the Gradient Transform Tool, which is grouped with the Free Transform Tool, and select the first letter. Use the rotate and resize handles to transform your gradient so that it's moving from top to bottom. Repeat this for all letters until you have something like this:

Step 3 - Movie Clipify Your Text – Switch to your selection tool (keyboard shortcut = V), and select all of your text. Hit F8 to convert it to a Movie Clip, and set the registration point to the center.
Step 4 - Duplicate and Relocate – With your Movie Clip selected, hit Ctrl+C (or Cmd+C on a Mac) to copy your text, and then hit Ctrl+Shift+V (Cmd+Shift+V on a Mac) TEN TIMES to paste ten more copies of your text right on top of the original copy. Since they're all copied to the same place, it will still look like a single text field, but we're about to change that.
Now we want to change the Z coordinate of each of our Movie Clips. The Z coordinate determines how far the text is away from our virtual camera, or how far back it is in 3D space. For our purposes here, we want each successive Movie Clip to be a little further back in space.
Start by selecting all of your Movie Clips, and the use the Distribute to Layers command in the Modify > Timeline menu. This will send each copy of your text to its own layer, which will make it easier to edit individually.
Lock the topmost text layer–this one is going to remain as is. Then, one layer at a time, starting with the second text layer, change the z-coordinate so that each successive layer is 10 pixels further back than the one in front of it. The z-coordinate can be changed in the Properties panel under the "3D Position and View" settings. So your topmost text layer will have a z-coordinate of 0. The second layer will have a z-coordinate of 10. The third will be 20, and so on. When you're done, your stage should look something like this:

Not quite what we're going for, but we're getting much closer.
Step 5 - Use Brightness to Add Depth – Do the following for all of your text Movie Clips EXCEPT FOR THE ONE ON TOP:
  1. Select the Movie Clip
  2. In the Properties Panel, under Color Effect, change the Style from "None" to "Brightness."
  3. Drag the brightness slider to the left to darken it. I've chosen a value of -33%.
  4. Repeat for the next Movie Clip.
Once you're done with this step, your text should look like this:

Much better!
Step 6 - Movie Clipify – Unlock all of your layers, select all of your text Movie Clips, and hit F8 to convert all of your Movie Clips into one container Movie Clip. Once you do this, you'll see a little bit of magic occur. After everything has been placed into this container Movie Clip, select the Movie Clip and start dragging it around the stage. You'll see that no matter where you move it, the text seems to be disappearing towards the center of the stage. To customize this look further, select the Movie Clip, go to your Properties Panel, and under the 3D Position and View section, you will see options for changing the Vanishing Point (highlighted in the picture below).
By default, the vanishing point is in the center of the stage, but if you play around with these values, you can change the way your 3D text is displayed. In the following animation, I've simply increased the y-coordinate of the vanishing point and then tweened the container Movie Clip across the stage. Not bad for a quick hack job!

Note: If you notice a stair-stepping effect on the "extruded" text, you can smooth it out by decreasing the z-distance between each Movie Clip. Instead of increasing each z-coordinate by 10, try 5 or even less until you get the effect you're looking for.

Credit : School Of Flash

Jumat, 25 Januari 2013

DmC Devil May Cry

In this retelling of Dante's origin story which is set against a contemporary backdrop, DmC Devil May Cry™ retains the stylish action, fluid combat and self-assured protagonist that have defined the iconic series but inject a more brutal and visceral edge.

The Dante of DmC is a young man who has no respect for authority or indeed society in general. Dante knows that he is not human, but also that he is not like the demons that have tormented him throughout his life. Caught between worlds, he feels like an outcast. Thanks to his twin brother Vergil, leader of the anti-establishment group called “The Order”, Dante is now discovering and coming to terms with what it means to be the child of a demon and an angel. This split personality has a real impact on gameplay with Dante being able to call upon angel and demon abilities at will, transforming his Rebellion sword on the fly to dramatically affect both combat and movement.

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes