How To Make the ActionScript 3.0 (AS3) TextArea Not Selectable

by filip 17. September 2010 22:50

Here’s something I wasted like 45 minutes on, and it should be pretty trivial. I needed to make the TextArea component NOT selectable, yet still enabled (need the scrollbar to work).

I started digging around the TextArea.as class, because no matter what I did in my code (such as myTextArea.textField.selectable = false; ), the TextArea was still selectable. It appears that when the TextArea calls the draw() or setSize() methods, it updates the text field in the TextArea to be selectable depending on whether the TextArea is enabled or not.

Clearly, whoever designed the TextArea component didn’t give this much thought. In any case, the way I got around the issue is to attach to the Event.Render event of the text area. Therefore, after the render method is called (and the TextArea is drawn), I can update the textfield to not be selectable.  Here is some sample code.You may need to attach to more events than just the render event, but the concept should work.

var DescriptionField:TextArea = getChildByName( "description" ) as TextArea;
DescriptionField.addEventListener( Event.RENDER, onDescriptionRender );

public function onDescriptionRender( evt:Event ):void
{
     var textArea:TextArea = evt.target as TextArea;
     textArea.textField.selectable = false;       
}

Tags: , ,

Web Development

Internet Explorer 9 (IE9) CSS3 Support – Platform Preview

by filip 16. March 2010 13:05

I downloaded the platform preview version of IE9 today to test out some CSS support. I ran a few tests through it, with the following results.  The picture on the left was generated using Firefox 3.6 (keep in mind that I did have to use the “-moz” prefix in front of all but one style to make it work in FF). The IE content is on the right.

 

It certainly is possible that IE requires some vendor-specific suffix like Firefox did. However, I did not use any prefix, so the style may actually be supported in some form.

In any case, the only supported feature out of the four I tested was border-radius (and that is actually the one I’m most excited about). The box-shadow would be next on my list. Hopefully that gets put in the next preview.

Tags: , ,

Web Development

HTML5 or Flash – Be careful what you ask for…

by filip 8. March 2010 21:51

Ok, I’ll get straight to the point: There is a lot to dislike about many websites right now when it comes to how these websites generate revenue. On many sites it is hard to actually find the content you were seeking due to the huge amount of ads that get displayed. I’ve had my browser crash countless times due to poorly designed ads (generally, it is due to Flash ads, but it certainly can happen with JavaScript as well).

Is Flash a problem? With the way it is currently being used by advertisers, it would be hard to argue that it isn’t. However, HTML5 isn’t the solution. In fact, I think HTML5 will be a bigger problem than Flash ever was.

More...

Tags: , ,

Web Development

Updated Contact Page – Now with a reCaptcha

by filip 6. March 2010 22:15

I’ve added the reCaptcha to my contact page.  If anyone who has installed the reCaptcha wants to add it to their contact page, the files are available here.

These are just the updated contact page files.  You must have the reCaptcha already installed for these to work.

Tags:

Web Development

Blogengine.NET – reCaptcha 0.93 Installation Instructions

by filip 25. February 2010 22:33

These installation instructions now apply to version 0.95

First, the linked ZIP file contains the updated files for installing the Recaptcha control.

UPDATES:

  • Version 0.95 – Changed initial loading method to fix error that occurred in certain cases in IE. If upgrading from 0.94, you only need to replace the Recaptcha.cs file.
  • Version 0.94 – Logging fixes
  • Version 0.93 – Added logging.
  • Version 0.92 - The recaptcha will no longer get focus after it has been loaded. Install procedure is unchanged from version 0.91.
  • Version 0.91 - Changed the way that Recaptcha is verified.  It should no longer be possible to bypass the recaptcha by manually executing JavaScript on the page.
  • Version 0.9 - Initial Version

More...

Tags: , , , , , ,

Web Development

Bloodforge Band

Looking for the Bloodforge band site? Click here.

About Filip Stanek

Death Note Pic I'm a developer at ACG in Cincinnati, OH. I like ASP.NET, Flash, and other web technologies, & enjoy playing chess, video games, etc.

Currently playing:

Disqus

Month List