I have recently discovered a bug in Flex 3 whilst loading multiple modules. As you may know I now build a pool of modules in my PureMVC Multicore applications and load them sequentially on application start up. I have found that the ModuleEvent.READY is not always firing on each module load when Flex is whipping through all the modules rapidly loading them.

https://bugs.adobe.com/jira/browse/SDK-14669

A work around I have implemented is use a simple counter to load the modules in the array i.e. _modulePool.getItemAt( counter ). When a module is loaded a notification is sent and the next module is loaded. This seems to be a very straight forward solution that is easy and more importantly works.

This bug is apparently fixed in Gumbo!

Here’s a real simple quick note that if you using the SWF Object Flex template and want to set the browser page title using Flex then change the below value in index.template.html:

1
<title>${application}</title>

to

1
<title>${title}</title>

And obviously in your mxml:

1
mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" pageTitle="Newtriks"

Hair pulling time. For some reason I am having a major trauma over this one so I am putting it out there on my blog for some potential guidance please.

Scenario:

  • In a UILibrary.fla I have a MovieClip named CustomMC with a linkage id of CustomClass
     +    I have a class named CustomClass.as with all the CustomMC assets declared
    
  • I then import the UILibrary.swf into a seperate app and load the CustomMC
  • var myClass:Class = loader.contentLoaderInfo.applicationDomain.getDefinition(name) as Class;
  • var obj:Object = new myClass();
  • I can now add this to the DisplayList no problem
  • Problem is registering the loaded asset to the CustomClass.as

No matter what I do whether registerClassAlias and the getClassByAlias I end up with a whole heap of problems such as cannot convert CustomClass to Class (my casting fails), the DisplayObject ends up as null, the CustomClass is not getting instantiated and if it does I cannot access any of its public variables i.e. stage instances!!!

All I want to do here is load a movie clip asset from a swf library and the dynamically associate it with a custom class?

Any thoughts or code tips would be greatly appreciated…

Scribblar is now live and kicking ready for you to create rooms and interact with multi-users via text/audio chat and an awesome interactive whiteboard. This is in my opinion the best real time white board application I have ever used or seen!

All based on Flash Media Server and built in Flex its uses are varies: + Online training and tutoring + Revising artwork and images + Creative brainstorming + Sales and product demos + Interviews and tests

Oh, and its FREE!!!

Go check it out now

www.scribblar.com

I ran into a problem on installing Drupal on a shared host server. The problem arises (see error script below) when the installation script hits the php method to check whether register_globals is enabled. For security purposes register_globals needs to be enabled but on some shared hosting this is simply not a feasible option.

Read on →

Quick little tip I never knew about for removing css type selector warnings from the Flex Builder problems panel (that irritated the hell out of me):

Go into your project properties panel and select the Flex Compiler option and add the following into Additional compiler options:

-show-unused-type-selector-warnings=false

Thanks to this post by Daniel R.

To tackle preventing a swf from caching in a browser window without using cf, php, etc, I have the script below using javascript to generate the random number to append to the swf url. It would be good to hear if anyone has any other methods to handle this one or if there are any glaring flaws in a particular browser related to caching.

Read on →

I have seen a few peeps out there trying to get Form Fields to gain focus in Flex and the blinking cursor to also display in the primary focus field.

Using form_text_field.setFocus(); will get you the halo surrounding the text field but the blinking cursor will not show within the text field as the SWF will not have focus in the browser window.

I achieve swf focus in the browser window in Flex by using oleg’s flex template and simply adding the below to the template:

Read on →

Garbage collection (gc) in Flex/Flash for Flash Player 9 is a well known issue that has seen to be resolved in Flash Player 10. But as with all player upgrades its not always a simple process for companies out there, especially large size corporations therefore I have my hands tied with using Flash Player 10 in some of my clients apps.

So I was not overly surprised to note an increase in memory in a PureMVC MultiCore application that loads and unloads modules and utilises the Pipes utility. This was, however, something that I needed to tackle with the prospect of some of my modules being welter weight in size and thus on repeated loading and unloading had the potential of bringing a system to its knees (ok slight exaggeration).

A period of time ensued with the primary focus to try and tackle this problem. MultiCore apps with the addition of Pipes can throw in a few extra ties necessary for removal, being that its complex enough to perform all household cleanup chores for an efficient gc, the thought of removing incoming/outgoing pipes, mediators and cores can appear daunting. But it can be done and you know what, it ain’t that hard! Read on →