Showing posts with label flash. Show all posts
Showing posts with label flash. Show all posts

Tuesday, May 3, 2011

AS3 - Children adding reverse

Today I learned an extra feature of adding children into a DisplayObject in reverse.
Normally I would make two loops. First one is adding the children, the second is placing the children in reverse.
But... it can be done so much easier:

for(var i:int = 0; i < numChildren; i++)
{

container.addChildAt(child,0);

}

The second parameter sets the child on the first place.

For many known, not for me.. maybe not for you either....

Thursday, July 23, 2009

getNextHighestDepth in as3

In as2 you were able to put a movieclip on top of all the other containing movieclips. I'm working with as3 now and was searching for this same option.

You can do it with one line of code:

as2:

//container is the parent of the movieclip
movieclip.swapDepths(container.getNextHighestDepth());

as3:

//container is the parent of the movieclip
container.setChildIndex(movieclip, (container.numChildren - 1));

Monday, June 15, 2009

SoundManager in as3

On the internet I found a very interesting class. I used it in a project I'm working on right now. It is a singleton class to load library or external sounds. So with some very simple lines of code you can implement and use the sounds.

you can download the class here:
http://evolve.reintroducing.com/2008/07/15/news/as3-soundmanager/

In your flash file you can set a linkage to the sound in your library:


To use the soundmanager simply use these lines:


//load the sound from library
SoundManager.getInstance().addLibrarySound(nl.Amercom.Sounds.MenuItem, "MenuItem");

//play the sound on a rollover or somewhere else
SoundManager.getInstance().playSound("MenuItem");

Sunday, April 5, 2009

Unable to resolve for transcoding with embed image

Ok, at home I was making a new as3 project with flashdevelop.
Everything was working great, untill I wanted to use the [embed] code.

At work there's no problem with it, but here at home it just didn't work. And I was sure that I dit the same thing... here is what I did,

[Embed(source="../images/425400.png")]
protected var myImage:Class;


The compiler gave me this error: Error: Unable to transcode ../images/425400.png.
So, I thought to put the image in the /bin directory. not working either.


[Embed(source="425400.png")]
protected var myImage:Class;


after some searching on the internet, days of waiting and thinking... the solution was way to simple:


[Embed(source="/../images/425400.png")]
protected var myImage:Class;


put a '/' before you're path and it works..

Wednesday, January 14, 2009

[project] Interhome holiday suitcase in flash

After a lot of work, we created a new website for Interhome. It becomes a filled suitcase which checks your holiday character in a motion environment.
The style is designed by Benjamin Gouverneur and everything in flash is done by me.. Except the animations inside the suitcase. Martin Strieder is the creative animator. So my job was to put all the pieces together. A very creative, long and exciting project. One of the first big projects for me.

http://www.vakantiekarakter.nl/

special credits go to Benjamin, Wouter, Jeroen and Martin!!

Wednesday, October 1, 2008

[project] Wedding Gijs en Shirley

In september 2008 gijs en shirley (friends) got married. They asked me to build a website for them, so they can tell something about themselfes. I also created a 'gift shop' with different catogories. The vips on the wedding also wrote something personal about the married couple.

I build the website with adobe flash and PHP. The only thing that PHP did in this project is to send the gift shop mails.
Gijs en shirley wanted something grey and purple in their website. So I designed three previews and the picked this one:

http://www.gijsenshirley.nl/

And the lived happely ever after!