Redbug Technologies Logo Redbug Technologies  
 
  home     mapwing     support  
 

weblogs

andrew

nathan RSS 2.0 feed

curtis

julie

Calendar - Jul, 2010
 010203
04050607080910
11121314151617
18192021222324
25262728293031
2006
Jan Aug
2005
Dec
     
 
Nathan's Weblog
Using components in Flash
by Nathan on Wed Aug 30, 2006 8:55 AM
Building complex flash applications with ActionScript 2 and Flash 8 can be a daunting task. However, it can be very beneficial for developers who wish to have easy to maintain code and a simple test environment. Following is a very brief and simplified version of the process. I am assuming that you already have some experience in building Flash apps and using ActionScript.

If you are not familiar with components in Flash, here is a brief explanation. A component is basically an independent SWF file that runs inside of another SWF. Since it is self-contained, you can create multiple instances of the same component in your main file. This can be helpful if you have a control that you need access to multiple times, for example, a cursor.

To create a component, follow the same procedure in Flash as if you were creating an independent SWF file. In our cursor example, I created a document called Cursor.fla. I also like to use eclipse for editing my ActionScript, so I created a Cursor.as class file to go along with my Cursor.swf file. If you aren’t familiar with that process, post a comment and I can add another blog entry.

After you open your new component .fla file, it looks the same as any other file. First create a new symbol in your Library (right-click on the Library area) and name it the same as your ActionScript class, in my case “Cursor”. Under the linkage options, click “Export for ActionScript” and then fill in the Identifier and AS 2.0 Class (I use the same name as my component, so “Cursor”).

You will notice that the new symbol looks the same as any other movieclip in the Library. To turn it into a component, you need to right-click on the movieclip (in the example called “Cursor”). Select “Component Definition” from the menu. In this dialog box, you can configure the component, as well as set up default parameters. The important change to make is the AS 2.0 Class text field. Here I would enter “Cursor”, because that is the name of my class file.

My configuration in Flash is finished, now it’s time to add my class definition in eclipse. Not too much goes in there for a cursor, just a mouse move event handler to set the cursor position to the root mouse position. After my class is set up, I can build any Layers and graphics I need to for my component. I like to reserve the first or top layer in the document for my ActionScript, just for simplicity.

So for my cursor, I might have several different graphics that I want for cursors at different times. I would add a keyframe in my ActionScript layer with the commands Mouse.hide(); and stop(); and a keyframe in my graphics layer with the cursor graphic. Then all I need to do is call my component, goto a specific frame, and the mouse cursor will disappear and my custom graphic will appear. You can add multiple keyframes, thereby keeping all of your cursors in the same location.

Now it’s time to build our component. In the Library, right click on the Cursor movieclip and select “Convert to Compiled Clip” which builds our class definition into the component. If everything is working, the movieclip icon will change into a icon with three colored blocks. You can test your component by adding some ActionScript into the Scene (maybe like a gotoAndStop(3); to show your third cursor) and then select “Test Movie” from the Control menu. You can test and debug your component in the developer environment, which gives you access to the trace() command and other error checking, which is helpful.

Once you are happy with your component, right-click on it in the Library and select “Export SWC File”. Save the .swc file in the components directory so you can use it later. Now click on the menu directly to the right of “Components” (in the sheet) and you will see a “Reload” option. Select it, and your custom component should show up under the Standard Components section. Simply drag your component into another SWF, give it an instance name, and you are ready to go.

permalink | comments (0)

Solidworks vs. AutoCAD Inventor
by Nathan on Thu Jan 26, 2006 10:13 AM
Although it would be hard to tell currently, I'm a mechanical engineer by education. I received my degree from York College and as part of the program we were required to complete three separate, one semester co-ops. I did my co-ops at three separate companies, and each of them used a different drawing package. Also, since we used two different packages at school, you could say I have had a lot of exposure to drawing packages.

We learned the basics of drafting at school on the good old standby, AutoCAD. We did a lot of 2D drawing, but we also worked in 3d (kinda painful if you have ever tried it). For our real 3D modeling work, we used Solidworks. I liked the program a lot when I was at school. The idea of drawing object abstractly and then mating them together later was very exciting. No more exact drawing where tweaking was a real chore. Just change a dimension on the drawing, update the model, and voila! Everything just worked.

