describeType – an important note

•October 25, 2008 • Leave a Comment

In one of my previous posts (Acedia – apathy and laziness in the practice of virtue), i spoke about the extremely helpful function describeType.

While busy on a project this weekend, i ran into a little problem using describeType and thought i’d put a solution to it on my blog in case anybody runs into the same problem. The problem arose when i used describeType on a bindable class. When a class is made bindable using the [Bindable] syntax, the describeType will not return public variable names, it will return accessors and a whole bunch of other information.

In this situation, instead of typing: var variables:XMLList = describeType(myClass)..variable; try using this: describeType(myClass)..accessor; This will still do the same thing as in the previous example, but will return all the variables in a bindable class.

Hope it helps!

Flash Player 10 – full release!

•October 15, 2008 • Leave a Comment

The excerpt below is from an official Adobe memo regarding the release of Flash Player 10:

Innovative New Features and Adobe Creative Suite 4 Integration Enable Breakthrough Web Experiences

SAN JOSE, Calif. — Oct. 15, 2008 — Adobe Systems Incorporated (Nasdaq:ADBE) today announced the immediate availability of Adobe® Flash® Player 10 software. Interactive designers and developers can leverage the new expressive features and visual performance improvements in Flash Player 10 for unprecedented creative control to deliver the most compelling Web applications, interactive content and high quality video to users across multiple browsers and all major operating systems.

“Designers and developers know if they deliver video, online games, rich Internet applications (RIAs) and other interactive experiences using Adobe Flash Player, they can reliably reach the entire Web,” said David Wadhwani, general manager and vice president of the Platform Business Unit at Adobe. “Flash Player 10 continues to set the pace for Internet innovation, and we’re excited to see how the community is already using it to create an entirely new class of experiences not previously achievable on the Web.”

Adobe Flash Player 10 builds on the capabilities of the world’s most pervasive application runtime with new support for custom filters and effects, native 3D transformation and animation, advanced audio processing, and GPU hardware acceleration. Building on over 25 years of Adobe expertise with text, the highly flexible new text engine in Flash Player 10 provides interactive designers and developers with more text layout options and better creative control. Adobe Flash Player 10 also extends the expressive capabilities of the Adobe Creative Suite® 4 product line (also available today – see separate press release) with new levels of Adobe Flash technology integration to streamline collaboration and enhance the design/develop workflow. Interactive designers and developers can create custom filters and effects with Adobe Pixel Bender™, which is the same technology behind many filters and special effects in Adobe After Effects® CS4 software. Developers targeting Adobe Flash Player 10 can use these filters, blend modes and fills to animate effects or change the effect on rich media content at runtime. Flash Player 10 also enables new capabilities and performance improvements in Adobe Flash CS4 Professional, the industry’s most advanced authoring environment for creating interactive experiences. This includes easy-to-use 3D effects that enable designers to design in 2D and easily transform and animate in 3D.

“Our clients expect innovation,” said Tim Barber, partner and creative director for Odopod, a leading design studio and member of the Society of Digital Agencies (SoDA). “With the improved visual performance and awesome new 3D  effects in Adobe Flash Player 10, we can now use Adobe Flash CS4 Professional to create cool Web experiences that were previously impossible. For us, this means fewer boundaries to the creative process.”

Adobe Flash Player delivers unparalleled creative options, highly engaging user experiences, stunning audio/video playback, and virtually universal reach across operating systems. Flash Player content reaches over 98 percent of Internet-enabled desktops. More than 80 percent of online videos worldwide are viewed using Adobe Flash technology, making it the number one format for video on the Web. Adoption of a previous update to Flash Player 9 set all-time records by achieving nearly 90 percent reach on Internet-enabled desktops in less than nine months and Flash Player 10 is expected to achieve a similar adoption rate. Innovations introduced in Adobe Flash Player 10 will contribute to future Open Screen Project efforts, such as work that will bring Flash Player 10 to mobile devices. The Open Screen Project is an industry-wide initiative to deliver rich multi-screen experiences built on a consistent runtime environment for open Web browsing and standalone applications across personal computers, mobile devices, and consumer electronics. More information about the Open Screen Project is available at www.openscreenproject.org. To learn more about the new features and read what designers and developers are saying about Adobe Flash Player 10, visit www.adobe.com/products/flashplayer/

 

