Flash: Convert a function reference to a readable string
Friday, April 23rd, 2010
If you have a function reference in Flash there is not a lot of information you can get from it. Converting the function to a string will only give you: (more…)
If you have a function reference in Flash there is not a lot of information you can get from it. Converting the function to a string will only give you: (more…)
If you are working in the Netherlands on a pc with MXMLC (FCSH) you probably get all your errors in Dutch, like:
“Functie heeft geen hoofdtekst.” or “Waarde van het type Function is gebruikt waar type void werd verwacht. Mogelijk ontbreken ronde haakjes () na deze functieverwijzing”.
Funny, but not very handy since most help and documentation is in English. So I wanted my errors in English. FCSH does not have any option to change the language. Changing Windows to English doesn’t change anything and setting the location to U.S. doesn’t help either. Finally we found out that setting the format to”English (United States)” will set MXMLC to English:

Unfortunately this will also change your number, currency, time and data formatting. But you can customize this back to the Dutch settings.
‘Temple‘ is the name of our AS3 library we use at MediaMonks. Almost all of our AS3 projects are using it. The Temple is inspired on several 3rd party libraries like ASAPLibrary, AS3CoreLib and CaseLib, but adapted to fit our needs.
The Temple consists of several classes we use on a regular basis. They are designed for reusability and optimized for performance and memory usage. The Temple is specially designed to work with other frameworks like Gaia. The core of the Temple focuses on: debugging, destruction and memory management.
Debugging
Many classes are debuggable and have a ‘debug’ property. When this property is enabled, the object logs debug messages which allow you to see what the object is doing. All debuggable objects can be managed by the DebugManager. The DebugManager allows you to run all objects in debug mode.
All messages are logged through the Log class which is easily extended for usage by other logging applications, like Yalog and DeMonsterDebugger.
Destruction
All objects are destructible. By calling the destruct- method, the object will clear all of its data, removes all event listeners, removes itself from the display list (DisplayObjects only of course) and makes the object available for garbage collection. Destruction is recursive, so an object will also destruct all its children.
Memory Management
All Temple objects are tracked, via weak reference, in the Memory class. You can view all objects in the Memory class. This makes it possible to detect if an object’s destruct method is working correctly.
More
We also added many nice utility classes for the initial release of Temple, however there is a lot more to come. Since we are keen on stable, neat, and well documented code we are initially only releasing the core of the Temple library. This code has been used and tested and has proven to fit our requirements. There is a lot more we are planning to release soon, like UI components (buttons, form components, video player), loaders (CacheLoader, ImageLoader) and behaviors.
The Temple can be downloaded from Google code and the documentation can be viewed online.
For updates follow us at Twitter.
The Temple is released under the GNU General Public License which allows you to use, extend or modify the code to whatever you want.
A few weeks ago we launched the new website for We Fashion.
“WE Fashion is an international fashion company. With approximately 230 stores and 3,000 members of staff, WE Fashion is represented in the Netherlands, Belgium, Germany, France, Luxembourg and Switzerland.”
The website is build with Gaia and the Temple. We used some special techniques for this website like:
Multi language, multi locale
Since We Fashion is located in several countries with several languages, the website had to be multi-language. The language is added in the deep-link and you can switch language without reloading the website.
Search Engine Optimization (SEO)
The website is fully index-able by using alternative HTML pages that contain all the content of the website. When you switch off Javascript you can see the alternative HTML. (But the HTML still needs some styling.)
Liquid
The layout of the website is automatically adjusted to fit to the size of the screen. No matter what the size of your screen is. For this purpose we created a LiquidBehavior for the Temple, which handles automatically resizing and repositioning of the objects.
Watch the new website on: http://www.wefashion.com
I am a huge fan of Gaia Flash Framework, I use it for almost all my projects. It is a great framework if you want to create solid and maintainable Flash websites.
But as with many Frameworks it comes with some disadvantages; Gaia creates a .fla file for every page, but a page will not run standalone. After compiling the .fla file you have to test the page through the main.swf. For a huge project this is very unwieldy and inefficient.
So I created this “GaiaStandAloneRunner” which enables you to run your Gaia pages standalone, even with all the assets and SEO copy defined in your site.xml. The code only adds about 0.6 KB to your page swf file. (more…)
If the HTML is larger than the browsers window, using the mouse-wheel will always result in a page scroll in AS3. That’s a bummer if you want to use the mouse-wheel inside the Flash. This problem is better explained here.
After a lot of Googling I found out there wasn’t a good solution for this problem. So I build something that works. (more…)
Building the ‘VARA – Biografie‘ website.
When I saw the design of de website I had to choose if we should use Flash or HTML. Mostly when design and animation is leading I choose Flash. If the content is more important and there is a lot of text, I choose HTML. But for this site the top of the website with the timeline and media player has video and animations. But the rest of the site is mostly text. So 100% Flash or 100% HTML didn’t fit our needs. The best solutions would be if we combined Flash and HTML to get ‘the best of both worlds’. (more…)
For a project I am making a videoplayer which can be controlled by the keyboard. The spacebar is used for toggling between play and pause. But a bug inside the Flashplayer causes my videoplayer to pause or play when entering fullscreen mode. Since this is really anoying I wrote a workaround which seems to be working very nice: (more…)
I thought that when a MovieClip has a stage the MovieClip is on the displaylist and when a MovieClip has a parent, you always could do “this.parent.removeChild(this)”. But that is not true.
The clip on the timeline is only on frame 1. But when the timeline is on frame 2 the clip is still tracing a parent and a stage. Weird enough the parents numChildren is 0. Even “this.parent.contains(this)” results true. So how could you ever check if a MovieClip is on the displaylist?
After 10 frames I try to the remove the Clip from his parent, but that results in an error. How can you prevent that, without using try-catch?
Although we didn’t fix all the bugs, at least we added an auto-update feature. So you can download and play the game and get automatic updates in the future.
Download Bubble Trouble at:
Have fun!