Flash Platform

more capacity for this week’s FLUG

This week it is a biggie with contributions from Adobe’s Serge Jespers and James Ward presenting Flex 3 AIR and Vega.

The event had reached capacity but with a new venue organised and more capacity, if you couldn’t sign-up over the last couple of weeks, you now have another opportunity.

Flex London User Group (FLUG) 

Posted by creacog in Adobe, Flex, User Groups, 0 comments

LFPUG off to a flying start to 2008

Again it looks like a couple of really interesting subjects on 31 Jan:

  • PureMVC
  • The 3rd Way: Handling 3D on the Web

More information is on the LFPUG site

I looked at using PureMVC previously for a simple tennis game, but left it aside in favour of building MVCish classes independent of any ‘framework’. I look forward to seeing if this decision saved or cost me time.

I haven’t got around to the obligatory 3D stuff yet. Personally I’ve always found it a bit of a red-herring, and one where the cost:benefit often falls short. So I’ll be particularly interested in seeing examples of good use.

Posted by creacog in 3d, ActionScript, Adobe, Flash Platform, User Groups, 0 comments

Flex Builder 3 beta 3 – install gripe

So, the installation instructions quite clearly warn not to install this version over a previous beta. But then they include instructions how to “When using Flex Builder 3 Beta 3 with a workspace from a previous beta, please clean and reinitialize the workspace.”.

Unfortunately for me this didn’t work. I’d fully uninstalled the previous beta. But when attempting to re-use the existing workspace even with the ‘clean’ steps undertaken, the result was a broken installation of the builder. It couldn’t find any of the SDKs.

Uninstalling, getting rid of the old workspace and reinstalling then worked. Just leaving the job of manually setting up the projects again. This might be due to my configuration – I don’t keep project source files in the workspace – it only contains paths to the respective project folders on my system.

On a more positive note, the whole thing feels a bit more spritely.

Update: Actually, it is less of an issue to import projects than I first thought. In my first attempt I set my project folder and left the Project location at the default. This replicated the project files into the workspace folder. Not what I wanted. The solution, if slightly counter-intuitive, is to set the import from and the project location folder paths to be exactly the same path. This correctly makes Flex aware of the project , while leaving the files where they should be.

Flex project import

After the import – a quick clean then we are off!

Posted by creacog in Flex, 0 comments

Three is the magic number at Adobe

Just as I’m about to head into hibernation for a week or so without computers or any connectivity, Adobe go and release all these goodies. Something to look forward to on my return…

  • AMF3 Specification
  • Blaze DS – Free LGPL Remoting and Messaging for Java (ok not three, but free!)
  • Flex 3 Beta3
  • AIR Beta 3

A good start-point to read more (a brief paragraph on each) is Ted’s OnFlex blog, and of course the Adobe labs site.

Posted by creacog in Adobe, AIR, Flex, Flex 3, 0 comments

strange stage-size problem, but only in ie6

I’ve just been working on an small piece of pure ActionScript3. Essentially the migrating from the large horrible Twitter Widget that I had in the right column, to the text-only representation now overlayed on the header image above.

I use SWFObject to embed the SWF in the page. I set the dimensions of the SWF to 780×45. Within the main function of the SWF I prevent the stage from scaling and set it to align top left. I then use the stage.stageWidth and stage.stageHeight properties to draw a semitransparent background within which to position a TextField then trot-off to get the Twitter feed.

All is well on Safari and Firefox. But when I test on Internet Explorer 6, strange things happen. The first time a page loads, it displays ok. But reload the page, or navigate to another within the blog where the SWF is loaded from cache, and the layout is quite messed up. Testing showed that this is because the stage’s stageHeight and stageWidth are returning value 0 in this circumstance. Further testing shows that although the stage’s initial size is 0x0, it does get resized at some point.

The solution I’ve implemented is to listen for and handle resize events. Mildly frustrating as I didn’t plan on dealing with resize. The only reason my application is structured like this is to allow the SWF to adapt to the dimensions set via SWFObject. Not to allow the SWF fluid resizing through it’s life.