Adobe Flash Player 10 is available immediately as a free download for Windows, Macintosh and Linux platforms (including new support for Ubuntu 7 and 8 ) from www.adobe.com/go/getflashplayer. Support for Solaris is expected  later this year. All of the new expressive features and performance improvements introduced in Adobe Flash Player 10 will be available in Adobe® AIR™ later this year for designers and developers to build applications that run outside the browser.

The debugger and standalone versions are available here.

I feel that this release will be even more revolutionary than the next! So many new features and improvements have been included and the future of our web development looks very promising indeed ;)

Acedia – apathy and laziness in the practice of virtue

•October 12, 2008 • Leave a Comment

I am an admittedly lazy programmer and therefore, i hate doing manual “labour” with regards to coding. A perfect example of manual labour in coding is writing APIs. The toString() function kills me! I like to write my own toString() functions for enhanced debugging, but i couldn’t take it anymore. I’m working on a project in which the one class has 10 public properties and i refused to write a function that would put all 10 in a pretty, indented, explanatory format. So i began digging in the AS3 API and found this beauty…

describeType(value:Object):XML

In AS3, the for..in loop does not enumerate properties and functions declared by a class (thanks to Emmy Huang). What this means is that you cannot create a toString() function like this – which is what i’d hoped to do.

Instead, what you have to do is use the describeType function in your for..in loop instead of using this. However, the describeType function returns an XML layout of your class, so – for example – to enumerate all variables in the XML returned from this function, simply do this:

// enumerate variables in its own class
var variables:XMLList = describeType(this)..variable;

// enumerate variables from outside its class.
var variables:XMLList = describeType(getDefinitionByName(“MyClass”))..variable; 

 

Then, with the variables XMLList, you can loop for all variables in your class, do whatever you like with them, and know deep in your heart that you’re such a lazy fucker :D  

Holy CS4

•October 9, 2008 • Leave a Comment

Today i attended the Adobe CS4 Product Launch and boy, it was fucking cool. Although, as a Flex developer, there was nothing new for me personally in the new Creative Suite, their presentation of some of the new features in every single application is making me seriously consider dropping Flex and taking up After Effects! ;) haha not likely, but damn! Those new applications are ridiculous.

In the gob-smacked state that i write this, i would still like to thank everyone over at Adobe SA for organizing such an astounding presentation of Adobe’s omnipotence.

I was truly dumbfounded by the demonstrations provided by all the presenters, namely:

Greg Rewis (USA) – http://blog.assortedgarbage.com/
Jason Levine (USA) – http://blogs.adobe.com/jlevmedia/
Mo Jogie (SA)

Thanks again to everyone involved, and i’m loving this t-shirt i got :D

I would definitely encourage you all reading this post to look out on the 15th of this month for the official CS4 release in SA. “It’s going to be brilliant”.

Official CS4 Launch in Johannesburg!

•October 7, 2008 • Leave a Comment

Some very exciting news for all users of Adobe software…

Adobe will be hosting a 7-hour monster conference at the Il Grande Theatre at Monte Casino in Jhb on Thursday. Entrance is free but you must register at http://adobe.vcorrespond.com.

This is going to be amazing! I’m so excited :D

 

Details:

Location: Il Grande Theatre, Monte Casino
Time: 10h00 to 17h00
Date: Thursday, 7th October 2008 

 

See you there!

GAFLUG October Meeting

•October 2, 2008 • Leave a Comment

GAFLUG (Gauteng Flex User Group) will be holding their monthly meeting on Tuesday, 7th of October. The meeting is open to anyone who wants to join. For more infortmation, check out http://flexibility.co.za/node/15. I will be giving a presentation on Flex application skinning using CSS, Flash, Photoshop, Illustrator and Fireworks.

