AlertTabNavigator

February 8th, 2010

We built this component some time ago for use on a gaming/gambling site.

We required a way to alert the user that something important was going on in one of their games, but we didn’t want to use a popup, blocking the user from their current interaction. This was because the user may have been in the process of doing something important or timed.

Each game sat inside its own view component, and these were then housed in the AlertTabNavigator. It enabled use to show when a view required attention, without getting in the way.

Here’s a couple of examples. The first shows how dispatching an event from one of the children on the AlertTabNavigator updates the tab to show its alert styles, or resort back to its standard non alert styles. Selecting an alerted tab, always dismisses the alert.

Read the rest of this entry »

London Flash Platform User Group January 2010

January 14th, 2010

The start of 2010 sees LFPUG continuing with the same format, 2 one hour presentations on the last Thursday of each month.

First session of the year will be presented by Dennis Ippel with a session on 3D workflows for Flash. Following Dennis will be Adam Chappell with a session on SEO for Flash.

London Flash Platform User Group 28th January 2010 (28/01/2010)

Sponsored by (and huge thanks to) friends of ED.

AnimateTransitionShader

January 11th, 2010

A couple of days ago Corey Lucier posted a couple of nice examples of the new Flex 4 AnimateTransitionShader.

Like Flex 3, the new effects don’t handle being interrupted well. They jump abruptly to the end of the current IEffectInstance, then start a new one. The abruptness is what your trying to get away from when you decide implement an effect, opting for a smooth transition.

With a bit of tweaking about it was fairly easy to hack around this. Here’s what i changed

  • When an effect instance is interrupted it takes a snapshot of the view, and passes this a a bit of other info to the effect factory.
  • The effect instance then stops the final value being applied.
  • When creating an effect instance the effect factory looks inside itself for any interrupted effects that have the same target. If it finds one it passes the data through to the instance.
  • The effect instance then uses the snapshot to transition from.
  • In the examples below I’ve added a couple of more states and a ButtonBar to navigate. I’ve also removed the easing to make it a little simpler to see. If you click around a bit you should see the difference.

    Read the rest of this entry »

    FilterComboBox

    January 5th, 2010

    Here’s a little component I knocked out over the holiday period for use in a current project.

    Its basically a rip of ComboBox (extends ComboBase due to private methods in ComboBox), that will filter the dataProvider depending on what the user enters into the TextInput, and select the text to show you where a match is found (can only select the first match in FP9). You can also set it to be case sensitive (false by default).

    There’s a few other components out there with the same functionality (some you have to pay for some you don’t), most of which can be found doing a search for ‘AutoCompleteComboBox Flex’.

    They either didn’t quite do what we wanted or were too complex for our needs.

    Read the rest of this entry »

    Using Spark Containers in MX Navigators

    December 30th, 2009

    I love mx Navigators (ViewStack, TabNavigator etc.) yet when adding spark containers to them you get the error…

    The children of Halo navigators must implement INavigatorContent.

    If you want to use the new spark containers you need to wrap them in, or just use spark.components.NavigatorContent (not easily found unless your using design view). NavigatorContent itself extends spark.components.SkinnableContainer so you can use it much like a Group and set a custom layout.

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
    	       xmlns:s="library://ns.adobe.com/flex/spark" 
    	       xmlns:mx="library://ns.adobe.com/flex/mx"
    	       minWidth="955" minHeight="600">
     
    	<s:layout>
    		<s:VerticalLayout/>
    	</s:layout>
     
    	<mx:ViewStack id="vs" width="400" height="200">
     
    		<s:NavigatorContent width="100%" height="100%" backgroundColor="0xFF0000">
    			<s:layout>
    				<s:VerticalLayout/>
    			</s:layout>
    			<s:Button label="vertical button 1"/>
    			<s:Button label="vertical button 2"/>
    			<s:Button label="vertical button 3"/>
    		</s:NavigatorContent>
     
    		<s:NavigatorContent width="100%" height="100%" backgroundColor="0x0000FF">
    			<s:layout>
    				<s:HorizontalLayout/>
    			</s:layout>
    			<s:Button label="horizontal button 1"/>
    			<s:Button label="horizontal button 2"/>
    			<s:Button label="horizontal button 3"/>
    		</s:NavigatorContent>
     
    	</mx:ViewStack>
     
    	<mx:ToggleButtonBar dataProvider="{vs}"/>
     
    </s:Application>

    London Flash Platform User Group December 2009

    December 9th, 2009

    As usual I’ll start this LFPUG post with massive thanks to Trevor Burton and James Alliban for their presentations last month. As usual you can find the videos, presentations and source files in the presentations section.

    This month due to the season of good will we’ll be meeting up a couple of weeks earlier than usual and there will be no presentations. Instead we’ll be meeting up for chinese food and booze.

    That said we’ll still be having the raffle, and this month we have a full conference pass to FITC Amsterdam to give away!

    London Flash Platform User Group 17th December 2009 (17/12/2009)

    Sponsored by FITC.

    Thanks Adam Robertson

    November 19th, 2009

    Recently good friend Adam Robertson spent some time upgrading all my WordPress blogs to try and help combat the masses of spam and crap that were being hidden in the pages.

    Many thanks Adam!

    London Flash Platform User Group November 2009

    November 17th, 2009

    Huge thanks to both Eamonn Faherty and Richard Lord for their excellent presentations last month. As usual you can find the videos, presentations and source files in the presentations section.

    First up this month creator of Paperworld3D, Trevor Burton with a session on the open source streaming server Red5 and up after him James Alliban who recently talked at Adobe Max, presenting a session of augemneted reality in Flash.

    London Flash Platform User Group 26th November 2009 (26/11/2009)

    Sponsored by friends of ED.

    Read the rest of this entry »

    DataStack

    November 13th, 2009

    A couple of weeks ago I made a post about using Repeaters in ViewStacks and I mentioned in the post I’d put together a class called DataStack that worked in the same way as a ViewStack but was driven by a dataProvider.

    I then realized that using a Repeater inside a ViewStack would achieve the same result, but one thing I didn’t mention is that the DataStack re-uses its children like itemRenderers.

    This means that if you only add one child to a DataStack, but supply a dataProvider with 1000 items, it will only create the one child and re-use it, unlike the Repeater and ViewStack combination which would create 1000 instances of the same child.

    In addition recently I added a little more code so that you can add more than a single child to the DataStack and it will cycle through through them as you change the selectedIndex. So if you supply 2 different children and a dataProvider of 1000 items, it will reuse each child 500 times, the child at index 0 for all the data at the even indices, and the child at index 1 for all the data at the odd indices.

    Due to the fact that DataStack isn’t a ViewStack (i.e. it extends Container not ViewStack), it won’t work with the Efflex viewStackEffects, and therefore I created a dataStack effect for Efflex and an example that extends it.

    DataStack Example (right click for source).

    The source for DataStack can be downloaded from our Google Code repository.

    UITintedMovieClip

    October 28th, 2009

    Recently the subject of tinting skins created for Flex has cropped up a couple of times.

    Here’s a little class I threw together that enables this from Flash. Instead of extending UIMovieClip you can extend UITintedMovieClip. This new class will look for a style set on your Application class named skin-tint.

    In Flash you then create all your skins in greyscale and the class then uses ColorTransform to tint itself.

    UITintedMovieClipExample (right click for source).

    This class only handles tinting of one color, but its feasible if the skin creator used MovieClips inside the skins with a defined naming convention, different tints could be applied to different instances.

    I’ve also added the class to our Google Code repository.