Hide Old and Reveal New Script

[kml_flashembed movie=”/labs/swf/reveal.swf” height=”150″ width=”450″ /] I was talking the other day with a friend about a small challenge, having 2 images on stage with 2 ideas. 1- have the experience being user driven (in this case the mouse reveals one image while hiding the other) 2- Use XML for easy update. So we fired flash […]

Compile to Flash 8 when using EventDispatcher

or a while I was not able to fire different events and the reason why is because I was compiling to flash player 9 instead of 8. So if there are certain events that are not firing one thing that you can check is the export settings.

Creating empty movieclips – not on the fly

hen you need a visible movieclip instead of creating a movieclip on stage and cleaning it up create a moviclip directly on the Library -New Graphic-.

Movieclip Instance Name to String

When Dealing with Movieclips and you need to access the refence as string do [instanceName].toString() rather than instanceName.toString()

Always do a garbage collection

As simple as creating a method in your class or a function on your code to delete unnecessary variables or set them to null for garbage collection.

Flash PHP mySQL – Write to a Database with Flash and PHP

[kml_flashembed movie=”/labs/swf/phpwritetodb.swf” height=”150″ width=”450″ /] I have written a small script that will assist you into using communication between Flash and PHP to write to a mySQL database. The task is simple, verify the contents of the fields in flash and then send the information to PHP who then writes the information into the database.

Flash Volume Controler ActionScript 2

[kml_flashembed movie=”/labs/swf/volumeExperiment.swf” height=”150″ width=”450″ /] I had a good friend ask me if I knew of a resource for a volume controler, and I didn’t know of any tutorial or code of the top of my head so I went ahead and wrote it for AS2 so I hope this can help some others out […]

Actionscript count and trace the number or arguments passed to a function

[as] var totalArgs = arguments.length; trace(“Number of Arguments passed = ” + totalArgs); for (var i:Number = 0; i < totalArgs; i++) { trace ("Argument "+i + ": " + arguments[i]); } [/as]

Actionscript Round and keep decimals function

[as]function formatDecimals2 (num, digits) { if (num < 0 ) { num = 0; } if (digits

Set a footer on your Flash Movie

[as] stageListener = new Object(); stageListener.onResize = function() { // enter what you want to do on resize, for example: contentHolder_mc._y = Stage.height – contentHolder_mc._height; contentHolder_mc._width = Stage.width; } Stage.addListener(stageListener); stageListener.onResize(); [/as]