Archive for the ‘Tutorial’ Category

Dreaming in Flash at The Tech Labs

Monday, July 7th, 2008

We're proud to announce that Dreaming has published a few tutorials over at The Tech Labs, these tutorials are exclusive and can be accessed at: http://www.thetechlabs.com/

They include an air contact manager, and two sound equalizer how-tos with one of them showing how to get those cool pv3d equalizers.

Enjoy!

Giving Flex Builder a Library (SWC)

Wednesday, February 27th, 2008

Have you ever wondered why Flex doesn't have a nice library like Flash IDE?
You'd love to use Flex but not having that nice little library there puts you off?
Well here's how we do it:
First create your FLA file, then create all the items you want inside (they don't need to be on stage just library will do), be sure to tick 'export for actionscript' and 'export in firstframe', also you can change the base class to something else that will add functionality to your movieclip.
Then in export preferences, tick 'export swc'.
Ok so now we have a nice little SWC file, how do we get it into Flex? Easy :)
Open project properties, go to Build Path > Library Path and add your SWC file.
That's it!
Congratulations now you have auto complete goodness on your AS3 Flex Builder application :)
Just keep in mind that these elements will be exported in the initial load of your website, so if you want to preload them be sure to use the preloader.

Customized actions for FLVPlayback Component

Tuesday, January 22nd, 2008

If you need a standard flash videoplayer, then the FLVPlayback component is the right thing for you.

Just create a new FLA and drag&drop a FVLPlayback component from the components library into a movieclip in your library, export it for actionscript and compile the SWC.

All the functionallity stuff is already handled by adobe. But that's where I got stuck for quite some
time. I needed a player, that used the forwardButton and backButton for switching the videos (and not seeking forward and back).

The answer was really simple: Just override the functions once the component loaded its skin:



Auto-Generate Getters and Setters in Flex Builder

Friday, December 21st, 2007

I've been writing a lot of getters and setters lately (and spending way too much time doing that...), so I googled for some sort of plug-in for Eclipse/Flex Builder and found a great resource called Project Dash Here's a nice script to use with Dash to generate getters and setters for your variables ;)

  1. Inside FlexBuilder goto Help->Software Updates->Find and Install (if you ran into an error about retrieving "feature.xml" delete the site.xml file in your Flex Builder directory)
  2. add the remote update url ; update and restart
  3. when you restart you should see a Scripts menu and a Project in your workplace called Eclipse Monkey Examples
  4. Create a new file (with a .js extension) in the scripts folder inside the Eclipse Monkey Examples
  5. Write you monkey script in there (copy and paste the script to generate the getters and setters into the new file)

References:
Post with script to generate Getters and Setters

Taking a snapshot of an flv

Monday, December 3rd, 2007

Following my last post on 9-Slice items, here comes another nice one on Bitmap.draw() and the security sandbox.
Many people know the solution to this one, but i just found myself looking for it for too long, so here it goes :)

If you want to take a snapshot of a running Video object, you can't, you'll be alerted by the flash player that you are violating
the sandbox security. So how do we do it?
Easy as pie :)

video.attachNetStream( null );
bitmapData.draw( video );
video.attachNetStream ( myNetStreamObject );

Three very simple lines of code but that are hard to come by.

Automating the Build Process - Part 1

Friday, November 30th, 2007

Improving the work flow in the development of Flash applications is something that has been in my mind for some time now, specially after seeing some presentations on the subject at Max Barcelona.

Usually the applications are not big, and are developed by a single programmer in less than a month, so they are manageable, but when a big one come along chaos is installed.

(more...)

Actionscript 3 Preloader

Tuesday, November 13th, 2007

Hey,

So recently i've come to a problem, how do i create a preloader for my 
website if i only use Eclipse as development enviornment?
There is no main timeline per se, nor can i choose where to export my assets, 
so after some digging i came up with  this solution:

The main file:

And the preloader file:

Essentially what i'm doing here is instructing the compiler to add a frame
with myPreloader as a factory and calling my main file from it.
Should you have any questions feel free to ask, here is the swf.

(As2) swapDepths Vs (As3) setChildIndex

Tuesday, November 6th, 2007

AS2 was an anarchy language, if you need to put a movieClip visually above all the things in the stage, you can do movieClip.swapDepths(this.getNextHighestDepth()). So it works, but in reality your are swapping your movieClip with a movieClip that didn’t exist, so in AS3 you can’t do that but we have setChildIndex method. You Can do setChildIndex(numChildren-1)

AS2
AS2
AS3
AS3

Filling MovieClips with patterns

Monday, November 5th, 2007

Tinting a MovieClip is not a new thing, we see a lot of Web sites doing that, example: In a t-shirt selling store, you choose a shirt and then you can choose it color. But yesterday me and Pedro were talking that it could be nice to fill shapes with patterns, so it quite simple:

Example

Using code to play MovieClips in reverse and/or play them on a different frame rate.

Wednesday, October 24th, 2007

One easy way to play movies clips reversed is to affect the currentFrame propriety. The problem is that currentFrame is read only, so you need to make a custom class that extends MovieClip where you can assign values to that propriety.

The class:

The MovieClip:
movieclipanimation.jpg

So with Tweener you can now play with your MovieClip. You can play it on reverse, play it on a different frame rate, and you can even use some crazy transitions.

Example:
example1.zip