Hope to see you there!

Community efforts

•September 12, 2008 • Leave a Comment

I’m a very investigative programmer in that i’m always looking for packages that will make my life easier, my application more vibrant or more exciting, or my ideas come alive. Below is a list of incredible packages developed by the community and are free for usage (but be sure to check the licences individually for any fine print).

RSS/Atom

as3syndicationlib – an excellent package for reading all RSS/Atom specifications, or using the generic parser.

Tweening

TweenLite, TweenFilterLite, TweenMax (not MaxTween, Neil :P ) – amazing trio!

Caurina’s Tweener – probably the simplest Tweening engine i’ve come across

gTween – looks promising, haven’t tried it yet, though.

3D

Sandy3D – by far, the best documented and well-designed 3D engine i’ve come across.

Papervision – apparently the 3D package, but there are very few tutorials. If anybody knows of some, let me know.

Alternativa – built by a bunch of crazy Russian coders… Ridiculously impressive, difficult to use.

Utilities

as3corelib – A collection of handy utilities for encryption (SHA1, MD5), encoding (JPG, PNG), and a myriad of other useful bells and whistles.

Cryptology

as3crypto – An incredible package for encrypting and decrypting your data using everything from MD2, LZW and RSA.

Database Interaction

asSQL – A package for connecting to a MySQL database directly from ActionScript 3.0!

Frameworks

PureMVC – my personal favourite… Brilliant framework!

Cairngorm – a good (albeit difficult and clunky) framework developed by Adobe

Mate – a tag-based framework… Looks good, haven’t tried it yet

Components

flexlib – great collection of components for usage in Flex

Site-related APIs

Facebook

Amazon

Yahoo!

Google

Physics

APE

Remoting/Webservices

as3httpclientlib

amfphp – the godsend.

WebOrb – fantastic effort by themidnightcoders… ports for many languages

External Resources

bulk-loader

Metadata

metaphile – a package for reading and writing metadata of common filetypes

Hope this is useful!

—–
Danny

The Greatest Ball-ache

•September 12, 2008 • Leave a Comment

The greatest ball-ache in my line of work as a Flash/Flex developer is the collaboration with designers. For the sake of clarity, I do not detest designers, but rather – trying to emulate their designs. The fact of the matter is that designers and developers think in a completely different way! One of my ex-students made a great and very wise analogy:

Say, for example, you have a designer and a developer – both standing in front of a door. The designer will look at the door, notice its design, its tone, its blending in with the wall, conflicts with other surrounding colors, etc. The developer will look at the door, notice its width, height, and mentally calculate the most efficient way to open the door.

This is a gross over-simplification, but i feel it rings true. Designers don’t generally think about functionality, and developers only think about functionality. Sure – both want a sleek, sexy, visually appealing and functional product, but to actually form an efficient and working relationship between designer and developer is highly unlikely, and very frustrating.

Typical project scenario: client asks for a site to be built, designer creates a mock-up of the design, and the design is given to the developer to incorporate into his application. Now this, for me, is the greatest ball-ache because designers do not think about an application in terms of rectangular bounds, screen-size restraints, loading time, practicality, etc. All they think about is the design – and that’s what they’re paid to do! (NB: i have nothing against designers!)

So now where does this leave us developers? We have to either:

  • cut up the design and create many individual images – what a mission!
  • try and emulate the design using code – never works
  • or skin the application (if you’re using Flex) – what a mission!

It must be said that Adobe has already created mechanisms for bridging this gaping divide between designers and developers, and they work well if you know what you’re doing and have the patience of a saint! I, on the other hand, am very impatient and wish that someone, somewhere, somehow could create an application that transforms design into an application – without being too high-level and overly-intuitive.

A couple of weeks ago, my complete awe and undying love/respect/fear of Adobe resurfaced as i was introduced to Adobe Thermo. I almost started to believe in god again once i saw this application. It is truly, inexplicably and irredeemably INCREDIBLE!