My first co-op was at York International, Marine Systems Division. They used Pro-E and had an entire drafting department, so I didn't get to work with the app. But I did do a lot of over the shoulder watching. Pro-E is very powerful, but has a pretty steep learning curve.

The second co-op was at American Hydro Corporation, who used Unigraphics (UNIX based). Also insanely powerful and complex, Unigraphics wasn't the easiest thing to learn. But after a week or so of using it hard, I had 3D modeling and scripting down pretty well. The best thing about Unigraphics was the three button mouse, which allowed quick acceptance of commands.

My third and final co-op was at Capway Systems. They used AutoCAD for all of their drawing needs- most of the engineering department used 2D exclusively. A couple of the guys modeled things in 3D with AutoCAD and then made the drawings off the models. Having just come off our senior project where we modeled our entire walking robot in 3D with Solidworks, 2D was looking a little weak to me. I convinced my manager to let me use their newly purchased copy of Inventor to model a new machine I was designing in 3D.

Currently, I am back to using Solidworks on a consulting project with one of my profs from York. It has raised the question- Which is better, Solidworks or Inventor? We tried to answer that question before we purchased Solidworks for our consulting work. I think both programs have their strengths and weaknesses.

Solidworks is very cheap (comparatively), especially their educators license. This makes it attractive to schools and other education institutions. Also, the learning curve for Solidworks is very low. It is easy-to-learn and intuitive. I hear that the included tutorials are quite good as well (I wouldn't know as I hate reading tutorials and prefer to learn by example). The modeling and mating techniques are very similar to Inventors. I would like to see more options with the 2D sketching- I think they are a little weak in the dimensioning realm. One thing I miss from Inventor is the center mouse wheel control. Solidworks lets you rotate and zoom, but you have to hold down the Control key to pan- frustrating.

Inventor is a bit on the expensive side, but for a corporate setting probably not too much of a problem. I thought the curve on Inventor was much steeper than Solidworks- if I hadn't already had a background in 3D I think I would have been in trouble. I don't have any experience with the tutorials (see above), but I did have to use the included help rather extensively. It was OK and answered most of my questions on procedure. As I stated, the 2D sketching features on Inventor were definitely superior. For example, you can "relate" dimensions to each other- so one dimension (driving) could be half of another (driven).

All in all, both packages were pretty solid (no pun intended) in programming and construction. I didn't have too many problems with crashing with either, and I was running under the recommended system requirements for both. If you are a serious drafter, or have large, complicated models, I would suggest getting a fast computer with a lot of memory. It just works better. Final conclusion- I think either package works fine for 3D modeling and assembling. Pick the one that suits your needs, be it price or integration with other drawing packages or features, and then learn it. Like any software application, once you learn how to use it, working just becomes natural.

permalink | comments (0)

Comments about the ATPM.com review
by Nathan on Thu Jan 05, 2006 2:39 PM
We recently submitted our software, Mapwing Creator Pro (MCP), to About This Particular Macintosh for review. One of their staff, Lee Bennett, reviewed our software here. I have a couple of comments about his review, but I would encourage you to read the review first for perspective.

First, I would like to state that I am impressed with the review. It is very apparent (both from the review and the linked tour) that Mr. Bennett used the software and read the documentation. His review is well written and flows nicely. I do not have any specific comments until Bennett writes his personal views on the software.

There has been a lot of discussion about connecting points with MCP, both at Redbug and by Mr. Bennett. We originally had a tool that allowed dragging between points on the map, just as is suggested in the review. This solution worked, but it was extremely limited in application. The software had to guess which views should be connected together. While this may seem like a simple choice on the surface, we quickly found that more customization was needed for complex tours. If all of the points in a tour were laid out in a grid pattern, a tool like this would work. However, points are rarely in a grid pattern which necessitated a method for creating connections from view to view, not from point to point.

Bennett made several comments about importing images into MCP, specifically the view ratio and image dimensions. The purpose behind including two view ratios, 4:3 and 3:2 is simple: most consumer digital cameras produce images at a 4:3 ratio and most professional cameras use 3:2. MCP was designed so a user could simply take pictures with his camera and drop them into the program without modification. As our documentation suggests, the user should only have to make a decision about which ratio to use once. This decision will be based on what ratio his camera produces.

All photos are always represented in landscape mode in MCP. If the user desires a portrait picture, he has to manually pad the portrait with an image editing program like Photoshop or MCP will stretch the image to fit the set view ratio and resolution. A simple solution to the portrait orientated picture problem is not to take any pictures in portrait mode; however, we have seen a need for easier incorporation of portrait pictures into Mapwing tours and are currently working on possible solutions.

Bennett also made a comment about creating hotspots that completely cover a view, thereby rendering navigation impossible. Yes, this “problem” exists. We tried to give the user as much control over creating his tours as we could. Sometimes, as in the example of hotspot creation, this caused a potential way of creating a tour that was apparently unusable or undesirable. However, there could be a reason the user wanted to do this.

We decided early on in the development process that our software was not going to exercise any more control over the user's actions than was completely necessary. Does this mean the user has to use a little common sense? Yes. Is this a problem? I submit that it is not- DVD authors can create an infinite loop between tracks, thereby apparently destroying the flow of the disk. Why does the standard not prevent such an action? Probably for the same reason we used- because there is no reason why it should.

As for the specific bugs that Bennett references in his review, we are not aware of any of them at this time. This is not to say that the bugs do not exist. We will test our software extensively to see if we can reproduce them, and if so, we will work on fixing them. Bugs are a part of any software project and I would be remiss to say that our software is bug free. We try very hard to make sure the software released to the public is as bug free as we can make it. If our users do find bugs, we have an integrated, on-line area for reporting and discussing the issues.

We did think about an integrated tour editing system that was contained in a single window. The four window layout was chosen instead for flexibility and approximates the difference between Apple's iMovie and Final Cut Pro. On one side is a simple application that has a single window that gets the job done. On the other side is a professional app that offers complete customizability and flexibility. The choice is, as Bennett remarks, up to personal preference.

In his conclusion, Bennett remarks about an integrated tool for configuring the files required to host a Mapwing tour on your web site. Again, this seeming lack of a feature is tied to user flexibility. While it would be possible to cookie cutter a basic instance of Mapwing Flash Viewer for each tour created (the user would still need to enter in his specific server information), the page would not be easily customizable. Most users like to integrate additions to their web sites with the look and feel they have created for the site. This may be a position, color scheme, or overall size. It can be irritating to “hand-edit” the configuration files, but once one is created it can be used as a template for future tours. Every effort was made to ensure the process of loading a Mapwing tour to a web site was as streamlined as possible.

Throughout his review, Bennett has had an undercurrent negative tone about the price of Mapwing Creator Pro. While commenting on the price of a piece of software is certainly an acceptable thing for a reviewer to do, I do not think Bennett’s comments on price are supported with any real evidence in his review. He has several examples of features that he would like to see in the software and a couple of unconfirmed bugs. I did not see any support for his linking of MCP to a “$30-40 piece of shareware”. Perhaps he was confusing the simplicity of MCP with cheapness, I’m not sure. We tried to make the process of creating and sharing virtual reality tours with Mapwing as easy and painless as possible. The road to finding the current solution was long and difficult, and while not perfect, I think the end result is well worth the effort.

I would challenge Mr. Bennett to find another solution that offers something close to the same features with a similar price point. I do not think he will be successful because we looked extensively when we were deciding on our price. He mentions Apple’s QuickTime VR Authoring Studio which costs about $400, only runs in OS 8 or 9, and does not create linked point tours easily. Many other VR suites retail for more than Mapwing and do not have anywhere near the same features. In today’s business world, time is more than equal to money. Mapwing Creator Pro may cost over what the average home user is willing to spend, but we believe the amount of time and effort the user saves more than justifies the cost. Also, unlike many other companies, we stand by our products and offer free unrestricted technical support to our customers. Where else can you find a virtual reality tour creation product that is easy to use, has good support, and is flexible enough to meet your needs?

That wraps up my comments about Mr. Bennett’s review. Again, I thank him for his comments and suggestions. We appreciate hearing from our users because it helps us make our software better. For example, we just released new versions of our Mapwing software today. You can download a free demo of Mapwing Creator Pro, check it out for yourself, and even enter our new tour contest. As always, I welcome any feedback.

permalink | comments (0)

Redbug weblogs online

view all weblog entries...

 
     
 
 
  home     site map     contact us