Changing Selection Color on Dynamic TextFieldsHere's a class you can use to control the selection color on TextFields.

For some reason or another selection color is not an option on dynamic TextFields in Flash.
This has been one of those issues that I’ve just accepted up until now.

I’m currently working on a project that has a design featuring white text over a black background. The caveat was that the text needed to be selectable as well. As anyone working with selectable text knows, the selection color is always black. This posed a problem… the user couldn’t actually tell when the text was selected or what characters were actually selected. I remembered a while ago reading about applying a color transform to the text field to change the selection color. Only problem with that solution is that it applies the transform to the entire field as a whole, which means the text color and background color are affected by the transform as well.

I played around with this solution for quite a while and came up with a fairly reliable way of changing the selection color and maintaining the text and background colors that you initially chose. There are still some hiccups, but so far this is the best solution that I’ve found. First download the SelectionColor class and then test it with:

package
{
	import com.digitalflipbook.text.SelectionColor;
	import flash.display.Sprite;
	import flash.text.TextField;

	/**
	* The SelectionColorTest class runs a simple test changing a TextField selection color.
	*
	* @author Mark Walters
	* @since 2007.08.13
	*/
	public class SelectionColorTest extends Sprite
	{
		public function SelectionColorTest()
		{
			var tf:TextField = new TextField();
			this.addChild( tf );
			tf.width = 180;
			tf.height = 20;
			tf.text = "Here's some text to try selecting.";
			tf.background = true;
			tf.backgroundColor = 0x000000;
			tf.border = true;
			tf.borderColor = 0x000000;
			tf.textColor = 0xFFFFFF;

			SelectionColor.setFieldSelectionColor( tf, 0xD3D3D3 );
		}
	}
}

Now, this works with many color choices, but it is not a full proof solution. I have seen certain colors, depending on the colors chosen, not work out exactly as expected. If anyone notices anything in the code that could be perfected let me know and I will post an update. This seems to be one of those annoying things about Flash that would be nice to have a solid solution.

Posted in Flash | 19 Comments
Language ReferencesA single location to find all of the important Flash Platform language references.

These should always be one click away:

CORE LANGUAGE REFERENCES

Flash 10

Flex 3 and AIR 1

AIR 1 JavaScript

BETA LANGUAGE REFERENCES

Flex Gumbo

LIBRARY LANGUAGE REFERENCES

AS3CoreLib

Cairngorm

PureMVC

ARCHIVED CORE LANGUAGE REFERENCES

Flash 9

Flex 2

Flash 8

I’ll try and keep this page updated.

Posted in Flash | 1 Comment
Craziness…Lots of stuff going on right now... sorry for the lack of posts.

Its been way too long since I got a post up here, but I thought I would quickly let you know I wasn’t dead and give you a few of the reasons why it has been that long:

1) Buying a new place in Jersey City. Sooo much more time consuming, difficult, and expensive than buying in Atlanta.
2) Training our new french bulldog puppy ( Jacques Francois ).
3) Trying to spend as much time as possible with my wife.
4) Work, work and more work.
5) Freelance, freelance and you get the point.
6) Tech-editing the upcoming AS3 Bible.

One thing I have been meaning to write about, that I’ll quickly touch on, is FlashDevelop 3. The 2nd beta has already been released and I’ve been using it for all of my development for the past month and a half, building from the source daily. It is very stable and so much better to work with than FD2… and I was a big proponent of that.
So go download it, try it out, and shoot Philippe, Nick and the rest of the FD crew your comments and thank yous because its a great app for flash, and now flex, development.

Posted in Flash | 1 Comment
FlashPaper Component 0.8Updated my FlashPaper component to add color schemes for the FlashPaper interface.

Surprisingly enough, I actually get a lot of hits on this site for my FlashPaper component.
What’s funny is that I’ve never once thought about charging for it, but today I realized that another company was charging an outlandish amount of money for much less functionality.
The company is Zanzibar Fiction and here is their pricelist. And yes… that’s up to $500 that they’re charging for deactivating the select and print buttons!! I just don’t get it.
But anyway, one thing that they added that my component didn’t have was color schemes for the FlashPaper interface. So to hopefully prevent anyone from spending that crazy amount of money, I decided to add it to my component… but make it even better. They offer 8 color choices (and they are all very ugly) and my component now lets you select any tint color and percentage that you like for the interface.
Oh and by the way it’s still free! :)

