GU logo
 

Dynamic Blend (dynBlend v1.1.3)

Component description:

This Flash MX component allows you to build blend groups based on your symbols.
It can be used as a component in Flash MX only, but the resulting movie can also be published as Flash 5.
Uses standard actions which are already available in Flash 5.

Blend groups can be used to create custom gradients, distribute a number of objects to some space, create visual effects, etc.
It acts similar to “Blend” tools in CorelDRAW or Freehand, but, unlike them, builds blend groups dynamically, e.g. as a movie is playing. As a result, it will help to create very small flash files (good for preloaders).
It is strongly recommended that you learn something about using Blend tools in a program like Freehand - it will help to use this component more efficiently.

    To make a blend group, follow these steps:
  1. Create a movie clip from which you want to build a blend.
  2. Set Linkage identifier for this movie clip. To do this, right-click movie clip in the library, choose “Linkage…”, check “Export for Actionscript” flag.
  3. Place back and front movie clips on the scene and assign instance names to them. Usually these movie clips are instances of the symbol you have just set Linkage for.
  4. If you want to use Blend Colors feature, modify colors of these two movie clips by using Color > Advanced dialog from the Properties panel. You can modify just transparency (Alpha) for each of them, without changing colors.
  5. Place an instance of dynBlend movie clip on the scene.
    Note: two base objects and their dynBlend movie clip must be placed at the same level of your movie (or enclosed within the same parent clip) to work properly. You can, however, place several such “groups” to one level (or into one parent clip).
  6. Open Properties panel for dynBlend movie clip. Click Parameters tab
  7. Enter required information into fields: Number of steps, names of back and front instances, Linkage identifier for blend clip.
  8. Check Blend Colors if needed (checked by default).
  9. Check Hide this clip if you don't want the dynBlend clip to be visible in resulting movie (checked by default).
  10. Publish your movie to see the result. Play with values to get desired results.
You can also dynamically:
- Move, rotate and scale one or two of your base objects;
- Change their colors or Alpha while the movie is playing;
and then rebuild blend group using buildBlend() method.
Note, however, that, as this script uses a lot of calculations, it’s not recommended to rebuild blend group frequently (e.g. by onEnterFrame event), as this can slow the movie on old computers.

You can download this HTML tutorial with all swf samples (10 kb zip file)

Acknowledgments

I would like to thank Bethany Nash  for her assistance with this component and this help file.

I also thank a lot Shane Hunt for his great book - Coreldraw 8 F/X: Inventive Techniques & Outrageous Effects, which taught me all these blend tricks.

Other sections

 

Downloads

All swf samples in archive
(ZIP, 10 kb)

Dynamic Blend v1.1.3 component
for free
at Macromedia Exchange.

Some samples

Blend groups can be used in different ways:

The number of steps is 10 for a group of rectangles and 200 for each of stars groups.
While the movie is playing, you can rebuild blend group using buildBlend() method.

Drag the star at the picture below to see how this works:

The code for this sample is the following:

onClipEvent (mouseUp) {
	stopDrag();
	_root.dynBlend.buildBlend();
}
where dynBlend is the instance name assigned to the component.
Using dynBlend with text.

    At the picture above:
  1. Movie clip with static text in it
  2. Blend group (with color transformation)
  3. To apply gradient fill to the text, break it apart (Modify>Break Apart)

©2000-2009 GD studio About | Contacts