Batch publishing of flash movies

Made a change to a shared class and want to update all the SWFs that use it? This is an easy way to do it.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Creating a Hit Area on Transparent PNG Content for Button Use

 
After weeks of investigation and discussion we have come up with a way to create a button on the content of a loaded in transparent png.

 You can set a sprite mask to use a bitmap and it will mask successfully so long as both are cached as a bitmap. This is ok but when you put mouse listeners on the sprite it registers the whole rectangular area.

 Next we thought we'd utilize the bitmapData getPixel32 method which returns an ARBG colour when passed in the x and y coordinate. This works great but you can only get 1 pixel at a time.

So then we thought a bit outside the sqaure and rather than create a dynamic hit area over the bitmap, we'd use the stage's MouseEvent.MOUSE_MOVE listener and get the x and y of the current position then pass that into the getPixel32 methods of each bitmap.

Success however for overlaying bitmaps this method is limited. Now we would need to updated the mouseEnable property on the fly to allow for bitmaps that are being obscured.

So the final thing you would need to do is check to see whether or not the ARBG value is equal to 0. If so enable the mouse add a MouseEvent.CLICK listener to the clip and set the button mode to true. I also use a boolean isActive to avoid adding multiple listeners. Once the ARBG value equals 0 then disable the actions by removing the MouseEvent.CLICK listener set the button mode to false and set mouseEnabled to false.

The reason we use the stage MouseEvent.MOUSE_MOVE listener is so we can always receive updates regardless of whether the bitmap button is enabled or not. If we set the bitmap button MouseEnabled property once we set it to false we'd never receive mouse events again.

So there we have it, still in it's infancy but nonetheless a solution to a perculiar problem. See the attached AlphaBitmapButton.as to view the workings.

View Example 

AlphaBitmapButton.as (3.76 kb)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Dynamically smoothing a bitmap

If you are running into issues trying to smooth bitmaps dymaically then try these things.

gskinner has a blog post on a small bug in the player where smoothing is set to false after the bitmap data gets changed.

var bmp:Bitmap = new Bitmap(null,true);
trace(bmp.smoothing); // true
bmp.bitmapData = bmpd;
trace(bmp.smoothing); // false


If that still hasn't solved your problem and you are still getting aliased bitmaps then setting the stage.quality property to StageQuality.BEST should do the trick.

stage.quality = StageQuality.BEST

For a good comparison of this check out this link: http://www.geocities.com/niquon/bitmap_test/

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Double clicking

Want to listen for MouseEvent.DOUBLE_CLICK? You need to set doubleClickEnabled to true on the display object you're listening to.

You'll thank me for this one day...

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Welcome to Earth

A quick game I whipped up the other day, check it out on the Newgrounds site. Incidentally, Newgrounds is a great way to get some quick feedback from a lot of people on stuff like this, 1520 people played the game in one day, 350 people voted on it, and 27 people actually wrote reviews! (average score: 8/10 ;)

Things to add one day when I get around to it: sounds, global high scores, replays, making it run on slow machines etc etc.

Ok that was a fun practice run, now on to secret game project #2!

Hmm the images on this blog have become very typographic lately ...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Setting wmode to increase performance

Don't you hate it how you build something in Flash and the view it in a browser, it runs about 10 times slower? Last night I was messing around with some settings in the HTML to try to figure out if anything would have an effect on performance. And lo and behold, if I set WMODE to "opaque" or "transparent", my Flash would run significantly faster. Counterintuitive, but there you go ... more investigation to follow ...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Are you the next PaperKing of the world?

 

The people over at Papervision3D are holding a contest so start your engines. Yes that was a pun.   

http://blog.papervision3d.org/2008/07/02/paperking3d-the-papervision3d-contest/

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Roxik is the man

Ok, we've all seen the amazing eco zoo site which launched recently and took 3d in flash to a new level.  Right now I'd say there are a few sleepless nights over at papervision HQ, because it turns out it was built using a different 3d engine, and one which runs about a thousand times better. The engine was either written or ported by roxik, a japanese "web designer" and he calls it "sharikura". You might remember this demo of as3 performance which it turns out was made by the same guy (and presumably using the same engine).

People who've investigated the code (it's not public but I'm guessing people have decompiled it - I've been tempted ;) report that it looks like a port of M3D, a OpenGL platform for mobile. Wherever the code comes from, it can do some amazing shit, check out the demos of full 3d with physics!. There are heaps of great things on his site, make sure you have a good look around.

Here's hoping someone convinces him to reveal his secrets or Adobe buys the code off him. I've never been too interested in papervision for a few reasons, mainly because of how poorly it runs and the fact that visually it looks pretty terrible. But damn, I want to get my hands on that engine!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Robokill

Great old school WASD shooter - how the hell did they get this running this well?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

MouseEvent.MOUSE_WHEEL on Mac

So if you're like me and wanting to get mouse scroll events dispatching on a mac you might be running into some problems. Mac OSX doesn't register mouse scroll events from flash player. The solution is to call an external interface and get the mouse scroll through Javascript.

Gabriel from Pixel Breaker has a more in depth solution.

http://blog.pixelbreaker.com/flash/as30-mousewheel-on-mac-os-x/ 

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5