Simply moving the positioning code to the resize handler solved the ie6 problem, but for the other browsers that render at the correct size from the off, no resize event fires. So from our main function we have to put a manual call in to the resize handler (with null as the argument), and then only modify positioning if the stage dimensions are something other than 0x0.

Posted by creacog in ActionScript, CS3, 3 comments

creative-cognition builds a flash game

The makers of StarCraft need have no fear, but I finally got around to implementing my first Flash based game. A simple retro tennis style game, built as a brand building exercise and integrated by my client into a Facebook application.

CVL-Tennis thumbnail

This was a fun project to work on and programme. To initially build a pure AS3 application, and to later integrate that with Flash CS3 when the real graphics were ready.

It was also an exercise in use of MVC. Since we did not use PureMVC nor any other other framework, using this pattern loaded the initial development with some seemingly onerous complexity. However the time invested later paid off in allowing easy adaptation of that game engine to the various graphics and controllers tried through testing.

Some links:

Posted by creacog in ActionScript, Adobe, CS3, Flash Platform, Flex, Projects, Work, 0 comments

a shout to my corporate site

creative-cognition

After a number of years of content-neglect, and problems of client confidentiality, I’ve finally got around to posting up a case-study covering some simple Flash based work samples. (Note: work samples, not code samples). Flash platform case-studies will be being posted more regularly here on in. But kicking off now with three bespoke user-interface elements : A special accordion, a minimal bouncing menu and a HTMLtext text builder.

The user-interface elements presented may not set the artistic Flash world on fire, but each represent very specific design solutions. They were also interesting and fun to programme.

Bespoke user-interface elements.

Note: creative-cognition ltd is no-longer trading

Posted by creacog in ActionScript, Flash Platform, Work, 0 comments

Flash CS3 : finding the gradient transform tool

I’ve just been driven up the wall trying to find the Gradient Transform tool. 🙁 Most of my work in the IDE is arranging libraries of assets supplied by others, for coding. So for drawing I am a newbie.

I needed to make my own block with a gradient. I knew there was a tool for modifying one once created, but I couldn’t see it in the tool panel, I couldn’t find an option for it in the Modify menu, and the Help page simply referred to it in the Tools panel.

Loation of the Gradient Tool

I eventually found it hidden behind the Free Transform tool : you have to click-hold Free Transform to reveal the Gradient Tool. I still haven’t found it in the menu hierarchy. I have posted comment to livedocs, but thought it worth posting here in the meantime.

Posted by creacog in CS3, Flash Platform, 14 comments

sensible(ish) code print from flex builder (on MacOS X)

Continuing the theme of occasional Flex Builder hints and tips…

Occasionally I need to see code printed on paper. Unfortunately the printing capabilities of Flex Builder, or more specifically in this case, Eclipse, are a bit messy…

  • the font is huge, and only 49 lines fit on an A4 page
  • if you have a background colour set to your code window, it gets printed – decimating your ink-tanks
  • printing is a two dialogue process – you have to go through Page Setup each and every time.

Of course in the actual Print dialogue, you have the standard Mac ability to change the page layout, paper handling etc, and save that detail in a pre-set. However…

The key things I want to achieve is to print 2up full duplex black and white, which gives me four pages of code per sheet of A4, and with a slightly smaller font size I get a more respectable 68 lines of code per ‘page’.

However I’ve found the following approach, once set-up, a little more convenient, and becomes a one-click print…

The Mac has a GNU enscript installed which converts text files to PostScript to send directly to CUPS. In my case I had to update the old Gimp-Print drivers to the current Guten-Print drivers in order to achieve duplex printing.

More information on Guten-Print and access to the drivers on SourceForge. The DMG contains good documentation and a simple package installer.

Once the new drivers are installed, and I’d recommend a new, additional, print queue be set up with appropriate defaults for your code printing, you need to set Eclipse to run an external script to print the currently active code window. From the menu: Run > External Tools > External Tools…

  • Name: enscript
  • Location: /usr/bin/enscript
  • Arguments: -2rT4v -DDuplex:true -diP5000 ${container_loc}/${resource_name}

Obviously you’ll need to tweak the arguments according to your personal print configuration.

External Tools Dialogue

Posted by creacog in Adobe, Eclipse, Flex, Flex 2, Flex 3, Mac OS, 0 comments