talves , September 30, 2007 00:00

After months of looking at blog applications, I have decided on BlogEngine.NET.  This decision is based on many things, but mainly for 2 reasons.

1. Open Source .NET project.

2. The data can be stored in XML.  No database is required and there is the opportunity for it to switch over later if  your blog becomes too large for XML.

Other reasons were considered.  Other blog features are missing, but I do not use them and they will be added later anyway.  The developer has a reputation for having very clean code and is dedicated to keeping the code concise and clean.  The code also adheres to some best practices methods you would not normally see in .NET projects which is also promising.

Setup

BlogEngine.NET could not have been any easier to set up.  I literally had it running in less than 5 minutes.  Of course, I am a .NET junkie and have an advantage, so the layman could be up in less than 1 hour at worse case scenario.

BlogEngine.NET

You can find BlogEngine.NET on the official website. Here you'll find tutorials, documentation, tips and tricks and much more. The ongoing development of BlogEngine.NET can be followed at CodePlex where the daily builds will be published for anyone to download.

Currently rated 3.4 by 23 people

  • Currently 3.434782/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
talves , September 19, 2007 22:50
ArgumentError: Error #2004: One of the parameters is invalid.

I hope this will help you out there before you spend too many hours on this one.

Issue that caused the error:
Making a remote call using a RemoteObject that returns back a strongly typed object. The call is made and the Error is triggered before you can capture it in the debugger. I thought I was losing my mind. Everything is exactly the way I have done remote calls a hundred times.

remoteObject.SomeMethod();
SomeMethod() returns a strongly typed class object.

Solution and reason for the error:
Make sure you have an instance of the object referenced in your project. The object is not linked into your .swf upon compiling the project, because there is not a reference to the object anywhere in the project, so the RemoteObject call cannot find the class. What a simple solution, but what a non descriptive error. Now that I read the error it makes a little more sense.

Currently rated 3.4 by 13 people

  • Currently 3.384615/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
I am working and see an email come in from flexcoders asking how you would access a variables value in one component from another. Easy enough. Well, that is what I thought. I came up with three different answers to this problem and I am convinced there are others. All good enough, but which is best to implement. I will let you decide.

1. Put bindable public variables (properties) on your components and set the values in the parent.
2. Dispatch an event on one component and have the parent component set the other components property.
3. Create a singleton class that holds the values and bind the data to your components, so when there is a change, the values in the components will be set accordingly.

I like the third answer best, but is a bit overkill for the simple implementation that does not need to access the information more than once. The third has more scalability, but takes longer to code.

Demo Example
Source Code

Which would you use? I think it is based on your needs.

Currently rated 3.5 by 13 people

  • Currently 3.461538/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
talves , August 23, 2007 22:47
I needed a way to have a ComboBox be able to load values from an XML file.
Requirements:
  • Needed to be able to load XML with a standard format "label" as the value you see and "data" as the value of the selection.
  • Needed a way to set the selected value, so the correct "label" shows as selected (borrowed).
  • Load the XML dynamically by setting the XML path during runtime.
  • XML list in the ComboBox may change without recompiling the application.
I extended the ComboBox in actionscript and added two new properties to be able to accomplish the requirements.
xmlFile="xml/somefile.xml" sets the files path.
selectedValue="somecode" sets the value of the data to be selected.

Country and State Demo using XMLComboBox
View Source

This example uses Country and State/Province. When you select "United States" as the country, the States xml will load. When you select "Canada" as the country, the Provinces xml will load. The selectedValue can be changed during runtime as in the example using the TextInput component and change event.

Currently rated 3.5 by 12 people

  • Currently 3.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
I just finished splitting my modules from my main project to a separate project to be able to use the -load-externs and -link-report compiler arguments. The benefit is great when using the seperated project technique. Especially if you follow strict modular programming techniques that have encapsulation. It cut my modules down from 680k to 250k. I suspect my module will now load close to 3 times faster than before (2.72 to be exact).

I read the following documentation to get the specifics on loading modules and setting up different strategies in my projects.
Here is the Adobe Blog Entry
Here is the Adobe PDF of the documentation.
Here are the Adobe examples from the documentation.

Currently rated 3.3 by 6 people

  • Currently 3.333333/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
compiler tags

If you are like me, you have read a lot of information on Flex, and Flex Builder. When you create your projects, you use a lot of mxml. You should also be aware that every time you create a mxml file, it will be converted to an actionscript class.

So, where is the code for these classes? They are created somewhere you can't see and are used to compile your swf files by the compiler. Wouldn't it be great to be able to see this code, to see how the compiler creates a class or extends a class when you use it? Well, it is easy to do this with a compiler switch (-keep-generated-actionscript).

