Saturday, May 21, 2005

Project Idea: A question generator
For example, if you have read a book, it will ask you questions about the typical questions a test will ask to force you to recall and explain what you have learned. If you are able to teach it, you have learned it.

A multiplayer socket server is still vastly useful to create.

Project Idea: Mindmapping tool
Tool that trains you in speed calculation
Tool that trains your memory in remembering faces, numbers, phone #, and things.

A tool that records your handwriting, and when you type in certain words, it will write those words using your handwriting recorded earlier.

A tool that records:
vocabs, usage
nouns, verbs, roots,
conjugations
phrases
When was it learned (first entered), when has it been presented/reviewed

Create a website that offers all these little useful tools

Wednesday, May 18, 2005

Project Idea: Create a website/flash app that generates complementary colors and color index (thousands of color combo).

Tuesday, May 17, 2005

Talking to Jim Edwards today about coding and OO, etc. Learned a lot of good stuff from them, such as iterator, boost library, boost graph library, interface programming, minimum coupling (start your class by making your ctor, dtor, = and copy ctor all private). I need to really get up to speed with C++ generic programming.

Saturday, May 14, 2005

What is the performance cost of calling a function that doesn't exist?
If the cost is low, we can essentially turn off any of our unused functions such as our custom trace function by commenting the function body out using JSFL and turn it back on when we want to debug our code.

When you do a typeof on an array in Flash, it gives you object. So how do you go about finding out if it is an array? There are a few ways to do it, one is you can try finding out the length of it. Any array should have a length of at least 0. Another way is you can try testing for one of Array's method existence, like so:

if (typeof (myarray.splice.toString()) == "String") trace("it's an array");

Tuesday, May 10, 2005

Quiz:

Does createEmptyMovieClip(name) removes an existing instance with the same name on stage?

Monday, May 09, 2005

Why is it important to separate UI code with your logic and also make your function does one thing and one thing only?

I ran into a piece of code today that illustrates this well:

performRotation()
{

do a bunch of rotation related task
update UI to show rotation arrows
}

Then suddenly one day we came up with a new way to interact with the UI (say you use a tablet now). With tablet stylus, unlike with mouse, when you rotate, you don't want to display the rotation arrows. Guess what, you can no longer use performRotation without making changes to your code in it because the UI is also tied to the task, but the spec for UI is now different.

Tuesday, May 03, 2005

Performance tips:

To test for even/odd number, instead of using %, use bitwise & based on the property that the last bit of an even number is always 0 and the last bit of odd number is always 1.
e.g.

var even:Boolean = (number % 2 == 0);

var evenBetter:Boolean = (number & 0x1 == 0);

Sunday, May 01, 2005

I need to learn how to:

Create a mask from text
Animate characters in Flash

AS 2 class project idea:

provide a custom trace class that automatically loops through an object and prints out its property. You can also easily turn it off at publish time.

Flash idea:

A movieclip that shows the timeline view (yes, a virtual Flash within Flash) and when mouse over, will show you the actioscript code, etc.

JSFL idea:

- A JSFL code reader that automatically scans your movieclip timeline, and generate the JSFL script necessary to produce the same structure, including tweening.

- Analyzes the library and prints out the statistics of library items, such as use count, size, etc.

- Selectively prefix or suffix all library items of a particular type.

- Extract the actionscript code in all frames, and put them into as file, and insert the appropriate #include.

Or the other way around:

Extract all the code from the .as file, and put them into the frames.

- Ever have problem hunting for a particular movieclip (esp empty movieclip)? Simple type in the name or the type of the clip (say, empty movie clip) and it will show you where they all are.

- Automatically name layers with frame label "labels" and layers with actionscript "actions"

- Automatically convert all or selected onClipEvent into mc_instance.on and vice versa.

- Automatically generates the scriplet for color.setTransform based on what the user selects in the color wheel.

A Flash component idea: create a component that when activated with a key combo, will display the document stacks (that is, which movieclip is sitting on top of which one, etc.) The user can get more info (such as position, depth #, mc name, etc.) when mouse over the stack layer.

This will be helpful for debugging to figure out where things are, and if they are appearing in the right order.

A more advanced of this component could even hook into selected events and visually display it (such as flashing the text) when the function is called.

I just learned today that if you have an onEnterFrame() function in a frame, it will be executed automatically when the playhead enters the frame! If you have code outside of the function, they will be executed first before the code in onEnterFrame.