Description:
The FlashPaper component simplifies the process of working with the FlashPaper API and adds functionality either not documented or not provided in the API.

Installation:
- Unzip FlashPaper_0.8.zip
- DoubleClick on FlashPaper.mxp to install with the Extension Manager.

Documentation:
FlashPaper Component Documentation

Download FlashPaper

Posted in AIR, Flash | 44 Comments
Associating Custom AS3 Classes with Embedded AssetsContrary to popular belief, it is possible to associate a custom class with an embedded symbol and here's how to do it.

Keith Peters had a couple of posts a little while ago about embedding assets in as3 (1 and 2). One thing that came up in both of them that could not be resolved was how to associate a custom class with an embedded symbol. The example given was:

…create a movie clip in the Flash 9 IDE, give it a class of “Star”, and you have an actual class written, called “Star” that has some functionality that is really cool. Now, you embed that star symbol in your AS3 application, but you can only type it as Sprite or MovieClip. How to get it to be a “Star”? I finally got to dig in to this a bit more, and sadly, I don’t think there is a way to do this. When you embed a Sprite asset, it comes in as an instance of SpriteAsset

I was trying to do the same thing and found out that there actually is a way to do this. Instead of adding the embed tag above a variable like so:

package
{
	import flash.display.Sprite;

	public class Application extends Sprite
	{
		[Embed(source="library.swf", symbol="Star")]
		private var Star:Class;

		public function Application()
		{
			var star:Sprite = new Star();
			addChild(star);
		}
	}
}

…which only allows you to type it as Sprite or MovieClip. You can instead create the Star class and add the embed tag directly above the class declaration:

package
{
	import flash.display.*;

	[Embed(source="library.swf", symbol="Star")]
	public class Star extends Sprite
	{
		public function Star()
		{
		}
	}
}

and implement it in the main class with:

package
{
	import flash.display.Sprite;

	public class Application extends Sprite
	{
		private var star:Star;

		public function Application()
		{
			star = new Star();
			addChild(star);
		}
	}
}

Now you have a custom Star class you can do anything you want with associated with an embedded asset!
Yay! Problem solved.

Posted in Flash | 23 Comments
FlashDevelop 3 Prerelease Test DriveI decided to compile the source for FD3 and see how the new version is coming along.

Since its been quiet on the FlashDevelop front regarding version 3, I decided to update the repository and see if I could compile the source to see the progress. First things first, with FD2 you could compile it with SharpDevelop version 1.1 (for .NET Framework 1.1), but to compile FD3 you need to use MS Visual C# Express Edition (for .NET Framework 2.0). I’m not positive, but I would assume you could also use version 2.1 of SharpDevelop.

Once Visual C# was installed, I built the solution and everything compiled with no problems.

So now to see what’s new (noting that this is not a release at all, so I am expecting bugs and a completely unpolished product):

- Once open, FD3 looks very similar to the layout of FD2 except slightly slicker. A little more gray that once was white and an added gradient to the toolbar.

- The tabs on the documents have a corner bent down instead of the straight squares they were in FD2 which makes it a little more obvious which tab is on top. Speaking of tabs, when you click to drag one the page turns blue with 5 icons in the center. What I’ve discovered is that if you drag the tab into one of the icons the page tries to fill the related section of the interface; top icon fills the top half of the document interface, left fills left half, etc, with center filling the entire document interface again. Notice I said “tries to fill”, it doesn’t currently work but the blue area shows what is intended.

- The Find tool looks to have been improved significantly. No longer is there a separate Replace tool, it has been combined into the default Find (Ctrl+F). It has also added an additional dropdown, “Look in”. Look in has the choices of “Full Source Code”, “Code and Strings”, “Comments Only”, and “Strings Only”.

- (Ctrl+I) still brings up the Find in Files, but this seems to have improved even more than the Find tool. First it also adds Replace so you can easily replace throughout several files. A results panel has also been added to the bottom of the tool so you can easily see all of the found files and easily open them without going to the Results panel at the bottom of FD.

