Monday, December 31, 2007
If you put a drop shadow on a symbol that is inside of a Button, the movie will freak out without giving any sort of error messages.
Well, at least it wasn't as bad as Friday's LoaderContext problem. Right now I'm also investigating some bizarre behavior with embedded fonts on dynamic fields, more on that when I know more.
Saturday, December 29, 2007
- ActionScript 3.0 Game Programming University - This may be the most fun way to get your feet wet in AS3 and Flash 9 if you're already experienced with Flash. Especially if you prefer to look at complete examples to learn from. You can also use the numerous examples to build upon instead of starting from scratch. Plus, it is Flash-oriented where many of the ActionScript books are Flash-neutral. The book has great support with an accompanying website with demos of the games you can play, as well as a forum to interact with the author and other readers.
- Foundation Actionscript 3.0 Animation: Making Things Move! - Another fun and great way to learn AS3 programming. This book is Flash neutral, so you can do it from a text editor with the Flex SDK compiler, FlashDevelop, FlexBuilder, or Flash. While his examples are not complete games like the above, they are small, useful examples. He also gives a good intro to AS3.
- Essential ActionScript 3.0 - If you plan to write AS3 code, this book is a must to have.
- Flash CS3 Professional Advanced - This is a great intro to Flash 9 with AS3, probably my favorite all-purpose Flash book, I review it here. This book will effectively bridge your Flash 8 and AS2 knowledge to Flash 9 and AS3. It has very clear explanations and illustrations.
The problem was relying on the default LoaderContext parameter to the Loader.load() method. You may not be familiar with this parameter, but it is important in how the Flash Player deals with an additional application being loaded in and how it prevents possible name collisions (see the thread I linked to above).
After solving the problem, I decided to look further into the books I have. Out of six books I looked in, all of them mentioned the Loader class but only one mentioned LoaderContext. Ironically, that was the last one I looked in because it is a Flex book, Programming Flex 2. It has a good explanation of the issues.
Tuesday, December 25, 2007
It was only a four day weekend this year, but I still managed to slip in some productive fun. Over the weekend I:
- Wrote my first productive Python script from scratch
- Created a game in Blender using Blender's game engine
- Painted in ArtRage (the picture above, you didn't think I was in that did you?)
- Spent time in Alice
- Opened a Twitter account
Sunday, December 23, 2007
Blender is scriptable through the Python language. I've never scripted Blender and I've never used Python, so it took me a bit... Figuring out the appropriate Blender APIs and then learning the Python syntax (it is very different from what I'm used to like AS3, C# and Java). Here's my tiny, first script:
objects = Blender.Object.GetSelected()
for curObj in objects:
curObj.rbFlags = curObj.rbFlags | Blender.Object.RBFlags.RIGIDBODY
Taking it apart, the first line imports the Blender module for the Blender APIs. The second line gets all of the selected objects in a scene using the Object module's GetSelected() method. The third and fourth lines iterate through the list of objects. Line 4 uses the bitwise OR operator to set the RIGIDBODY flag for the current object.
It took me a while to figure this little script out, longer than it took to do the operation manually. But the next time I need to set a property of a large number of objects -- any property, bitwise or otherwise -- it'll take seconds to type instead of minutes in the interface.
Thursday, December 13, 2007
After a quick test I realized that groups were indicated with a bounding box that was closer to a cyan color where the object bounding box was a darker blue. It is very cool that the objects are still modifiable in the standard Flash manner of pulling out curves, corners, or corner points, yet they do not merge with the shape below, it's like having the best of both worlds... being able to use Flash's very natural feeling vector drawing tools, but have the result be modifiable in a way that is more similar to traditional vector tools like Illustrator. I don't see this technique replacing the old Flash way of drawing, but supplementing it so I don't have to rely on moving back and forth between layers so much.
It is easy enough to break apart objects with Ctrl-B, just as you would Symbols or Groups. But how can you make them from a non-object? After cruising through the menus, I was clueless. So I resorted to using the online Help (the equivalent of driving and stopping to ask for directions, IMO). The stop was useful, to make an object select Modify > Combine Objects > Union. Whoo hoo! The only thing that was missing was a shortcut to make a union. Since I don't really using the Group command, it was a quick decision to switch the use of Ctrl-G to make objects instead of groups.
Wednesday, December 05, 2007
Since I'm back using Blender, I had to see if there was a way to develop 3d models in Blender for Alice. The official site is slim on documentation from a user perspective, so developer documentation is non-existent. In the program, I noticed you can import and .ASE file. I'd never heard of that and didn't see it in the Blender list of export formats. Fortunately, Blender is extensible through Python and someone wrote an import and export script for .ASE.
Just put the exporter script in your Blender scripts folder. I tested it and it works as long as you make sure none of the objects you make sure your object names don't have a "." in them.
Working with Alice set my Java-sense to tingling. I could tell it is a Java app from the look and feel, plus they have all sorts of .JAR files in the application folder. Having spent some time with Java, I started poking around. Knowing Java likes the .JAR format, which is really .ZIP, I renamed an Alice .A2W file with the .ZIP extension instead. Sure enough it popped right open with WinZip. It was very cool to poke around inside. Most of the contents were XML files. It's fun to see how it's put together.
One downside is when I tried to use the "Export Movie" feature and got a "This feature is not implemented yet" dialog box. Why even put the menu item in the menu if it is not implemented? Another problem was when I tried to view it as a web page. It didn't work but there was a link with instructions. Basically, you need to make sure you have Java, Java3d, and the Java Media Framework (which requires a reboot). Those are three separate downloads from three separate pages. Not too user friendly! Lastly, after downloading and installing those, rebooting my machine, I find the applet version does not play back showing the word balloons and opacity changes in my "world". So if you want to show others your work, you'll have to pass around the .A2W file, which is basically the source code and files. Even that has some issues in that supposedly some mail programs recognize that it's really a .ZIP and change the extension. I haven't confirmed that behavior.
Still, Alice is a great tool and it is free. In a short amount of time, my kids were creating short stories using the pre-created characters.
Monday, December 03, 2007
Lastly, there were a slew of span tags, ie:
<span style='font-size:10.0pt;font-family:Arial'>John <span class=SpellE>Nyquist</span></span>
To whack those: