Categories
Flash Open source / Freeware

Convert SWF to AVI – part 3

Update #1: when I wrote this post, this all worked… And I have good hope that the site will return. For now I can only say: try again later…. πŸ™
Update #2: well the site didn’t return: it’s as dead as a doorknob … that’s too bad. I couldn’t find a place where you can download it now, so I searched my external harddrive if I had the original zip-file, and I did. So you can download the file at http://www.box.net/shared/u5utxytazn#swfdrop
Update #3: Today I needed this for a good export to AVI and found out that swfdrop only works if the animation is on the main (root) timeline… so I used the trick introduced by swf2avi > read more here

Flash is not very good in converting animations in to AVI’s because you lose the animations in the nested movieclips. You can export to .MOV but that’s not a native Windows video codex.

So you want to convert a SWF to AVI (SWF2AVI) or another videofile/codex (without spending any cash)?
As the title of this post suggest: I have written about this subject before: in part 1 and part 2.

And I found a new freeware tool to help you convert your SWF: www.swfdrop.com.
SWF DROP: Version 0.9c

Download: it think this program is very useful, but the creators think different and killed the original site. I still have the original swfdrop.zip and that one can be downloaded here:http://www.box.net/shared/u5utxytazn#swfdrop.
Remember: I have nothing to do with this program, I only think it’s useful.

This project is also freeware and more up-to-date: October 2007 (swf2avi is last updated in 27-08-2002 & swf>>avi is last update in 07.20.2005).

“SWFDROP” is the SWF converter for Windows to convert Flash SWF file format to AVI format. It’s the best tool to successfully convert any Flash 6/7/8/9 SWF file into a video AVI file that you can play with Windows Media Player (or any video player), where all other tools don’t work. These, along with a variety of video encoding options, make SWFDROP the best choice for you productivity!

A little preview: you can figure it out, trust me.

It’s very easy to use, you can use the codex installed on you computer and it’s very fast

Create a movie that will load the movie that you want to export.

  • make this movie the same size as the original
  • use the same frame rate
  • only difference with to movie you want to load is the number of frames: use the number that you want (for example: 1000)

Because swf2avi is based upon as2, this code is also as2
[as]
// code in frame 1
loadMovieNum(‘name_of_the_movie_you_want_to_render.swf’, 1);
stopAllSounds();
[/as]

Categories
AS3 AS3 migration Flash

From AS2 to AS3 – Where did it go – swapDepths

Where did swapDepths () go in AS3?

This is what the ActionScript 2.0 Migration has to say about this:

ActionScript 2.0  ActionScript 3.0  Comments
swapDepths() Method Removed In ActionScript 3.0, you can achieve similar functionality by using the methods of the DisplayObjectContainer class, such as the addChildAt(), setChildIndex(), swapChildren(), and swapChildrenAt() methods.

Removed… bummer, so with what do I replace it with…

In AS2 you can use swapDepths() in two ways:

  • A Number that specifies the depth level where the movie clip is to be placed.
  • An instance name that specifies the movie clip instance whose depth is swapped with the movie clip for which the method is being applied. Both movie clips must have the same parent movie clip.

In the examples there are two movieClips: ‘circle_mc‘ and ‘square_mc‘. Movieclip square_mc is under circle_mc (z-index is lower then circle_mc). And the task is to get square_mc above circle_mc.

AS 2

There are a couple of ways to do that in ActionScript 2:

Example #1
Swap the depth of two movieclips which each other (square_mc will be placed on the depth of circle_mc, and the other way around)
this.square_mc.swapDepths(this.circle_mc);

Example #2
I consider this a hack, but one that works
this.square_mc.swapDepths(1000000);

Example #3
When you want to change the depth of something, this is usually to place it on top:
this.square_mc.swapDepths(this.getNextHighestDepth());

AS 3

Lets try this in ActionScript 3:

Example #1
this.swapChildren(square_mc, circle_mc);
Visit livedocs at the Adobe site for more information and example code
[as]
var square = this.getChildByName (‘square_mc’);
var circle = this.getChildByName (‘circle_mc’);

trace(this.getChildAt(0).name); // square_mc
trace(this.getChildAt(1).name); // circle_mc

this.swapChildren(square as DisplayObject, circle as DisplayObject);

trace(this.getChildAt(0).name); // circle_mc
trace(this.getChildAt(1).name); // square_mc
[/as]

Example #2
not possible anymore… if you want a detailed explanation visit dreaming in Flash blog, and read more about swapDepths() in AS3 (it’s explained with a image)

Example #3
To place a movieclip on the highest depth in actionscript2, we will use MovieClip.getNextHighestDepth,
but in AS3 that function is removed πŸ™

In AS3 you need to use numChildren:
this.setChildIndex ( square_mc , this.numChildren - 1 );
Visit livedocs at the Adobe site for more information and example code

I realize that this is not a complete explanation… but I hope this is a starting point to find old function that you used in AS2

Categories
Extending Flash Flash

Object 2 Layer jsfl

For a project of mine: Custmm Grumm I needed to change a shape into an array (explained in this post shape 2 array jsfl ).

To make this happen I imported the .AI file (Illustrator) to the stage. But it will place everything on one layer, every shape it’s own ‘group’ and the script I wrote (shape 2 array jsfl), needs every shape on one layer.
Flash import screen

So here a script that, as long the different shape are still group individually, will give every shape it’s own layer.

Update #1: This script is not only useful in this project, in every project where you have a lot of objects that need there own layer, this is the JSFL for you!
Remember if you need to animate an movieclip, it needs to have it’s own layer (timeline)

Need a lot of item on there own layer (own timeline) in Flash, don’t copy past it one by one, but just use this JSFL

Not sure how to call this script when you save it: “[mck] object2layer.jsfl
[as]
/**
* Object2Layer, version 1.1
*
* select an item on the timeline and convert it to a layer
*
*

*  ____                   _      ____
* |  __| _ __ ___    ___ | | __ |__  |
* | |   | '_ ` _ \  / __|| |/ /    | |
* | |   | | | | | || (__ |   <     | |
* | |__ |_| |_| |_| \___||_|\_\  __| |
* |____|                        |____|
*
* 

*
* @author Matthijs C. Kamstra [mck]
* @version 1.1
* @since Fri Jun 01 19:43:37 2007
* @langversion: ActionScript 2.0 / 3.0
*
* Changelog:
* v 1.0 [2007-06-01] - Initial release
* v 1.1 [2008-03-20] - Change jsfl name; multiple item at once
*/

var versionString = '1.1';

var currentDoc = fl.getDocumentDOM ();
var timeline = fl.getDocumentDOM ().getTimeline ();
var curLayer = fl.getDocumentDOM ().getTimeline ().currentLayer;
var curFrame = fl.getDocumentDOM ().getTimeline ().currentFrame;
var selectionArray = currentDoc.selection;

// check if something is selected
if (selectionArray.length == 0){
alert ('nothing selected')
} else {
fl.getDocumentDOM().distributeToLayers();
}
// end
[/as]

have fun πŸ™‚