More Flash tutorials coming your way

I’m working on a big project for some time now, and I’m now switching up a gear to make sure I finish this project of mine.

Expect some Flash tutorials and freebies in a totally new site soon!

For dynTween users

A pretty good page for people who uses dynTween or who wants to learn how to use dynTween.

http://www.pvbinduction.com/projects/bor5265/classes/dynTweenClass.as

After using it for a project recently though, I won’t touch it again, because it is very outdated. It lacks tweens for a lot of properties like color and the Flash 8 filters.

The callbacks aren’t very well structured in that they don’t have a scope, and you have to rely on _root. to get to the scope that you want.

For now, I would stick to Fusekit or MC_Tween2.

XML2Object

I’ve been using a XML 2 Object prototype I got from Kun since a project I did at MakeStudios. However, I misplaced the prototype, and then tried to look for it online, but to no avail.

I’ve found another equally good, if not, better Class that does the same thing though. It’s written by the webmaster of Sephiroth.it. If you’ve not been to the site, you need to right now. Sephiroth.it contains lots of useful classes, tutorials, and even Firefox Extensions - like the FlashTracer, to make life for you as a Flash Developer easier.

Here’s the link to the project page of the XML2Object class.

Note: Sephiroth has a newer version of this class, but I really have no idea how to use it despite trying it for a few times.

Drag Slide Fade 2.0 Class Library

This Class Library is one of the links sitting in my Links section for quite some time.

I didn’t have the time to check it out, but now that I did, I wished that I had checked it out earlier!

The link to the documentation is: http://www.brendandawes.com/dsf2/

The link to download the class is: http://www.brendandawes.com/downloads/dsf2.zip

What can you do with this you ask?

Lots!!!

To start with, it has a custom function for loading images.

This is what it does:
Loads an image into a MovieClip complete with a left to right progress bar and then fades the image up when it’s loaded

What your code will look like:
[code lang="actionscript"]
var i:Image = new Image(instanceName,1);
i.loadImage(”image.jpg”,true,true,false);
[/code]

Isn’t that convenient? There are more functions and classes in this pack which I haven’t go through in detail yet. But I think I definitely will post something about this soon. ;)

Reflection Class in Flash

The nice reflections you see in Fusion 2006’s website.

Just happened to see it, and so I posted it for people interested to use this.

Click here

:D Enjoy!

Full Browser/Full Screen Flash

The code for full screen/full browser is really simple. In fact, the only code that is needed is to make sure that the objects within the SWF itself does not scale - and a line of code to align it to the Top Left of the browser.

[code lang="actionscript"]
Stage.scaleMode = “noScale”;
Stage.align = “TL”;
[/code]

The rest depends on your publish settings(Ctrl + Shift + F12). What you need to do is to set the width and height to 100 Percent. Remember to change the dimensions to percentage.

I’ve attached a file, which I don’t remember where I got from. =x

The code features a onResize Handler, which is important for full screen flash as well. This is because you need this listener to check if the user resized the browser, then change the positions of the elements in the SWF accordingly.

The flash file contains the HTML, the SWF, and the FLA file for this. In the center, is a text field containing the dimensions of the Flash. Open the index.html and try resizing the browser, and you will see that the text field will always be in the center. This is done by adding lines of code to set the _x and _y of the text field within the onResize handler.

[code lang="actionscript"]
this.onResize = function() {
//– Called when browser is resized.
this.txtDimentions._x = (Stage.width/2)-(this.txtDimentions._width/2);
this.txtDimentions._y = (Stage.height/2)-(this.txtDimentions._height/2);
this.txtDimentions.text = Stage.width+”x”+Stage.height;
};
[/code]

I hope you guys enjoyed this little tutorial. A lot of people have asked me how I did QwertyDesign, and well, here is the base of what started QD.net.

Project Files: FullBrowserFlash

Microphone in Flash

To start using the microphone in Flash, the code is really quite simple, and can be retrieved from the F1 Help documentation within the Flash UI.

Here’s the main code that you will need to initialize the Microphone.

[code lang="actionscript"]
this.createEmptyMovieClip(”sound_mc”, this.getNextHighestDepth());
System.showSettings(2);
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
[/code]

One thing to note is that your Stage size must be at least 215 x 138 pixels for the System Settings to be displayed. This system Settings panel lets users allow or deny the Microphone. And there is a function to let Flash detect, what the user’s choice was. This allows you to have 2 different code, one for users with the Microphone, and one for users with no Microphones.

Continuing from the code above:

[code lang="actionscript"]
active_mic.onStatus = function(infoObj:Object) {
trace(active_mic.muted);
if (active_mic.muted) {
//put function here to activate NO MICROPHONE code
}else{
//put function here to activate MICROPHONE code
}
};
[/code]

I left the trace inside to show you what is the difference of the number you get when you click allow or deny.

This is the basics of coding a Microphone in Flash. Hopefully, I’ll be having the chance to be playing more with the ActivityLevel part of the Microphone class in the coming weeks. Will share the code with you guys then.

Tween Engine Alternative - MC Tween 2

Before I started using Fusekit, I was using MC Tween 2. I was introduced to it by Terry, a very good scripter and a great guy from PixelSquad.

Till this day, I find MC Tween to be somewhat better than Fuse. This is because it has a shortcut that lets you tween the Volume. The only lacking feature, perhaps, would be the callback. I’m not sure if there is one, but the documentation did not provide an example.

MC Tween’s documentation is very well written, unlike Fuse’s. That’s why I think it will be a better tween engine for beginners or non-programmers to start off with.

Check it out and let me know what you think. :)

Did you know? #2

That breaking apart Bitmap objects in Flash will lower its quality albeit it’s minimal.

Also, if you import an swf which consists of a Bitmap sequence. It is automatically broken apart each frame.

Keep this in mind if you’re anal about quality. :)

Actionscript Classes Cheatsheets and more

A mini post of links to various Flash stuff.

Actionscript Cheatsheet
You can download cheatsheets and more from here.

form = function
I just stumbled upon this. Not sure what it can be used for yet, but it’s definitely interesting.

XML Parser
This thing replaces and do much more than the default XML Parser in Flash do. Although I’ve never used it before yet. Just stumbled upon it too.

I’ll be writing a post about a XML Prototype you can find in proto.layer51.com soon. Then I’ll compare it to the one above and see if they are similar in any ways.