I've been meaning to post about this error for awhile. You can find solutions on the web, but they seem very buried... hence all the key words in my title.
The error appears in Flash 9 when you use a loader more than once and try to add the e.target.content to the DisplayList after each load. If you are running Flash 10, you will not see the error... The biggest lesson I took from this error is to continue to test on older versions of Flash. If you set your publish settings to Flash 9, but have Flash 10 downloaded on your machine.... you still need to test your site on a machine with Flash 9. Pain in the arse, but worth it if it means catching errors before the client.
Anyways, back to the error at hand, you have a class loader that has been initiated and you plan on using it for your photo gallery. The first image loads just fine and in the completeHandler you add the image (e.target.content) to the stage using addChild and casting the content as some sort of display object. The second image loads just fine, but in the completeHandler at the line where you call "addChild" and error #2505 will get thrown saying that "The supplied DisplayObject must be a child of the caller".
Hmmph. It worked once, why would it fail?
It has something to do with Flash 9's Loader keeping a reference of its content even after the content has been added to a new parent. A quick and dirty fix to the problem is to make a new Loader for every item you are loading. That worked for my needs, however you may want to be careful with memory and garbage collection if you are loading an intense number of images.
Omar Faleh suggests either casting the content as a DisplayObject and unloading the loader or making a copy of the BitmapData and using the copy instead of the content.
Ed had his 2505 errors occurring when he called "unload()" after adding the e.target.content to the displayList. He suggests adding the Loader to the stage instead of the content. So you would add just "e.target" INSTEAD OF "e.target.content" to the display list.
In any case, there are plenty of work-a-rounds. The important thing is to be aware of the issue and make sure you continue to test your sites on older versions of Flash... even if your personal computer runs on 10.
Monday, June 29, 2009
ArgumentError: Error #2505 (AS3, Flash 9, Loader)
Friday, June 26, 2009
Artifacts in Flash on Mac (FF3, AS3, Javascript, swfAddress)
In the past week or so, the Basement pushed Creative Alliance's new website live. It was a fun little project. I really enjoyed messing around with the orbiting particles... they made fun a fun and playful environment.
One thing I did not enjoy, however, was a little bug. It is somewhat hard to explain, but I will give it a shot then follow it up with a video.
Basically, when you click on things, random sized boxes/rectangles appear on the screen. The client called them artifacts. Since I couldn't recreate them on my end, I requested more information from the client... computer specs, screen shot, etc.
The main spec difference they sent back was that they were using a Mac. And instead of sending a screenshot, they did one better and sent the following video: http://ickydime.com/basement/artifacts.mov
Sure enough, when testing on our Mac I could get them to appear. (So much for that small hope that the client's computer was possessed). Sooo, ummm, crap, that the ef are those boxes?
I started taking everything out of the site to see if it was something I was doing. I removed the particles, I removed the content box, I removed the background glow... no nada. Artifacts would still appear. grrrr Finally I disabled swfAddress. Ding Ding Ding. No artifacts. That gave me enough to research online and figure out what was going on.
Turns out, it wasn't swfAddress's fault. In fact, its any javascript call that uses ExternalInterface. For some reason when you call ExternalInterface, little boxes like to appear on your screen and they will do their best to drive you batty.
Luckily, the latest version of SWFAddress takes care of this issue. I'm not going to pretend like I know why or how... but I will tell you that version 2.3 does remove the issue. I think it was specifically taken care of in version 2.2, but I did not test it out.
So if you stumble across this post due to crazy boxes appearing on your Flash site on a Mac. Upgrade your SWFAddress and that should do the trick. If you are making your own ExternalInterface calls, then you may want to look into using a URLRequest and pass the code using navigateToURL(request, "_self");. I haven't personally tried that one, but when doing a little research for this blog post, I stumbled across BigSpaceShip's post which seems to cover the topic quite well... and now I have to wonder why I didn't see this post when I was struggling???? haha. Oh well.
Thursday, June 18, 2009
MouseWheel Scroll on Mac for Flash AS3 (SWFWheel)
Do Mac mice even have a wheel? They only have 1 button so what do they need a wheel for??? ;)
Apparently Mac mice have wheels and Mac users would like to be able to use them just as their PC counterparts do. Unfortunately for them, the Mac OS gives the browser the focus for onScroll events and somehow Flash is left clueless that anything happened.
There are quite a few third party solutions out there. While researching I came across a great article from Robert Hall on four of those solutions.
From our research it seemed that all four solutions were viable options. However, we ended up going with SWFWheel, which was developed by Takanobu Izukawa.
We chose SWFWheel for three main reasons:
First off, it is part of the SPARK project, which I highly respect due to the quality of the other projects contained in their library.
Secondly, it was announced recently on JActionScripters that SWFWheel was being adopted by the latest Gaia Framework. An endorsement from Gaia goes a long way in my book.
Lastly, the project seemed recent and supported the latest browsers. Most of the other solutions seemed to have been created over a year ago. They could be compatible with the latest browsers, but it was not certain. SWFWheel is the only option that we found that specifically mentions supporting the latest browsers such as IE 8 and Chrome 1.
With that being said, if you choose to add SWFWheel to your project you should start by downloading the source from the project page.
Import org.libspark.ui.SWFWheel into your class and place SWFWheel.initialize(stage); in your constructor.
In you HTML page, ensure that you assign an ID to your embedded Flash file. This ID is used by the javascript to reference the embedded object. Add the the external javascript file: swfwheel.js to your HTML the same way you would add swfaddress.js. Just place the script right below swfobject and you should be good to go.
That is it. Simple importing of the .as file. Simple importing of the .js file. Initialize SWFWheel with your stage and away you go. No black magic. No fairy dust.
So far we have had good luck with it. I commend the developer and the SPARK project for putting together a very clean and easy solution.
Friday, June 12, 2009
Update from the Basement
First and foremost, The Basement got a Silver at the National Addy Awards for our work with Creative Alliance on the KFC Surf The Crowds game.
Secondly, we were featured on MidwestBusiness.com: Keys to Achieving Online Success: Relevancy, Content, Design Impact. That is one long title. The article has a nice summary of our recent work and achievements. I think the only big project they left out was the Conner Prairie spot.
That's all i got. Thanks for taking the time to see what we've been up to.
Thursday, June 4, 2009
Flash Indianapolis - June Meeting
Presenter:
Brian Phillips is the Creative Director at The Basement Design & Motion as well as an Adjunct Professor at IUPUI. Brian has designed / directed everything from video games to TV spots. You can learn more about Brian and his work by visiting his blog.
Content:
Brian will be demonstrating his design process for a Mr. Clean microsite. He will discuss the idea, inspiration, sketch, process and final design comp. He will share some of his techniques in PhotoShop and 3ds Max. Afterwords, we will open the floor for questions about tools, concepts, and anything else design related.
Sample:![]()
Schedule:
6:00pm: Doors open. Everyone can meet and greet.
6:30pm: Presentation Begins.
7:15pm: Open Floor. Discuss Next Month
7:45pm: McNivens (to quench our thirst)
Location:
Noodles & Company Near IUPUI
903 Indiana Ave
Indianapolis IN
To find out more information and RSVP for the event, please check out Flash Indianapolis's events page.
Tuesday, June 2, 2009
Featured in Flash & Flex Developer's Magazine (ffdmag)
I am very excited to announce that I got published! Check out the latest edition of Flash & Flex Developer's Magazine (3/2009). I submitted an article awhile back and was very pleased to be selected to be in their June edition. I received the magazine last night, and to my surprise, not only was I in the magazine but I was also the featured article!
My article is called "How to Become a Flex/Flex Developer" and is an expanded and more polished version of a blog post I made last year.
Cover:
Cover Close Up:
My Spread:
If you would like to check out the copy, you should be able to find them in your local Barnes and Noble soon. Or you could subscribe to either their print or their electronic issues.
Huge thanks to both Brian Phillips for helping fine tune my points and to my good friend Kate Pierce for editing my article so that I came across as though I knew how to put together a proper sentence.
Sunday, May 31, 2009
Interactive Spaces in Indianapolis (using Flash + others)
I think May's Flash Indianapolis meeting was the most interesting meeting to date. We visited the Pervasive Technology Lab at Indiana University Purdue University Indianapolis and got to check out what was in the lab as well as interact with four of the pieces.
The first piece that was shown was an interactive space created by Tony Dewan and Chris Basham, called Waterwall. The video explains it better than I can in words, but I will still give it a shot. Picture an open space in with a large video projection on the wall displaying the ocean and a buoy who types messages to you. You step into the space and the level of the ocean rises. Moving around in the space creates waves and more turbulence for the buoy, who will promptly complain about it. The more people that enter the space, the higher the water and the more waves that are created. It was a very cool experience to see everyone moving about in different ways trying to see how the levels, buoy, and waves would react.
Behind the screens is a camera overhead which is taking screenshots at 5 fps. ActionScript 3 is comparing each screenshot and looking for differences in mass and movement using Threshhold calculations. Mass is calculated by how much space is covered by people/objects. Movement is calculated by comparing the current frame to the previous. Mass raises the water level. Movement creates the waves in the save X position that the movement occurred. Both the capturing of data and the visual display was done in AS3.
The second piece we visited was a multi-touch screen. Currently it is in an early experimentation form and just displays different types of interactions that could occur. Such as playing a guitar or moving multiple windows across the screen while interacting with the contents of the windows. Java was the language of choice for this project.
The third piece displayed was an explorable environment created by Todd Shelton using both Papervision3d and WiiFlash. It was very cool to be able to control the environment with a wii remote instead of a mouse, it seemed very natural. We just passed the wiiRemote around the audience and let everyone take a stab. The outdoor environment has grassy hills (created by a bump map), a small pond, trees (using 2D planes), and a flying bird (also 2D Plane using the MovieClip Material). This framework would allow the environment to be easily changed and altered. If you wanted a mountain in the middle, you would just have to change the bump map. The ultimate goal of this project is to create an environment for students to explore and learn. One idea is for the students to use different tools and take water samples for pollution. The experiment could then alter the environment (ex. adding Cows next to the water) and seeing how this would effect the water samples.
The final piece we experienced was a touch table that had been created for the Indianapolis Museum of Arts. Dr. Polly Baker, who is in charge of the lab, presented the piece. The table displayed images of items found throughout the museum. As you interacted with the images, your actions would change the 3 projection screens around the piece. You could interact with the items using a couple different markers. One marker was used to select an individual image. The selected image would then be projected on the wall so that you could learn more about that particular time. Another marker was used to find out where in the museum it's selected image could be found (using a second projection screen). The third marker grouped the images on the screen in ways that you would not normally associate the items. So if you clicked on an image of an artifact, it might cluster the images in groups by pieces in the museum created during the same time period, by people of the same culture, or artifacts made by the same material, etc etc. It was a very cool and educational way to explore the items in the museum.
After we got to see the four interactive pieces, we then explored the rest of the lab. Some very cool pieces including an 8 screen display, a virtual reality cave, a force feedback arcade gun, plus many more.
A great thanks to PTL, the speakers, and Dr. Polly Baker for hosting us and letting us explore their interactive spaces. If you get a chance to check out the lab, I would highly recommend it.

