I needed a way to break apart a loaded bitmap into a grid of smaller bitmaps so I could then manipulate them separately. I ended up creating BitmapGrid.as, a class that will break apart your bitmaps into an array for you to do with as you please.
I was trying to do a simple E4X search of my XML for an attribute named “type” and I came across this error.
ReferenceError: Error #1065: Variable @type is not defined.
After ramming my head against a wall for around 30 minutes I asked Duncan if he ever saw such a thing. After all, other searches on the same XML were working perfectly. After some thought he remembered having a similar issue. Turns out that every node you are searching needs to have that attribute, in my case every node needed the “type” attribute.
I came across this error and am blogging about it so I won’t forget the solution and maybe it will help someone else.
1172: Definition fl.video:VideoEvent could not be found.
In order to access a number of the “fl” packages you need to have a component in your library. In this case I added the FLVPlayback component and all was well. Apparently you can use flash.utils.getDefinitionByName as well.
I am in the process of creating a common interface to control media players whether it be Adobe’s VideoPlayer or exanimo’s SoundPlayer. My initial desire was to have it accept Adobe’s own Video Components like PlayPauseButton and SeekBar as well as my own custom controls, but I have run into an issue. Adobe’s Video UI Components do not work on their own but require UIControls.
So if I want a PlayPauseButton to work with SoundPlayer I need to roll my own. If I want a BufferingBar to work, I need to roll my own.
Hopefully in the next version of Flash they will resolve this and give us components that would accept an interface for a target.
If you build just about any Flash application you will need a menu that will manage button states and let you know when something has been clicked. This class will do that and can be implemented in projects big and small. Below is a very basic example on how it can be used, on the Mall World page it is implemented six times. Can you guess where?
A very basic implementation
[/embed]
Creating a Menu Object can be as simple as this
var menu = new Menu();
menu.addItem({clip: buttonOne, id: 1});
menu.addItem({clip: buttonTwo, id: 2});
menu.addEventListener(MenuEvent.NAVIGATE, this.menuNavigateHandler);
This code is released under the MIT License with just one request. If you improve it in some way that could benefit other users leave a comment.