- You no longer have to have a project open to get code completion. It seems to work just as well on an individual as file.

- A very cool feature that I stumbled upon and loved in PrimalScript is a built in browser! If you go to help and click on “FlashDevelop Home”, the FD forum will load up in a new tab right in the interface.

- Under help there is a new link added as well, “Online Documentation”. Looks like eventually we might have true documentation for FD :) The link (which hasn’t added any real documentation yet) is: http://www.flashdevelop.org/wikidocs/index.php/Main_Page.

- File New adds the ability to choose the type of file you want to create, including different files for as3 and as2. It looks like you will be able to customize the default template of each eventually as well, but not positive at this point.

- Nothing seems to have been added to the Project panel yet. Can’t wait for this one.

- Not seeing anything about svn or cvs integration.

- Quick MTASC Build is now called Quick Build. I’m assuming we’ll be able to use it for mtasc builds for as2 and ant builds for as3, but not positive just guessing.

- A new tool has been added, “Application Files”. Not exactly sure what it does yet, but it seems to default to opening up the FirstRun directory in an explorer window.

- Global Classpaths is removed from the Tools menu.

- All of the windows just seem so much nicer and more organized. A good example is the Program Settings window. It’s no longer just a long list, but nicely sectioned off with shorter more standard names. Still no settings for code coloring, but we can hope.

- The panel on the right has added a Layouts tab, which I’m not sure about yet and the ActionScript tab has been renamed Outline which makes more sense. Maybe it will support other languages as well.

And that about covers it for now. There will definitely be more to talk about once the Project Panel supports as3 and flex… which looking at the TODO doc seems to be one of the major things left to implement. All in all it seems to be really shaping up and I can’t wait until they release an actual alpha version to the public. Good job guys!

Posted in Flash | Leave a comment
Introduction to Flex 2 – Go and Get It !Roger Braunstein just completed the O'Reilly Short Cut Introduction to Flex 2.

Fellow Schematician Roger Braunstein recently completed the O’Reilly Short Cut “Introduction to Flex 2“. I got a chance to preview it before he was completely done and even at that time it was a great read full of tips to quickly get you up to speed on Flex 2 and AS3. Now that it’s released, I can safely say it’s a steal at under $10. What are you waiting for?… go get it!

Posted in Flex | Leave a comment
AS3 LuminicBox – ( Update )Couple of small updates to AS3 LuminicBox.

I didn’t have strict mode errors turned on in the Flash 9 preview, so I didn’t realize that the last release was giving a status event error when connecting to FlashInspector. I’ve updated the code to fix the problem. I’ve also added default values to the methods that were optional in the as2 version to make them optional in the as3 version as well.

Download it here.

Posted in Flash | 3 Comments
LuminicBox.Log – AS3 UpdateI decided to update LuminicBox to AS3.

I use LuminicBox.Log all of the time for AS2 projects and as I’m transitioning more and more to AS3 projects, I realized I really missed it. I took some time today and updated the classes and even the FlashInspector to AS3 (hopefully Pablo Costantini doesn’t mind). I needed to update FlashInspector so that it could interpret some of the new AS3 types: root, stage, DisplayObject, XMLList, SimpleButton, etc). The documentation has been updated with asdoc as well. The flash example files that are included have been updated and only work from the Flash 9 Preview. Let me know if there’s anything I missed or if you notice any bugs.

Updated AS3 version.

Original AS2 version.

Posted in Flash | 8 Comments
charsets (for use with swfmill)Here's some charsets in an easy-to-copy format for use with swfmill.

I’m embedding fonts using swfmill in a project I’m currently working on and one of the more tedious tasks I went through was copying and pasting the individual characters I needed to make up the character sets to be used. Because of this, I thought it might be helpful to others to post the charsets in a way that would be easy to copy and paste. I will try to keep this page up to date and add more sets as I get the time.

Note: The sets are accurate to the best of my knowledge, but please use at your own risk.

ISO/IEC 8859-1:1998 Latin Alphabet No. 1

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ

ISO/IEC 8859-2:1999 Latin Alphabet No. 2

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­Ž­Ż°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙
Posted in Flash | 3 Comments
  • Pages

  • Categories

  • Archives