nbilyk's blog

Make scrolling in flash not scroll in browser

I found a great article I thought I'd share:
http://avatar-soft.ro/blog/?p=4

It's how to prevent your browser from scrolling when you are scrolling with flash content.

I fixed a minor bug and made it as a js file, so to use it, just download the js file (remove the .txt) and add this to your html code.

  <script type="text/javascript" src="hookMouseWheel.js"></script>

Easy enough?


Read more...

How to get html text in a Flex Alert panel.

A client asked me to do something seemingly simple.
"I want the Alert to have just this one sentence bolded."

Well, it's not exactly simple, so here's how you do it:

  var str:String = "There was a problem with your form. ";
  str += " <b>Would you like to continue without saving?</b>";
  var alert:Alert = Alert.show(str, "Problems in data entry", Alert.YES | Alert.NO, 
                                                         Application.application as Sprite);
  use namespace mx.core.mx_internal;
  IUITextField(alert.alertForm.textField).htmlText = str;


Read more...

How to prevent a component from losing focus on tab press

You have a flex component and you want to prevent the user from being able to leave its focus using the tab key.

Here's what I tried first without any success.

  • Cancel the TAB key down event.
  • Change or extend the focus manager's behaviour.
  • Cancel the focus out event. (This almost worked, except when the focus out causes Flex itself to lose focus.)

If you know how to accomplish this with any of these approaches, I'd love to hear how.

So here's what I ended up doing.
I first created a dummy TabStopper UIComponent.
 


Read more...

Website monitoring

I decided to get a website uptime monitoring service.

The biggest reason is because I would prefer to get a notice about a client's site going down and being able to fix the problem before the client finds out. Another and more curious reason is that I want to compare the uptime of slicehost vs dreamhost. It will take several months to be able to blog about the results, but as of now, the race is on!

Here's the uptime monitor for my site.


Read more...

IGDATC Global Game Jam

January 30th - February 1st there will be a global game jam:
http://globalgamejam.org/

For those of you in the Twin Cities, there may be hope in getting in on the action. The IGDATC is planning on organizing something. http://groups.google.com/group/igdatc/browse_thread/thread/2f14971d95582ff7?hl=en


Read more...

Flex textheight workaround

I spent over an hour banging my head against the wall on this one, so I'm going to post my solution.

If you have a Flex Text component, text.textHeight gives you an incorrect result in certain situations. This is a known bug, I see it listed
http://bugs.adobe.com/jira/browse/SDK-14792 (VOTE FOR IT!) and
http://www.mail-archive.com/flexcoders@yahoogroups.com/msg63011.html.


Read more...

Server changed from Dreamhost to Slicehost

Ok. I know how much I've praised Dreamhost in the past. I was very impressed with them when I started using their hosting, they were cheap, fast, had all the features I wanted, and had awesome automated installers that let me get up and running very quickly.


Read more...

Variables and constants

Actionscript 3 guide to constants and variables.

This article assumes you have a knowlege of Classes and instances.

public class Cow extends Mammal {
	protected static const NUM_LEGS:uint = 4;
}

Let's dissect this cow, specifically, the NUM_LEGS constant.

There are 6 parts to this declaration:
protected
static
const
NUM_LEGS
:uint
4

I'm going to explain them backwards in order to go from simplest to most complicated.


Read more...

File attachments fixed

File attachments are fixed. I did an update to Drupal after their nag screens telling me my version was no longer secure, and there were some added or fixed permissions regarding downloading attachments that they didn't mention in their update logs. Well, the permissions are set correctly and now files should be downloadable again. Please post any other bugs with the site here. (And workaround if any)


Read more...

Flex states retaining memory

This is an old post that explains how flex states work, how creating a state creates a Factory that holds a hard reference to the state, and a workaround for states if you want to be able to release the memory of a state.

Since this post, I've learned a few things, and before reading, I want to make a few corrections.


Read more...
Syndicate content