Archive for the ‘Flash’ Category

How to debug AIR for Android

Monday, August 9th, 2010

The requester of doom

At first, it seemed like no matter what I did I’d just get the Enter IP Address or Hostname requester in my AIR app. So, to get rid of this dreaded requester once and for all follow my handy debugging AIR Android checklist!

If you’re new to Air for Android I’d recommend checking Lee Brimelow’s getting started tutorials here and here, and a couple of extra tips here on my AIR Android getting started report.

It is currently a little fiddly to get debugging, but as Air for Android is still in beta, this will hopefully become more seamless in future. But in the current build, here’s a list of things to check:

  1. Check that your phone has debugging enabled in Settings-> Application Settings -> Development -> USB Debugging
  2. Make sure that USB storage on the phone is turned on. (These two settings are required to publish your apps onto the phone)
  3. Make sure both your computer and your device are connected to the same wi-fi network. Sounds obvious I know but sometimes my phone disconnects from the wi-fi.
  4. Within the Flash CS5 AIR Android Settings in the Deployment tab check the Device Debugging radio button.
  5. In the same settings, check Install Application on the connected Android device and uncheck Launch Application on the connected Android device.

    AIR Android debug settings

  6. Enable INTERNET_PERMISSIONS in your app by adding the following to your app’s xml config file. This should be in the same folder and have the same name as your fla file, but with the suffix -app.xml. Open it in your text editor of choice and add the following XML :
        <android>
            <manifestAdditions>
                <manifest>
                    <data><![CDATA[ <uses-permission android:name="android.permission.INTERNET" /> ]]></data>
                </manifest>
            </manifestAdditions>
        </android>

    Make sure you add this to the top of the XML, not the bottom! I put it between the <copyright> and the <initialWindow> definitions:

    ...
        <copyright></copyright>
        <android>
            <manifestAdditions>
                <manifest>
                    <data><![CDATA[ <uses-permission android:name="android.permission.INTERNET" /> ]]></data>
                </manifest>
            </manifestAdditions>
        </android>
        <initialWindow>
            <content>MyApp.swf</content>
    ...

    If you put it under the <initialWindow> definitions, the AIR Android extension seems to wipe it! It took me a while to work this one out, I expect they’ll fix it in the final build. I’ve also suggested that they set this permission by default if you’re publishing a debug build, it’d kinda make sense to me. :)

  7. Now you’re ready to publish the file, so hit Publish in the AIR Android Settings window. Your app will compile and get copied over to your device. But it won’t automatically run.
  8. Start remote debugging in Flash CS5: select the Debug -> Begin remote debug session -> Actionscript 3.0 menu item.

    Set up a remote debugging session

  9. And now run your app. With any luck, you should see the name of your swf in the debug output window.

    Yayz! We have AIR Android debugging!

    You may still get the Enter IP Address or Hostname dialogue box but I must admit I only ever saw this if I didn’t set up the other options correctly. But if you do see it try typing the local IP address of your computer first, then the global one.

  10. So! There you have it. Let me know how you get along and if there’s anything I missed.

Top Cat music game on FlashPlayer on Nexus1

Friday, July 30th, 2010

I hate to say it but not many Plug-in Media projects are optimised for low end machines. We usually squeeze every bit of performance out of Flash to fill every part of the screen with crazy 3D, pixels and video!

But! We found one that works really well! And it works well for two reasons :

  1. It doesn’t stretch the processor (unlike our Papervision3D projects like Big and Small and Zingzillas)
  2. All of its interactions are via the mouse (unlike our games that are usually controlled with the cursor keys).

I reckon we could probably even squeeze a bit more speed out of it with judicious use of cacheAsBitmap, but as it is, entirely made with vectors, it runs pretty well!

Play Top Cat Alley Band for yourself.

The Plug-in team members on this project : Creative direction by Dom Minns, programming by Paul Hayes and Nicola Birtwistle, art by Richard Butler, music by Dom and his friends, produced by Ben Simpson.

Apple buys 3D Flash app

Saturday, July 17th, 2010

Screen shot 2010-07-16 at 19.31.05

I just found this article about Apple acquiring 3D mapping company Poly9, whose site has been taken down since the acquisition.

As far as I can tell, the French-Candian Poly9 is most well known for their in-browser 3D globe, that on the surface looks like a JavaScript library but is actually Flash (albeit with HTML overlays). The right-click menu has been sneakily hi-jacked so it’s quite well disguised, although I’d recognise those scroll bars anywhere! (and of course check the generated source to see the Flash object embed tag).

I’d be very interested to see what Apple are hoping to do with this technology, I’m guessing they’ll be de-Flashifying it pretty soon, certainly a simple 3D globe like this should be possible in HTML5 Canvas with something like Mr Doob’s three.js.

I’m wondering if Poly9 own any other technology or patents that could be useful to them..?

[UPDATE see Mr Doob's JavaScript globe here.]

2 days of Papervision3D and Flash games training for £249!

Tuesday, June 8th, 2010

Depth of Field particles in Papervision3D

I’m very pleased to announce that I’m running 2 days of training in Birmingham (UK) at the end of July, along with my friends at FlashMidlands. And if you book the Super Early Bird tickets (before June 15th), you’ll get both days for only £249! (saving £180 from the full price!) But I’d hurry, these courses usually sell out.

I’ll show you how to get started with Papervision3D and before you know it, you’ll be working with models, texture baking, depth of field particle effects (see image above) and of course, FLARToolkit using SimplAR. I’ll also be revealing many of the optimisation and production techniques behind high quality Papervision3D projects.

Asteroids from seb.ly

On the second day we’re going to look at making Flash games and programming animation, especially concentrating on interactivity, optimisation and making the games feel just right. And you’ll take away the base code for Space Invaders, Asteroids, a top down driving game, 3D soccer shootout, a platform game engine, a simple framework and more!

Naturally I’d encourage you to come to both days, but of course you are free to choose a single day if you prefer. The last course I ran in Brighton got a 97.78% approval rating and you can read more feedback here.

There are very limited super early bird tickets available (only 8) so book now to ensure your space!

FlarToolkit made easy : SimplAR

Thursday, June 3rd, 2010

As cool as bell-bottom pants according to Keith Peters! Which is pretty damn cool. And it can be really fiddly setting up the FLARToolkit, so I’ve finally released some of my AR code. Just in time for it to go out of fashion. :)