Adobe is such a great company in that they don’t sit back on their laurels and wait. They are a very active company and they listen to their community! The advancements that Adobe is coming out with for CS4 are incredible. Flex developers can look forward to earlier nights, less frustration and much more visual appeal thanks to Thermo, and all of the image-maniuplation/creation applications (like Fireworks, Photoshop and Illustrator) and the introduction of the FXG format.

Adobe, you rock my world (and take away my ball-aches) haha!

How to create a chromeless AIR app

•September 10, 2008 • 1 Comment

Are you tired of the standard application look and feel? Personally, i much prefer to build my own GUI in its entireity – by that i mean building not only the visual components of the actual application, but also the window design. Even though i am graphically-challenged (or for the haters of political correctness – “design-retarded”), i still enjoy creating the whole application UI.

In Adobe AIR, to do this is quite simple.

  • Start a new Flex project and choose Desktop Application and call it MyChromelessApp.
  • Find the MyChromelessApp-app.xml AIR descriptor file in the project src folder and open it. There are a number of things you need to change here:
    • Change <!– <systemChrome></systemChrome> –> to <systemChrome>none</systemChrome>
    • Change <!– <transparent></transparent> –> to <transparent>true</transparent>
    • Change <!– <visible></visible> –> to <visible>true</visible>
      Or you can leave the visible tag as false and call the activate function of the nativeWindow property on application creationComplete.
  • Now go into the MyChromelessApp.mxml file and change the WindowedApplication tag to Application.
  • Add this property to your WindowedApplication: showFlexChrome=”false”. This will turn off any chrome settings on your window.
  • Now run the application!

    You will see a chromeless, blank AIR application :)

You can find all the exercise files used in this lesson in Lessons folder in the AS3FD download box in the right sidebar of this page.

—–
Danny

How to reposition/resize a chromeless AIR application at runtime

•September 10, 2008 • Leave a Comment

A couple of weeks ago, I was asked to create an online and desktop widget for a company, using Flex and AIR. They wanted it to have the same kind of look as Google Desktop with regards to its positioning to the right of the screen, and automatically resizing to the height of the screen.

If you don’t know how to create a chromeless AIR app (i.e. an application with no OS-specific look and feel), see my post on how to do this.

http://as3fd.wordpress.com/2008/09/10/how-to-create-a-chromeless-air-app/

In ActionScript, this is simple enough… You can use the Capabilities.screenResolutionX or Capabilities.screenResolutionY for the width and height of the user’s monitor, and obviously x and y for the positioning – but the ball-ache came with trying to reposition/resize the AIR application at runtime.

I’d searched high and low on Google (and irritated an Adobe Platform Evangelist) to try and find a way to do this. I’d obviously tried to leave out the width and height in the AIR descriptor file, and listening for a creationComplete event to be fired by the application, but to no avail. I’d tried everything from this.stage.nativeWindow to this.parentApplication.parentApplication.stage.nativeWindow and nothing fucking worked!

Then – and don’t ask me how – i had a brainfart, and the solution appears below:

What you need to do is listen for an applicationComplete event on the Application. This event is described as follows in the Adobe documentation:

Dispatched after the Application has been initialized, processed by the LayoutManager, and attached to the display list.

For some reason, when you try to execute this.stage.nativeWindow from a creationComplete event, it fucks out. Anyway, listen for the applicationComplete event and in the callback function (the function to be executed on event trigger), you can then do the following:

private function onApplicationComplete (event:FlexEvent):void
{
       // Get the native window of the application -- you must manipulate this object
       var window:NativeWindow = (event.target as Application).stage.nativeWindow;

       var appWidth:uint = 500;
       var appHeight:uint = 500;

       // In this example, we will center-align the window that is 500px wide, 500px high
       nativeWindow.x = (Capabilities.screenResolutionX - appWidth) / 2;
       nativeWindow.y = (Capabilities.screenResolutionY - appHeight) / 2;
}

And that’s it! Is that simple or what?

You can manipulate the nativeWindow in any way you want at this point in the application execution. I hope this helps some of you!

—–
Danny

 
Follow

Get every new post delivered to your Inbox.