Flex

what happened to my tweets?

The dark bit of sky in this blog’s header contains a simple SWF generated from pure AS3 that uses the Twitter API to collect and display my history of twitter messages. Unfortunately there is now a cross-domain policy file preventing any SWF other than those hosted actually from the twitter.com domain from accessing the feed. Apparently due to a security issue. The current suggested work-around is for me to write a proxy php script to sit on my own server to relay the feed request. Which I might do if I can be arsed, but I’m feeling grumpy today so I’m more likely to abandon Twitter all together – not that I ever over used it.

Twitter development talk on google groups has a thread that reveals some of the thinking going into solving the issue.

Posted by creacog in Flash Platform, Flex, twitter, 0 comments

DragManager workaround in final Flex3/AIR1

With today’s availability of release versions of Flex 3 and AIR 1, I’ve finally had a chance to apply the DragManager workaround that I had a moan about last month.

The flex documentation presents three configuration options for DragManager in AIR projects

[Extract]

  1. Your main application file uses the <mx:Application> tag. In this scenario, you use the Flex drag-and-drop manager, and cannot drag and drop items from outside of AIR.
  2. Your main application file uses the <mx:WindowedApplication> tag. In this scenario, you use the AIR drag-and-drop manager, and can drag and drop items from outside of AIR.
  3. Your main application file uses the <mx:Application> tag, but loads the AIR drag-and-drop manager as represented by the mx.managers.NativeDragManagerImpl class. In this scenario, you use the AIR drag-and-drop manager, and can drag and drop items from outside of AIR.

Sounds all well and good. Except to use <mx:Application> within AIR, you lose functionality. For instance in my case while the window was re-sizeable, the content remained at the default size. What I really need is to use <mx:WindowedApplication>, but with the Flex DragDrop manager. A scenario not represented in the documentation.

Fortunately the workaround with files described in bug SDK-13983 so-far appears to work. However it is worth noting that in using it, a number of mxml tags change their namespace from mx to comps. In my case this affects

  • <mx:states>
  • <mx:transitions>

which then become

  • <comps:states>
  • <comps:transitions>

Possibly my reliance on this approach is due to the now legacy nature of the project – it was written in advance of the Apollo 1 alpha. However apart from this issue, very little has had to be re-written through the beta cycle of AIR.

Posted by creacog in ActionScript, Adobe, AIR, Flex, Flex 3, Flex Builder, 2 comments

A flurry of events : Adobe/Flash/Flex

A busy few weeks starting tonight:

  1. [Thurs 21-Feb-2008] LFPUG – Thermo Special presentation from Adobe
  2. [Mon 25-Feb-2008] Adobe sponsored Pokercoder Tournament II  – you need to be a professional user of Adobe products to join in
  3. [Thurs 28-Feb-2008] LFPUG – presentations on ‘Successful Flash Games’ and ‘Practical Particle Effects with Flint’
  4. [Wed 5th March] FLUG – Beer, presentations and chat about Flex
Posted by creacog in ActionScript, Adobe, AIR, CS3, DreamWeaver, Fireworks, Flash Platform, Flex, Flex 2, Flex 3, Flex Builder, 0 comments

bitten by the beta 3 DragManager Bug

I’ve just found myself caught out by this bug (SDK-13983) in Beta 3 (released December 2007), and the quite substantial change in behaviour.

My application which is only a prototype – but quite heavy, was essentially built from Oct 2006 through to April 2007 and  worked happily in Apollo and in all AIR and Flex 3 releases since, until Beta 3, when the DragManagers of AIR and FLEX implementations diverged. The API remains pretty much the same, but the behaviour is quite different (documented here), and while my existing code compiles, it generates run-time error “ArgumentError: Error #2004: One of the parameters is invalid.” if the user dare drag my UI components, rendering it useless.

That it has been accepted as a bug and a fix/workaround created, and that that is visible in the public bug system is a good thing. It removes a lot of potential worry. That the fix is not available to the public (AFAIK we’ve had our last public beta before the final release) isn’t great for me as I am now in a catch 22.

  • The fix isn’t available to me until the final version is released.
  • I can’t continue to use my application compiled against Beta 2 as the install process for AIR currently demands Beta 3 of AIR
  • Beta 3 AIR  demands Flex Beta 3 SDK.

It’s late, so this is going on hold until morning, at which point I need to assess the impact and time required to make the changes to adopt the AIR drag-and-drop manager, or hold on until I can force the switch to the Flex drag-and drop manager when the final release is available. Or beg Adobe for access to a build later than 191577.

Posted by creacog in Adobe, Flex, Flex 3, 1 comment

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

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

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

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

option up and down

Kicking myself for not finding these sooner so, posting in line with the current trend of highlighting little Flex time-savers. Two ActionScript editor short-cuts (and probably apply to any Eclipse code editor?)…

1. Select some code in the ActionScript editor and press Option-Up or Option-Down, and the selected block of code gets moved accordingly. Or just place the cursor on a line if you only wish to move a single line. Saves a load of messing with Cut-Paste.

2. Need to duplicate a line? Place the cursor at the start of the line and press either CMD-Option-Up or CMD-Option-Down, and the current line (or selection if you have one) gets duped above or below the cursor respectively.

With either of the above, if you make a selection, you don’t need to be character accurate. The movement is applied either to the line touched by the cursor, or the lines touched by the selection. i.e. If you select part of a line, the whole of that line is included in the selection to be moved.

Posted by creacog in ActionScript, Eclipse, Flex, Flex 2, Flex 3, 1 comment