Showing posts with label Flash. Show all posts
Showing posts with label Flash. Show all posts

Wednesday, January 14, 2009

Adobe Stratus beta launched

Adobe have launched a new communication protocol(RTMFP) and the Adobe Stratus service (beta) to enable the development of applications using the protocol. Real-Time Media Flow Protocol (RTMFP) uses UDP "whose low latency, end-to-end peering capability, security, and scalability make it especially well suited for developing real-time collaboration applications by not only providing superior user experience but also reducing operators' costs". Currently Flash uses Real-Time Messaging Protocol (RTMP) which is TCP based. "Stratus is a hosted rendezvous service" that allows Flash applications to sent media "directly between two Flash Player instances without routing through a central relay server".

Links

Sunday, October 26, 2008

Flash NumericStepper : Setting the Background Color

Have you ever wanted to customize the appearance of the NumericStepper component in Flash (it's pretty easy in Flex). Specifically I wanted to change the color of the text input area. Looking at the NumericStepper class there is some mention of the upSkin and I tried setting this the way I would normally set a button upSkin but with no effect. So I started looking into how the component is constructed. It shouldn't surprise you to find out that the text in the NumericStepper uses the TextInput component. You can get a reference to this object by using the NumericStepper textField property. The next problem is that the TextInput component offers no direct way to change it's background. It turns out that TextInput uses a TextField to display it's text. You can get a reference to this object using the TextInputs textField property. Consequently to change the background color of a NumericStepper's text you need to access it's textFields textField. It looks like this:

myStepper.textField.textField.background = true;
myStepper.textField.textField.backgroundColor = 0x0F1A2F;

What makes this confusing for me is that the first textField returns a reference to a TextInput and then the second textField returns a reference to a TextField. There may be an easier way to do this and I hope to hear what it is. Perhaps I'm missing something regarding upSkin?

Thursday, October 16, 2008

Perpetual Motion : My New Game

Perpetual Motion Singapore

A few days ago we (myself and the nice people over at King.com) published my latest game : Perpetual Motion. This new game has much in common with my first physics based game : Wheel of Death. In Wheel Of Death you had to arrange props to get the wheel to the goal. Walls, bus and various other obstacles provided variety to the levels. Box2D was used as the physics engine to allow some realistic collision and physics. While I was developing Wheel Of Death I regularly found I was more interested in building perpetual machines with the available props than I was in completing the levels. By perpetual machines I mean a combination of props that cause the wheel to cycle for an indefinite period. It seemed to me at the time that it would be simple enough to "quickly" build this new game as it used much of the engine from the original. To be honest much of the engine from Wheel of Death remains unchanged except for a few enhancements to make it more reliable but as I became more interested in the concept I started to invest more time in refining the user experience (dialog transitions, a world map with each location having a unique landmark and a different background) and introducing instructional elements (numbers to show the sequence of prop interaction). Getting a meaningful scoring mechanism was probably one of the biggest challenges and from the comments on Kongregate I don't think I went far enough in explaining the scoring system. Still I feel Perpetual Motion is a real leap forward from my first game. I hope you enjoy playing it.

Monday, September 08, 2008

Adobe CS4 Features

Early last week the news emerged of a Adobe special event in late September. The invites were quite secretive but by the end of the week the news was out that this was a "launch" event for Creative Suite 4. Details of the new release are still under wraps but there have been a number of sneak peaks and lab releases offering some insight into this upcoming release. I'd like to claim I've done a whole lot of research and put together a compilation of all the new features that have been previewed but in the course of this research I happened across a page on Wikipedia where the work had been done. Also worth a look is a YouTube video showing some new Photoshop features. A post from Flash Magazine showing Flash features demoed at this years WebDU. A four part series on Community MX highlighting new features from the Fireworks beta. Flashmech has posted a good review of the new Dreamweaver features. You can also download and try the Dreamweaver and Fireworks betas from Adobe Labs.

Wednesday, June 18, 2008

Adobe Cards

A friend just sent a link to one of the most exceptional Flash animations I've seen in a few years. It's a promotional site for Adobe Creative Suite and involves playing cards and a lot of hard work. Check it out (wait until the loader reaches the end and then pull the red slider all the way to the right ) :

http://www.adobecards.com/

Saturday, May 24, 2008

Flash CS3 with MacbookPro = Very Slow

A few weeks ago my old Windows laptop suddenly went into a blue screen nose dive from which it never recovered.  Given the choice between a Vista based laptop and a Macbook Pro the choice seemed obvious.  But during the week I finally had a chance to return to a Flash  game I'm developing.  There were a few missing font issues due to differences between Mac and PC standard fonts but that didn't take long to sort out.  So finally I'm testing my physcis based game for the first time on my Mac and it runs like a dog.  It ran real smooth on my crappy old PC and it runs real smooth when I run it in the browser.  So why does it look like a slow motion replay when run from Flash CS3 on the Macbook Pro.  I had installed all available CS3 updates the day before this.  So I felt confident I had the latest version and any bug fixes would be applied.  Naturally I started searching the forums and yes there were many posts on performance issues for Flash CS3 on the Macbook Pro.  Mostly I found complaints but I did come across one totally insane idea that the crazed writer claimed worked.  To remove all performamce issues they open and close the Flash help panel and problem solved.  I was desperate and so I took the road less travelled and ,yes, my problem was solved.  Opening and closing the help panel in Flash CS3 removes all performance issues on the Macbook Pro.  Why and how the hell they came across this solution I have no idea.  It's like blue vein cheese.  How did anyone ever realise blue vein cheese should be eaten and not thrown away.  Oh, look the cheese is off!  No, no, no it's fine here try a piece.  My Flash app runs like a dog here let me just try opening the help panel.  How ever they did it I thank them.
Blogged with the Flock Browser

Thursday, May 01, 2008

The Open Screen Project

Adobe (along with a long list of industry partners) have just announced the Open Screen Project. The aim of the project is to have a single consistent medium for content delivery across the full gamut of devices (computers, mobiles, TV ...). To facilitate this Adobe have announce four major initiatives:

  • Removing restrictions on use of the SWF and FLV/F4V specifications
  • Publishing the device porting layer APIs for Adobe Flash Player
  • Publishing the Adobe Flash® Cast™ protocol and the AMF protocol for robust data services
  • Removing licensing fees – making next major releases of Adobe Flash Player and Adobe AIR for devices free

The list of industry partners is fairly impressive and includes : ARM, Chunghwa Telecom, Cisco, Intel, LG Electronics Inc., Marvell, Motorola, Nokia, NTT DoCoMo, Qualcomm, Samsung Electronics Co., Sony Ericsson, Toshiba and Verizon Wireless, and leading content providers, including BBC, MTV Networks, and NBC Universal.

You can find out more at the Open Screen Project Web site. This strikes me as a very exciting initiative and I look forward to seeing what news and commentary emerges in the next week.


Friday, April 18, 2008

Flash 2D Physics : Box2DFlashAS3 Version 2 released

I've been messing around with Box2DFlashAS3 since the start of the year.  It's not the easiest of the Flash 2D Physics engines to learn but it is definitely the most versatile.  I haven't found much information on the changes in the new version.  But the updated demo includes ragdolls and the speed and accuracy seems much improved from the previous version.  I look forward to running it through it's paces.



Blogged with the Flock Browser

Friday, April 04, 2008

Flash Media Server Tour

In early May an Adobe Roadshow will be coming to Sydney and Melbourne to showcase the capabilities of the recently released Flash Media Server 3. You can find out more and register here.

Dates & Locations:
  • Sydney : 1st May,2008
  • Melbourne : 7th May, 2008

Wednesday, March 19, 2008

Actionscript Reference for RIA Development

Adobe have released the Actionscript Reference for RIA Development.  This free pdf provides an alphabetical reference for all native Actionscipt API's for Flash, AIR and Flex.  The reference is very clearly laid out making it very easy to identify the relevant platform for each API as well as available properties, methods, interfaces and superclass.
Blogged with the Flock Browser

Wednesday, March 12, 2008

Flash Player : April Security Update

Adobe have released an advanced warning regarding the 9th April release of a Flash Player Security Update.  The update is comprehensive and has the potential to break many existing projects.  I would recommend that anyone who has developed a Flash application that loads data through any mechanism take a close look at the update and consider any necessary action.

Blogged with Flock

Tuesday, February 19, 2008

Quicktime 7.4 removes all support for Flash Player

I can't find any official mention of this except for a forum thread but the latest version of Quicktime 7.4.1(14) has removed all support for Flash Player. This has been coming for a while with an update last year (?) that forced users to manually enable Flash if required. This will create a serious headache for our group which has been using LiveStage to combine Flash and Quicktime for at least the last five years. Consequently everything we've made in this manner will stop working as soon as users update to the latest version of Quicktime. I know not many people used LiveStage but I also know we weren't the only people using it. One up side is we won't need to consider LiveStage as an option for interactive video projects in the future. Flash is now the clear leader when you need to combine video, animation and interactivity (some may suggest we look at Silverlight but I think we'll need to wait until it grows up a bit).

Blogged with Flock

Friday, January 18, 2008

Actionscript 2D Physics Engine : pEngine

In response to my review of the available Actionscript 2D Physics Engines I received a comment from the YAAB (Yet Another Actionscript Blog) regarding a 2D Physics Engine they are working on called pEngine. This engine is a port of the Chipmunk engine from C. At the moment there are some interesting looking demos and not much else. But if you are interested in Flash physics it may be worthwhile bookmarking the YAAB feed.

Thursday, January 17, 2008

Box2DFlashAS3 : Detecting Jack-in-the-Box Collisions

In my last post we started looking at the basics of using Box2DFlashAS3. We saw that you needed to listen for enterFrame events and use this event to update the position of the Sprites representing your Physics Bodies. This post I want to consider how you'd deal with special cases. For example, when you have a Body that needs to respond to a collision in a unique way. Imagine a ball falling onto a Jack-in-the-Box and triggering the box to spring open. The ball will be thrown up and to one side. This sort of response can't be represented by manipulating the elasticity of the two Bodies. The question is how would you detect and respond to the ball colliding with these bodies.

Our Jack-in-the-Box simulation has one special object: the ball. We want to take action when the ball collides with a special object (i.e the Jack-in-the-Box). The ball is a standard b2Body and it maintains a list of what it is in contact with. You can access this list using ball.GetContactList() to return a b2ContactNode. The first body in the list can be accessed using b2ContactNode's "other" property (I assume you can move through the list of contacts using "next" and "prev" but I haven't needed to test this yet). You can then check if this is a b2Body that needs a response. For example, if we have a b2Body called jack we could check if it is in contact with our ball like this :

var c_ball:b2ContactNode = this.ball.GetContactList();
var o_contact:b2Body = c_ball.other;

if(this.jack == o_contact)
{
var vec:b2Vec2 = new b2Vec2(200,-400);
this.ball.SetLinearVelocity(vec);
}

In this example, we test if the body in contact with the ball is jack. If true we set a new force that moves the ball up and to the right. In my simulation it is unlikely that the ball will collide with multiple special objects at the same time. So I'm happy to assume that there will only be one body in the contact list. If your ball will be in contact with multiple bodies you will want to check all bodies in the contact list.

Friday, January 11, 2008

Actionscript 2D Physics Engines : Motor 2

This post is part of a series reviewing the available Actionscript 2D Physics Engines. Each engine was tested through the development of three simple simulations; Hello World, Rope Bridge and Stunt Bike. You can find out more about the testing methodology and access the other reviews from the introduction post.

Motor 2 screenshot

Motor 2 is the newest of the Actionscript 2D Physics Engines. Like Box2DFlashAS3 it is a port of Erin Catto's C++ physics library Box2D. Though it is probably more accurate to call it a series of variations on Box2D's themes as Michael Baczynski has exchanged some of Catto's libraries for his own.

I want to start by saying this isn't a review in the same sense as my posts on the other engines. The current Motor 2 release is just a preview. Major features like joints/constraints still need to be implemented. From my perspective that means I couldn't build 2 out of 3 of the test simulations (both Rope Bridge and Stunt Bike require joints). Consequently I haven't built anything with Motor 2. What I offer here is some observations based on looking at the demos and staring at the available code long enough to know where to start building a simulation. I offer this post from the perspective of someone who has spent quite a few hours with the other available engines and is therefore able to make some comparative observations. But really it is a placholder awaiting a more complete release.

So what can I say about Motor 2?

On the up side the demos suggest that the engine will be reasonable fast and accurate. The demo code suggests that Motor 2 is much cleaner than Box2DFlashAS3 and consequently will be easier to pick up (I suspect it will have a similar learning curve to FOAM). Another plus is that the source code is commented. The commenting isn't as comprehensive as APE or FOAM but it's still a vast improvement over Box2DFlashAS3.

On the down side we have no documentation outside the code. The demos are too simple to give us an idea of the engines potential and there is no roadmap to indicate what a full feature set will include.

In summary, I'd say that Motor 2 shows a lot of promise but that it's too early to make a call. I look forward to a more complete release so I can run a few tests and review these observations.

Thursday, January 10, 2008

Actionscript 2D Physics Engines : Box2DFlashAS3

This post is part of a series reviewing the available Actionscript 2D Physics Engines. Each engine was tested through the development of three simple simulations; Hello World, Rope Bridge and Stunt Bike. You can find out more about the testing methodology and access the other reviews from the introduction post.

Box2D

Box2DFlashAS3 is the most difficult Actionscript Physics Engine to learn. Like Motor 2 it is a port of Erin Catto's C++ physics library Box2D but unlike Motor 2 little effort has been made to assimilate the engine to Actionscripts methodologies. Consequently Box2D's approach may seem a bit foreign to some Actionscript developers. It's only documentation is that provided by Erin Catto for the C++ version and there are very few helper functions to ease the developers burden. To be honest my first instinct was to stay as far away from Box2DFlashAS3 as was possible. Fortunately Box2DFlashAS3 offers an excellent collection of demos covering a wide range of use cases. It also offers 6 distinct joint types and a lot of flexibility in how you create DisplayObject's for your particles. Once I got over the initial shock I found Box2DFlashAS3 was a workable tool. I had no trouble building the Hello World and Rope Bridge simulations and while I'm no where near happy with the Stunt Bike. I'm fairly confident that most of the problems are my own rather than the engines.

In summary, Box2DFlashAS3 offers a substantial learning curve but there are a lot of payoffs. This is partly because Box2DFlashAS3 is the most mature of the available engines (current release version : 1.4.3). It certainly helps that it is a comprehensive port of an existing engine. I still think I'd prefer to be able to use one of the other engines. But because I'm keen to do 2D Physics in Actionscript today then I think Box2DFlashAS3 is my only real option.

Actionscript 2D Physics Engines : FOAM

This post is part of a series reviewing the available Actionscript 2D Physics Engines. Each engine was tested through the development of three simple simulations; Hello World, Rope Bridge and Stunt Bike. You can find out more about the testing methodology and access the other reviews from the introduction post.

APE Bridge screenshot

FOAM isn't quite as easy to use as APE but it is still easy to use. Once again there is good documentation and some useful demos. Of all the engines I think it is the one most in tune with common Actionscript 3 development techniques and hence will look most familiar if you've spent much time with AS3 development. As the screenshot shows it offers a lot more options for adding different shapes to your simulation. For example, every shape in the screenshot (except for the circle) was created using ShapeUtil.createSymmetricPolygon(sides,size). Foam also doesn't require an enterFrame function to update the simulation. Instead you call foam.simulate() and it looks after stepping through the simulation.

So far so good. FOAM had no trouble making the Hello World simulation. Unfortunately, the news is not good for the Rope Bridge simulation. FOAM offers two types of constraints and these both offer some useful properties but at the end of the day I was unable to configure them in a manner that would create my Rope Bridge. The two joined objects were always too far away from each other. So my bridge always ended up looking more like an alpine rescue mission. Perhaps I'm missing a vital element here. It's hard to know. FOAM is the only engine that doesn't have some kind of bridge in the available demos. That could be because a bridge isn't possible at this stage or that it wasn't deemed of interest for the demo. It is worth noting that FOAM is an 0.1 alpha release. I'm sure there is still a lot of work to be done before it reaches a beta state.

In summary, FOAM looks very promising. It's simple to use and flexible with good documentation but I imagine it is still too immature to be used for anything at this stage.

Wednesday, January 09, 2008

Actionscript 2D Physics Engines : APE

This post is part of a series reviewing the available Actionscript 2D Physics Engines. Each engine was tested through the development of three simple simulations; Hello World, Rope Bridge and Stunt Bike. You can find out more about the testing methodology and access the other reviews from the introduction post.

APE Bridge screenshot

Of the available Actionscript 2D Physics Engines APE is without a doubt the easiest to learn. This is partly due to good documentation, the availability of some clear tutorials and comprehensive demos. Even if these resources didn't exist APE would still be the easiest to learn. The APE Engine aims to do as much of the heavy lifting for you as is possible. The process for creating a working simulation might be :

  • Initialise APE Engine with APEEngine.init()
  • Add gravity with APEngine.addForce()
  • Create a group
  • Create a particle (e.g RectangleParticle)
  • Add particle to group
  • Add group to APEngine with APEngine.addGroup()
  • Add an enterFrame listener (and function)
  • Call APEngine.step() and APEngine.paint() in the enterFrame function

The downside to simplicity is reduced flexibility. I had no problems building either the Hello World or the Rope Bridge simulations. Where I ran into problems was creating the Stunt Bike. The issue is that there is only one type of contraint (the SpringConstraint) and this doesn't have many properties. This limitation is particularly apparent when you look at the Box2DFlashAS3 which has 6 distinct types of constraint (called joints).

Another limitation of APE is that there is no support for complex shapes. The engine creates three types of object ; a RectangleParticle, a CircleParticle, and a WheelParticle (a CircleParticle that turns when in contact with a surface). This is offset in a small way by letting you set a MovieClip as the Particles DisplayObject, but this is possible with all the engines.

In summary, APE is easy to learn and use but a limited feature set will make it unsuitable for more complex projects. Having said that APE is still in it's alpha version and this may not be the complete set of features. There isn't a project roadmap available so it is unclear what a full feature set may contain.

Actionscript 2D Physics Engines Reviewed

For a while now I've been keen to get up to speed on the available 2D Physics Emgines for Actionscript. On New Years Eve Polygon Labs released a new Actionscript 2D Physics Engine : Motor2. Like Box2DFlashAS3 Motor2 is based on Erin Catto's c++ physics library Box2D. This release means there are now five Actionscript 2D Physics Engines available :

Henry Jones has posted a brief overview of all the engines, except Motor2, over on his blog. The release of Motor2 provides a good opportunity to bite the bullet and have a closer look at the available engines.

Methodology

To learn and test each engine I decided to build three simulations :

Hello World
This is a very simple simulation involving dropping a "ball" onto a sloping ramp. It essential is the most minimal simulation you can imagine. You need to create two types of shape (a circle and a rectangle), one fixed and one dynamic and you need to rotate one of the shapes. The objective here is to learn the fundamental mechanics of the engine.
Rope Bridge
The Rope Bridge simulation involves tying together a sequence of "planks" so they don't fall. Two of the engines have rope bridges in their demo application providing examples of best practices for building the bridge. The objective is to get an understanding of the basic constraint options for each engine. As with Hello World a ball is dropped onto the bridge to see how it reacts to a force.
Stunt Bike
The final test involves making a more complex object and running it down a ramp. The stunt bike has two wheels. The front wheel is connected to a steering column. In turn the steering column is connected at two points to the bikes body. The bikes body is connected to the back wheel. The objective here is to explore each engines constraint system in more detail.

You'll note that I'm not considering any benchmarking at this stage. This may seem odd as any simulation will live or die based on it's speed (and accuracy). I'm sure I'll be thinking in terms of benchmarking in the future. But for now my primary interest is what can each system do and how easy is it to do it. On the surface we might be forgiven for expecting a 2D Physics Engine to have a consistent set of features but that is definitely not the case here. Each of these engines has quite different objectives and therefore quite a distinct feature set.

Also note that I won't be testing either Motor2 or The Fisix Engine. For this review I'm interested in open source alternatives and Fisix is only free for non-commercial use. I haven't created any simulations using Motor2. At the moment the available demo's are too simple for my needs and there isn't any documentation to speak of. I will make some observations about Motor2. They will essentailly be what you might learn from staring at the engines code until it starts to make sense.

I will create seperate post for each engine I review. This will keep each post brief and easy to find. I will use this post to provide links to each review in the series.

Wednesday, December 05, 2007

iFlash Switcher : Installing new player versions

We're using the iFlash Switcher Firefox extension to enable testing with different versions of the Flash player on our Intel Macs. It's a very handy tool. Anyway today saw the release of Flash Player Update 3 (9.0.115.0). So we were keen to install it if only to do some testing on it's H.264 video capabilities. But getting iFlash Switcher setup turned out to be a bit of a chore. So I'd like to document this process for the next update and to save others my pain:
  • Locate the folder where iFlash Switcher stores the various plugin versions. It should be something like Users:userName :Library :Application Support :Firefox :Profiles:crazyName.default :extensions :iflashswitcher_intel@sephiroth.it :chrome:plugins:
  • The plugin versions will be in their own folders (i.e 9.0 r47). Make a copy of all the available plugin folders (I copied them to Desktop:tmp).
  • Download and install the latest version of the Flash Player.
  • The newly installed player will be located at Library: Internet Plug-Ins: Flash Player.plugin. Create a new folder in the iFlash Switcher plugins folder using the version number (i.e 9.0 r115) and copy the new plugin to that folder.
  • Move the copied plugin folders (from step 2) back into the iFlash Switcher plugins folder.
  • Open Firefox and change to the player version you want to work with (there is a Flash icon in the lower right corner).
Most of this is easy. It's just locating the plugin folder that causes grief.