It uses the Alchemy branch of the FLARToolkit and includes everything you need to get up and running. It also has a very optimised automatic threshold adjustment system that takes virtually no extra processor time.

Here’s a quick intro :

It’s easy to use, there’s just one class. And I’ve also included swc files for the FLARToolkit Alchemy branch and the latest revision of Papervision2.1. You just need to extend the class and override the add3DObjects function.

package ly.seb.simplarexamples
{
	import ly.seb.simplar.SimplarBase;
	import org.papervision3d.objects.primitives.Sphere;
 
	[SWF (width="640", height="480", backgroundColor="0x000000",frameRate="30")]	
 
	public class AR_Sphere extends SimplarBase
	{
 
		override public function initialise() : void
		{
 
			var sphere : Sphere = new Sphere(null, 40); 
			sphere.rotationX =  90; 
			sphere.z = -50; 
 
			//add it into the container that is updated 
			//relative to the pattern marker
			container.addChild(sphere); 
 
		}
 
	}
}

Check out the screencast below to see how to use a custom marker, handle when the pattern is lost and found, and load a 3D model in.

You can check out the project from my googlecode repository at : http://code.google.com/p/sebleedelisle/

There area couple of extra things I’d like to add to the code, at the moment the size is fixed at 640×480 and the image is not mirrored; both things I would like to fix in the future.

I’d like to thank thesven.com for his FLARToolkit Alchemy code that saved me masses of time! Thanks also to Jesse Freeman and Kyle Kellogg for helping me test this.

Making a multi-track recorder in Flash part 2

Friday, May 7th, 2010

On Tuesday night I did a last minute ad hoc presentation to FlashBrighton to share the experiments I’ve done with the microphone capabilities of FlashPlayer 10.1. You should be able to see the recording at live.flashbrighton.org (if it’s not there, bear with us while we try to get it working). Click “media” to see the available videos.

I had a lot of fun and there were actually 85 people watching the live stream and heckling me (including Lee Brimelow and John “Flash on the Beach” Davey), which I really enjoyed, despite my feigned irritation. :-)

I explained exactly how audio works, what it means when we see a wave form, and how that gets turned into audio that we can hear. And then I showed that a waveform gets all jumbled up when you mix sounds, but our brain can still separate it all.

Then I showed how simple it was to make a sine wave tuned to concert A, 440 Hz. And then we mixed in the C above it to make a two note chord. Here’s the code for that :
(more…)

Making a multi-track recorder in Flash

Tuesday, May 4th, 2010

Toy recorderOriginal Photo : PhotoCapy

I’ve been playing with the Flash microphone input to record and playback multiple tracks. I thought it’d be really easy, but sadly it’s been really really tricky. The main problem is to do with knowing exactly when data from the microphone was recorded, particularly relative to when some audio was played!

I could write a lengthy blog post about it, but instead, I’ll just be presenting my findings, along with source code, at FlashBrighton tonight. If you’re not in Brighton you can watch at live.flashbrighton.org. Sorry for the short notice, I’m covering for someone who had to pull out at the last minute.

It should be recorded but I’m not sure how quickly we’ll be able to post it so I’d recommend you watch it live if you can. It starts at 7.15pm GMT.

How we broadcast FlashBrighton meetings

Sunday, March 28th, 2010

Branden Hall at FlashBrighton

I’ve just written a post for Influxis explaining how we used their TVStation app, to broadcast Branden Hall’s remote Hype presentation last week.

Streaming a remote presentation with TVStation

FFK Cologne – last few tickets left!

Thursday, March 25th, 2010

I’ve just been told that there are only around 30 tickets left now for FFK in Cologne in three weeks time! It’s the conference from Marc and Sacha who also run the Flashforum; a user group with over 100,000 members! And I thought FlashBrighton was big!

This is my first FFK but I’ve heard great things about it, and there are certainly some incredible speakers there; Andre Michelle, Joa Ebert, Mario Klingemann, Joshua Davis, Chris Pelsor, Jesse Freeman, Ralph Hauwert and many, many more.

I’ll be teaching a day of Papervision training and a day of Flash game programming training, and there are very few tickets left for each of these. See the training page for more info – I’d love to see you there.

Branden Hall on Hype at FlashBrighton

Monday, March 22nd, 2010

I’m really pleased to say that we have Branden Hall speaking at FlashBrighton tomorrow night (March 23rd 2010) about Hype. Hype is Branden and Joshua Davis‘ love child (now there’s a scary thought!) and I’m really excited about it.

Screenshot of Joshua Davis and Branden Hall's Hype

Josh was inspired by the way Flash made it easy to hack around with script and make some cool things happens – but sadly AS3 is far more complex and can alienate creative types. Hype gets rid of that complexity and gives you an accessible way to get started with generative art and code based animation.

But what if you’re not in Brighton? Well thanks to Influxis, we now stream all our meetings at live.flashbrighton.org. So come join us tomorrow!

EET : 9.30pm
GMT : 7.30pm
EST : 3.30pm
PST : 12.30pm

And coming up later in the year… Andre Michelle, Mario Klingemann, and many more!

Bad Behavior has blocked 793 access attempts in the last 7 days.