Scottae's Blog
Flash, ActionScript, and some other crap
Tuesday, December 22, 2009
Been Busy
If you frequent this blog, you probably have noticed I haven't been posting anything for a while. Partially because I have been quite busy, but also because I have been making work related posts to my work blog. So if you want to keep up with what I am blogging on, check me out there.
Wednesday, January 7, 2009
FDT Flash Issue

Something that has been bugging me lately is that Flash sometimes hangs up when I try to export a movie. I didn't understand why it was happening. Then one of my co-workers realized what it was. Anytime you open Flash by double clicking on an fla in the Flash Explorer View in FDT, it would hang up when compiling. Basically it would do an eternal compile (it would never finish) and you have to manually shut down Flash. To avoid this, simply open Flash manually before opening an fla from the Flash Explorer View in FDT. Then there is no problem.
Monday, December 8, 2008
Flash & Flex Magazine
-Creating a Pong Game with AS 3.0
-OOP Principles
-Behind the scenes look at how the delpadre site was created using different Adobe products (PS, AE, Fl, Maya)
And that's only a few. Each magazine comes with a CD containing some useful applications. If you are a Flash or Flex developer/designer, you owe it to yourself to get a subscription to this publication.
I bought CS4
Image by Dekuwa via FlickrIt's like Christmas early for me. Although I bought this for myself. I am the proud new owner of Web Premium Suite CS4. I got the upgrade so I am supposed to get a $200 discount, but that was not reflected in my order. I'll have to get on Adobe about that. They advertised it, they should honor it.Anyway, I am always pleased with the way Adobe products look. This is no exception. I've only opened Flash so far. Once thing I noticed right away is the search input box at the top. If you type in a search term, it opens up a search in Adobe's Search Community Help page in your browser. Very nice and convenient. I like it.
One thing that has been bothering me for a while is that Bridge doesn't work for me at all. Even in CS3 it crashes on start up of Bridge. I had hoped that CS4 would be different. But no, it crashes on start up as well. That makes me mad. But I have been too lazy to bother figuring out what to do about it.
Wednesday, December 3, 2008
Problems with Glaze
Image by gnackgnackgnack via FlickrI ran into a problem recently while programming a game with Glaze. I was trying to toggle 2 different GeometricShapes in a RigidBody. I was removing one of the shapes and then adding the other one. Next time it would switch back. The problem was Flash would crash. I would get this error:Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
at org.rje.glaze.engine.collision.shapes::Polygon/UpdateShape()[C:\dev\projects\clients\thrust\projects\Glaze\src\org\rje\glaze\engine\collision\shapes\Polygon.as:123]
at org.rje.glaze.engine.collision.shapes::GeometricShape/Update()[C:\dev\projects\clients\thrust\projects\Glaze\src\org\rje\glaze\engine\collision\shapes\GeometricShape.as:143]
at org.rje.glaze.engine.space::Space/physicsStep()[C:\dev\projects\clients\thrust\projects\Glaze\src\org\rje\glaze\engine\space\Space.as:202]
at org.rje.glaze.engine.space::Space/step()[C:\dev\projects\clients\thrust\projects\Glaze\src\org\rje\glaze\engine\space\Space.as:165]
This was bad. I had no clue what it was for a long time. I had one of my colleagues try tinkering with it and he stumbled on a way to fix it. It seems that you can't really reuse the same GeometricShape once you've added it to the Space. I believe that all Shapes get an id of some sort and it seems that adding the same object that was already removed probably reuses that same id. So I basically have to create a new GeometricShape each time I want to add it to the RigidBody.
Friday, November 14, 2008
FDT swc browsing
In cases where you just want to dynamically generate a MovieClip or a Bitmap, creating class files for each library item goes beyond what is needed since Flash automagically creates the class for you behind the scenes. Plus it becomes a lot of work to create a class for each and every library asset in your fla. Imagine you have dozens or even hundreds of items in your library. I'd hate to write classes for each one of those. No thanks. I'll export a swc file and be done with it.
Ok, so back to why I was writing this post. So when you create a swc file from your fla, it throws in references to every class used within the fla. This is what we want right? Not exactly. Not only does it contain references to my library assets that I do need, but it also has references to every other class used in the project. Is this bad? Functionally.........no. But having all my project classes in the swc file takes away some of the nice features that FDT offers.
When Flash creates a swc file, the basic classes look like this when browsing through them from FDT:
// Generated Source from SWC
package {
import flash.display.BitmapData;
public dynamic class ClassName extends BitmapData {
public function ClassName(XXX : Number, XXX : Number);
}
}
So this is for a bitmap in the library. Not a problem because I only use it to dynamically generate a bitmap. But for my project classes, this is no good for a couple of reasons:
1.) I don't get any of the comments or parameter names when rolling over class names, properties, or methods. Instead I see XXX for parameter names which gives no hint as to what the parameter is. And in FDT, rolling over class names, properties, or methods shows you Java doc comments. These generated classes have nothing.
2.) Control clicking any class names, properties, or methods takes you to the generated classes in the swc and not to the actual class you created in your project. This is not helpful at all. I wish that FDT looked for the class files in the project first, and then to the swc file second.
So I have a simple work around. In all my projects now, I have two fla files. The project.fla and the projectAssets.fla. What I do is copy all the library items from projects.fla and paste them in projectAssets.fla. Then I use projectAssets.fla to export the swc file. FDT doesn't care what the name of the swc file is. It will use whatever swc file you set to the class path. So now the swc file only has class references to the library items and nothing of my project class files. Very easy fix. Only thing that is a little bit tedious is you have to update each time you add new assets to the library. But it's a quick process so it's not too bad.
Saturday, November 1, 2008
Design Patterns
Flash Playa
ActionScript 3 Design Patterns
So now I am spending my Saturday night reading all the past blog entries in these blogs. I like to live on the edge. One of the blog posts that caught my eye was about the Prototype pattern. Apparently this pattern allows you to clone a deep copy of an object. I know there are classes in AS 3.0 that already have a clone method. Like the Rectangle class and all the filter classes for example. But how about being able to clone a Shape that was drawn a specific way. Normally you have to create a new Shape and redraw the graphics. Being able to clone it would be very cool.
Subscribe to:
Posts (Atom)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=22d058b6-8609-4281-9046-65eb5338beb1)