Posts RSS Comments RSS 31 Posts and 54 Comments till now

Archive for the 'actionscript 3' Category

Go NOOP with ActionScript 3!

Finding classes and inheritances too geeky or scary? Go none object-oriented programming (NOOP) with AS3! There’s nothing wrong writing ActionScript 3 without any Object-oriented Programming (OOP) practice. What worked last time, timeline based coding with gotoAndPlay, gotoAndStop and tweened animations, still works with Flash CS3 in AS3 and it will work with Flash CS4 in the future.

There’s a vibe that ActionScript 3 is not for designers or non-serious Flashers. The hype is brought up by the improvement of AS3 compared to AS2. Programmers are very happy with AS3 because they can finally do some serious OOP and practices Design Patterns methodologies. Therefore, classes and packages appear much more frequent in tutorials and examples.

For designers, what excites them is visuals, not ease of maintenance or re-usability, which is the whole point of OOP. It’s hard to sell the idea how wonderful AS3 is with lines and lines of OOP codes which doesn’t really move anything around. OOP is great but not attractive to beginners.

This new category “NOOP” focuses on writing ActionScript 3 examples without any classes or OOP and it tries to bring back the painful but sweet programming experiences to designers.

All about preloader Part IV - Preloader in AS3

Based on Part III’s codes, converting AS2 preloaders into AS3 is pretty simple.

Continue Reading »

Introducing PureMVC

pure mvcFor many Flash Developers out there, you have probably heard about Design Patterns, one of which would definitely be the popular Model View Controller [MVC] architectural pattern.

For those that are not familiar with the pattern, suffice to say that this pattern, prescribes a way to separate, the data, business logic, and presentation layer, of an application/microsite in an organized manner.
Continue Reading »

AS3 Migration

For those of you who don’t know this yet, if you’re migrating from AS2.0 to AS3.0 or if you’re constantly using AS3.0 to develop your projects, this is a very handy ActionScript 3.0 Migration PDF reference. It clearly shows the difference between AS2.0 and AS3.0 and tells you what to import when using certain objects, it also tells you what objects has been removed in AS3.0. Certainly good to have it with you when developing AS3.0 projects or if you’re starting to learn AS3.0. There are also other cheatsheets for other platforms like AIR and Papervision which can be found here.

Link: ActionScript Physics Engines List

minidxer kindly collected all physics engines available.

Fullscreen Flash is so COOL! BUT…

There are some security restrictions. The full article can be found in Adobe’s website. Two restrictions are very important:

  1. “Users cannot enter text in text input fields while in full-screen mode. All keyboard input and key-related ActionScript is disabled while in full-screen mode, with the exception of the keyboard shortcuts that take the viewer out of full-screen mode. ”

    This restriction keeps most website/application away from fullscreen mode. Almost all websites and applications need keyboard interaction. Bringing the user out of fullscreen mode to fill up a form is not user-friendly.

    It was stated in Square Factor’s blog that the reason for disabling input is to avoid phishing activities. “…attacker could mimic the look of the operating system / browser to force user to enter sensitive data, such as passwords or serial numbers.”

  2. “The ActionScript that initiates full-screen mode can be called only in response to a mouse click or keypress. If it is called in other situations, it will be ignored (in ActionScript 2.0) or throw an exception (in ActionScript 3.0).”

Actionscript 3 scrollbar

I created this scrollbar some time back. I did not use it in a actual project yet but I think it should be useful for those who are doing websites in AS3. It is customizable with Tweener effects selection. It scrolls mainly movieclips, so as long as you convert your text or images to movieclips, you can scroll them. Here is the scrollbar source.

This movie requires Flash Player 9

Extend Flash

snippets panel screen shotOn Lee Brimelow’s blog he has created a few handy flash extensions to make coding in AS3 easier. I suggest getting the code Snippets panel extension and the Event Generator extension.

With the Event Generator just select an item on stage and select what you want to do with it in the panel. Click copy to clipboard and then open the actions panel and paste the code there.

_global in ActionScript 3

There’s no more “_global” in ActionScript 3. I wrote this class to bring it back. Here’s an example of exchanging values between two .swf files. example.swf assigns value into “_global” and external.swf watches it. The source file is here.

This movie requires Flash Player 9

There are other solutions. AS3 Global Object is a powerful package that goes beyond “_global”. Jonathan Greene’s solution is very neat and easy, too. The basic of all solutions is to use static variables and functions. Using static variables and functions is the easiest method to communicate between classes and movie clips. I’ll explain that in future posts. Meanwhile, this entry in help manual helps to understand what “static” means.