
localToGlobal() in AS3 not working? The LiveDocs on this potentially very useful method, along with its partner globalToLocal() are not actually very helpful. What they don’t make clear is that you need to be sure to overwrite your point when using it. Simply running a localToGlobal() method on a point in a given scope is not enough. You need to write the result back into the…[Read on]
How to use localToGlobal() in ActionScript 3.0
Choosing a Flash video format for pseudostreaming
We’ve been spending a lot of time recently examining the different video codecs available for Flash and conducting various tests. Our objective has been to choose the best quality video format which also enables pseudostreaming – without using custom servers such as Lighttpd. Pseudostreaming means imitating the behaviour of a RTMP streaming server such as Red5 or Flash…[Read on]
Passing parameters to a MouseEvent listener
Here is how we construct a MouseEvent handler in ActionScript 3.0… Note that we set the fourth parameter, useWeakReference, to true. This ensures that if this listener is the the only reference to the myButton remaining, myButton can still be garbage collected if required. The trouble with this is that every time myButton is clicked, the same URL will open. We can’t easily pass a…[Read on]
Where to install SWCs for Flash CS4
Something we use here is the Google Maps API for Flash, which is delivered as an SWC file. SWC files are ActionScript classes which have been pre-compiled into an SWF. The fact they are pre-compiled means you don’t have to re-compile them every time you export your application. Another benefit of SWCs is that they enable you to deliver functionality while keeping your source code…[Read on]
Cannot install Flash Player on Windows?
You’re having trouble installing the Flash Player Active X control on Windows. Every time you run the installer it quits, recommending an Adobe Technote. The trouble is this doesn’t solve the problem either. You’ve uninstalled the previous player, quit all apps, still no joy. In this situation the cause is probably incorrect registry permissions. You can correct this by using Microsoft’s…[Read on]
Why use init methods in AS3?
Checking our stats, we noticed that some people are searching for “why use init methods as3″. There are actually several reasons to consider using init methods in AS3 rather than having all of your initialisation code in your constructor functions: Constructor functions run slower than “regular” methods. You might want to re-run initialisation code without recreating the instance.…[Read on]
getDefinitionByName() produces ReferenceError: Error #1065
Something we often do here is get the “id” of a clicked menu button and instantiate a section of a site, depending on the ID passed. Usually all sections of a site inherit from a generic “Section” class, then have additional specific capabilities depending on the section. So, depending on the ID passed, we need to create an instance of the particular class. This means we need to get the…[Read on]
TypeError: Error #1006: value is not a function
Another tip: if you get this error, one possible explanation is that you have tried to declare a variable with the same name as an already declared function – perhaps one which has been inherited from a superclass…[Read on]
ProgressEvent.PROGRESS misreports bytesLoaded & bytesTotal
One problem you might run into involves ProgressEvent.PROGRESS events seeming to misreport the proportion of the file that has loaded. This would cause a preloader’s bar to extend beyond the 100% mark. We don’t have time currently to outline the full technical context of the issue, but did spend some time examining it, and we solved it. The solution to the problem was not to use the…[Read on]
Latest blog comments