Flash Debug Class - dPanel
While the Alert Class can be good for debugging applications, during development of a couple of personal projects I’ve seen the need to create another class which allows me to monitor variables which are likely to change constantly. One such variable is the current frame rate. Using the Alert or trace actions to monitor values that change as much as the frame rate is impractical, especially when you want to also monitor several other variables in real time. For this reason I’ve created the dPanel class.
An example of the dPanel is shown below. To show the dPanel you need to press the ‘transition key’, which for this example has been set to theĀ grave accent key (this key is typically underneath the ‘Esc’ key on Windows keyboards and to the left of the ‘Z’ key on Mac keyboards). Pressing this will slide the dPanel into view. Press the grave accent key again to slide the dPanel out of view.
There are three functions publically available:
init() - you call this method once to initialize the class with your desired settings
addSection() - adds a new section to the dPanel
update() - updates the specified section
Simple Usage
Using the dPanel is very easy.
- All you have to set things up is make a call to dPanel.init(), passing to it a reference to the stage.
- You then call dPanel.addSection() passing to it a name for the new section and if desired, the colour of the text shown in that section.
- When you want to update that section, you simply call dPanel.update(), passing to it the name of the section you want to update and the value you want to update it to.
Here is example code which uses the dPanel to constantly show the mouse position:
import com.dVyper.utils.dPanel; import flash.events.Event; // INITIALIZE dPanel dPanel.init(stage); // ADD A NEW SECTION dPanel.addSection("mousePosition"); // UPDATE THE dPanel EVERY FRAME TO DISPLAY MOUSE COORDINATES stage.addEventListener(Event.ENTER_FRAME, updateDebugPanel); function updateDebugPanel(event:Event):void { dPanel.update("mousePosition", "x:"+stage.mouseX+" y:"+stage.mouseY); } |
And that is all there is to it! The dPanel is very easy to setup and use and I’m sure will prove very useful to you!
Click here to continue reading
Flash Alert Dialog Class
I actually built an Alert class a long time ago and have used it very frequently for my own personal use. I recently received some impetus to update it after finding out that one person actually copied my class and then passed it off as their own on the flashgods forum (It’s now been taken down).
And so I’ve now updated my Flash Alert Dialog class, a class which enables you to display a modal dialog message box with AS3 very much like the built in Alert for Flex. Here is an example showing how the Alert can be used: Click here to continue reading
Fatal Breakout on Flashgamelicense
I’ve submitted Fatal Breakout to Flashgamelicense. Hopefully I’ll be able to get some constructive feedback on the game while I put together some music and get some graphics for the game.
You can view it either on flashgamelicense or here.
Hello World!
Welcome to the new and improved Fatal Exception Studios! Now housed in a different hoster and with a blog powered by Wordpress 2.7!
After a careless mistake by myself, all of the database data containing previous blog posts and comments (and spam) have been lost. Nooo! All of the explanations of my experiments and classes, gone! But all was not lost; thanks to the ultimateness that is Google, all of the important posts were still alive in the Google cache! I was able to get all of the text I needed from the relevent posts with no problems!
Instead of trying to repost them all I have instead created an ‘Articles’ section of the website which will house all of the past and future experiments and classes that I have created. I’ll be posting to that section as time progresses. The first one which deals with graphics rendering has already been made available.
Hopefully my new design will be visually appealing - I hope you enjoy the site!