After the Tween & TransitionManager Class, to make life more easier I have found MC Tween extension which can be used to tween objects such as movieclip/sound/textfield.
You just need to #include "mc_tween2.as" and use one simple command to create a new tweening. It doesn't use the MovieClip's own onEnterFrame event & It is based on time, not on frames.
Let's suppose you want to move something using an animation, to provide a smoother experience for the user. Using MC Tween, you could do:
myMovieclip.tween("_x", 100);
To download the extension or read the full documentation with examples please go to: http://hosted.zeh.com.br/mctween/
Wednesday, June 4, 2008
Monday, May 12, 2008
Auto Save
Hi Guys,
You can enable autosaving for your flash documents in Flash by downloading and installing the extension -
Extension:Auto save extension
You can set the autosave intervals as per your needs.
This extensions is licensed under a Creative Commons License. If you choose to download it then you are agreeing to the terms in this license agreement.
You can enable autosaving for your flash documents in Flash by downloading and installing the extension -
Extension:Auto save extension
You can set the autosave intervals as per your needs.
This extensions is licensed under a Creative Commons License. If you choose to download it then you are agreeing to the terms in this license agreement.
Labels:
Auto Save Flash File
Thursday, July 19, 2007
Beauty of Tweening with Tween & TransitionManager class
Yes!!! Its true that you can tween any object on the stage without actually applying tweening in the timeline & its amazing.
I am pasting a small code snippet below for a quick reference, which generates a bounce effect for a movie clip placed on the stage.
import mx.transitions.Tween;
import mx.transitions.easing.*;
new Tween(mcBall, "_y", Bounce.easeOut, 0, Stage.height-50, 3, true);
Parameters Explained:
1. "mcBall" is the movie clip placed on the stage
2. This parameter tells the constructor that what property will change in case of tweening. "_y" means the y position of the movie clip has to be changed.
3. The effect.
4. Starting y position.
5. End y position.
6. Duration of the tween.
7. Boolean Value related to the duration parameter, which indicates to use seconds if true, or frames if false.
The Tween and TransitionManager classes are available only in ActionScript 2.0, but these classes are available in both Flash Basic 8 and Flash Professional 8.
I am pasting a small code snippet below for a quick reference, which generates a bounce effect for a movie clip placed on the stage.
import mx.transitions.Tween;
import mx.transitions.easing.*;
new Tween(mcBall, "_y", Bounce.easeOut, 0, Stage.height-50, 3, true);
Parameters Explained:
1. "mcBall" is the movie clip placed on the stage
2. This parameter tells the constructor that what property will change in case of tweening. "_y" means the y position of the movie clip has to be changed.
3. The effect.
4. Starting y position.
5. End y position.
6. Duration of the tween.
7. Boolean Value related to the duration parameter, which indicates to use seconds if true, or frames if false.
The Tween and TransitionManager classes are available only in ActionScript 2.0, but these classes are available in both Flash Basic 8 and Flash Professional 8.
Labels:
Tweening using actionscript
Wednesday, July 18, 2007
Actionscript/Javascript Communication
Now its much easier to communicate with Flash from Javascript and vice versa using ExternalInterface class.
You can create any function in Flash & then use the ExternalInterface class to register that function to call from the browser.
I am giving a step by step explanation to achieve the desired functionality.
First and foremost import the package using the statement given below -
import flash.external.*;
& then call the following function to register the function
ExternalInterface.addCallback("callASFunction", null, asFunction);
Explanation: The first parameter "callASFunction" is the name which will be used to call the function from the browser and the third parameter is the actual name of the function created in Flash. You can always keep the second parameter as null.
You can create any function in Flash & then use the ExternalInterface class to register that function to call from the browser.
I am giving a step by step explanation to achieve the desired functionality.
First and foremost import the package using the statement given below -
import flash.external.*;
& then call the following function to register the function
ExternalInterface.addCallback("callASFunction", null, asFunction);
Explanation: The first parameter "callASFunction" is the name which will be used to call the function from the browser and the third parameter is the actual name of the function created in Flash. You can always keep the second parameter as null.
Monday, June 18, 2007
Mobile Apps with Flash Lite
Hi Peeps,
I just tried playing around with Flash Lite & found it really cool to generate mobile apps & you can test your application in the emulator while developing it.
I created a very small application & found it really interesting and easy. I used Flat Lite 1.1 with Flash 8.0 to generate this application.
I had an image & a button placed in the first screen & clicking on that button made the image run out of the screen with motion tween.
It was fun & easy.
I just tried playing around with Flash Lite & found it really cool to generate mobile apps & you can test your application in the emulator while developing it.
I created a very small application & found it really interesting and easy. I used Flat Lite 1.1 with Flash 8.0 to generate this application.
I had an image & a button placed in the first screen & clicking on that button made the image run out of the screen with motion tween.
It was fun & easy.
Labels:
Flash Lite
Thursday, June 7, 2007
Customizing Flash Context Menu
Flash context menu is the menu you see when you right click on any of the running Flash animations or applications.
I have customized it many times before but one of my friend asked me few days back that if he can remove the options from the Flash shortcut(context) menu so I thought of posting it on my blog for all of those trying to customize it.
I am pasting the code along with the explanation below -
var cMenu = new ContextMenu();
cMenu.hideBuiltInItems();
function dummy() {
trace("option clicked");
}
var cMenuItem1 = new ContextMenuItem("Option 1", dummy);
var cMenuItem2 = new ContextMenuItem("Option 2", dummy);
var cMenuItem3 = new ContextMenuItem("Option 3", dummy);
cMenu.customItems.push(cMenuItem1,cMenuItem2,cMenuItem3);
_root.menu = cMenu;
The ContextMenu class provides runtime control over the items in the Flash Player context menu, which appears when a user right-clicks on Flash Player.
First of all I have created an object of the class ContextMenu called "cMenu" & then called the built in function hideBuiltInItems() using the object which will hide the default options appearing on the right click.
The function dummy has been created to display a message in the output panel whenever user will click on the customized options added in the menu.
ContextMenuItem class is used to create objects for creating customized items, so for each option you want to put in the menu, you have to create an object. While creating object it takes two parameters, the caption & the function which will be executed on the click.
After doing this you have to push the items in the menu and to do that you use in built array associated with ContextMenu called ContextMenuItems.
cMenu.customItems.push(cMenuItem1,cMenuItem2,cMenuItem3);
So using the above code you push the items created into the menu & then your menu is ready to go after you change the current menu by putting in your menu name in the "menu" property using the following statement -
_root.menu = cMenu;
Enjoy Customizing Context Menu...
I have customized it many times before but one of my friend asked me few days back that if he can remove the options from the Flash shortcut(context) menu so I thought of posting it on my blog for all of those trying to customize it.
I am pasting the code along with the explanation below -
var cMenu = new ContextMenu();
cMenu.hideBuiltInItems();
function dummy() {
trace("option clicked");
}
var cMenuItem1 = new ContextMenuItem("Option 1", dummy);
var cMenuItem2 = new ContextMenuItem("Option 2", dummy);
var cMenuItem3 = new ContextMenuItem("Option 3", dummy);
cMenu.customItems.push(cMenuItem1,cMenuItem2,cMenuItem3);
_root.menu = cMenu;
The ContextMenu class provides runtime control over the items in the Flash Player context menu, which appears when a user right-clicks on Flash Player.
First of all I have created an object of the class ContextMenu called "cMenu" & then called the built in function hideBuiltInItems() using the object which will hide the default options appearing on the right click.
The function dummy has been created to display a message in the output panel whenever user will click on the customized options added in the menu.
ContextMenuItem class is used to create objects for creating customized items, so for each option you want to put in the menu, you have to create an object. While creating object it takes two parameters, the caption & the function which will be executed on the click.
After doing this you have to push the items in the menu and to do that you use in built array associated with ContextMenu called ContextMenuItems.
cMenu.customItems.push(cMenuItem1,cMenuItem2,cMenuItem3);
So using the above code you push the items created into the menu & then your menu is ready to go after you change the current menu by putting in your menu name in the "menu" property using the following statement -
_root.menu = cMenu;
Enjoy Customizing Context Menu...
Labels:
Context Menu Customization
Thursday, May 24, 2007
XML Preloader
Hey Guys,
Now you can show a preloader animation even while loading any data from a XML file. The code for the preloader is like any other preloader in Flash except there is a change while extracting the loaded and total bytes -
loadedBytes=myXML.getBytesLoaded();
totalBytes=myXML.getBytesTotal();
myXML here refers to your XML object created to load the XML file.
Please feel free contact me at atul.narang@designworxz.com in case of any query.
Cheers :)
Now you can show a preloader animation even while loading any data from a XML file. The code for the preloader is like any other preloader in Flash except there is a change while extracting the loaded and total bytes -
loadedBytes=myXML.getBytesLoaded();
totalBytes=myXML.getBytesTotal();
myXML here refers to your XML object created to load the XML file.
Please feel free contact me at atul.narang@designworxz.com in case of any query.
Cheers :)
Subscribe to:
Posts (Atom)