Just add the -keep-generated-actionscript switch to your compiler arguments by going to properties in your project. Click on "Flex Compiler". Add the -keep-generated-actionscript argument to the compiler arguments input field. I was also able to use the abbreviated -keep argument to save typing. Apply the change and go build your project. A directory will show up at the root of your project called "generated" and you will be able to see the .as files created by the compiler.

Currently rated 3.0 by 5 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
In an Earlier Post, I extended the TextInput to capture the enter key.

After being set straight by Alex H. and Graham on flexcoders, I see it may have been overkill. Instead of extending the control to capture the enter key, all that was needed was to use enter="somefunction()".

private function handleMoveNext(event:Event):void
{
var fm:IFocusManager = event.target.focusManager;
var next:IFocusManagerComponent =
fm.getNextFocusManagerComponent();
fm.setFocus(next);
}
<mx:TextInput id="firstBox"
tabIndex="0"
enter="handleMoveNext(event)"/>
<mx:TextInput id="secondBox"
tabIndex="1"
enter="handleMoveNext(event)"/>
I think the example is still valid to show how you can extend the control to capture input into the TextInput, but my usage did not require any extending of the control.

See for yourself:

ExtendingControls Demo
Put focus in one of the boxes; Hit the enter key; You will see the focus change; Try not to use the mouse (hard for me at first).

Not Extended Demo
Put focus in one of the boxes; Hit the enter key.


ExtendingControls Source

You can also right click and View Source.

Currently rated 2.4 by 5 people

  • Currently 2.4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Today, I started to doubt my use of Flex Modules in my application. After burning up some zeros and ones on google and getting nowhere, I finally found a link to an Adobe docs pdf that everyone should read when attempting to use Modules in their Flex Application.

Modules Documentation Update (January 16, 2007)


It also has a link to the examples used in the documentation. It cleared up some major questions I have been having lately. I may go read all the documentation from beginning to end.

Examples:
Module Examples

I plan to add this blog to my daily reading list also. The docs team gets ignored too often and they do such a great job.

Flex Doc Blog

Now go read!

Currently rated 3.0 by 5 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
When working with Flex and Fluorine, it has become very tedious for me to create my custom class objects with many properties. I created a quick tool to take some of the burden of creating these objects on the Flex and .NET side.

Anyone who uses private, public properties in their Value Objects (VO) objects know it is a pain to type all those properties into a custom object. Afterward, go over to .NET and create them. About as tedious as watching paint dry in zero degree weather.

Try this tool out and let me know if it is helpful for you.

Class Generator

How to use:
1. Type the class name into the input box.
2. Add properties to the properties grid. Edit the values.
3. Add the Class to the class grid.
4. Repeat for next class.
5. Make sure to cache your classes to local disk using the Cache buttons at the top. Nothing is saved on a server, all data is stored local in SharedObjects.
6. You can make a class active by selecting it in the grid.
7. You can copy the code from the Text Area.
8. Click on the code you want to generate.

Simple, but I hope this is of use to somebody. It saves me at least 10 minutes per VO.

Let me know what you think. This was a quick and dirty throw together. If enough people think there is value I will consider improving. I am also not apposed to creating a ToDo/Wish list for the tool.

Enjoy,
Tony

Currently rated 3.0 by 5 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
You want to be able to write your custom preloader in FLEX?

Jesse Warden will be able to walk you through it here.

Before you leave to go write your new preloader, make sure to read my comment on needing to remove the event listeners when you are done.

Summary:
Awesome stuff! There is a caveat to consider.

1. The preloader overwrites the event Listeners, but leaves them once the application is loaded. This is ok if you never load anything else into your flex application. If you load a module into your application, flex will fire the FlexEvent.INIT_PROGRESS event again causing an error due to the clip.preloader becoming null.

2. Solution:
Instantiate a private variable called _preloader in your constructor;

private var _preloader:Sprite;
public override function set preloader(preloader:Sprite):void
{
_preloader = preloader;
_preloader.addEventListener( ProgressEvent.PROGRESS , onSWFDownloadProgress );
_preloader.addEventListener( Event.COMPLETE , onSWFDownloadComplete );
_preloader.addEventListener( FlexEvent.INIT_PROGRESS , onFlexInitProgress );
_preloader.addEventListener( FlexEvent.INIT_COMPLETE , onFlexInitComplete );
centerPreloader();
}


Remove the listeners once the application is loaded and you are complete;

private function onDoneAnimating():void
{
clip.stop();
_preloader.removeEventListener( ProgressEvent.PROGRESS , onSWFDownloadProgress );
_preloader.removeEventListener( Event.COMPLETE , onSWFDownloadComplete };
_preloader.removeEventListener( FlexEvent.INIT_PROGRESS , onFlexInitProgress );
_preloader.removeEventListener( FlexEvent.INIT_COMPLETE , onFlexInitComplete );
dispatchEvent( new Event( Event.COMPLETE ) );
}

Currently rated 3.1 by 12 people

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