Refer to an object on the Captivate stage

using widgetfactory, you can access captivate items on the stage - and if you can do that, you can do ANYTHING with ANYTHING - very exciting! override protected function enterRuntime():void { var mc:MovieClip = getSlideObjectByName("item"); mc.addEventListener(Event.ENTER_FRAME, function() {mc.rotation++}); } src:http://www.infosemantics.com.au/widgetking/2010/10/slip-sliding-away/

Rescale Module Wrapper

This is a pretty handy wee class, for if you make something you want to scale down, but not scale up when the screen size is bigger. So all you need to do is wrap your module into a .swf built off this class, and in the HTML set the width/height of the flash box... Continue Reading →

Dynamic Scaling in Flash

If you're making your movie do it's own rescaling dynamically (ie. the stage is 100% of window size etc and the flash movie is moving some shell clip around to center etc.) need to remember to put this in, else it won't be hearing any of the stage resize events and your rescaling won't fire.... Continue Reading →

try / catch

Try and catch is most handy for handling files with AIR etc. Pretty straightforward, but just incase you forget the syntax: try { // statements } catch (error:ArgumentError) { trace('An argument error has occured'); } catch (error:Error) { trace('An error has occured which is not argument related'); } src: (ty) http://www.foundation-flash.com/tutorials/tryandcatch/

DataGrid data to XML AS3

Probably not the prettiest method to do this, but it'll do for just before I go home. This is to change datagrid objects back into XML - this is only for my case and needs custom coding, but the method is there! var newXML:XML = new XML(<coaches></coaches>); for (var i:int = 0; i < dataGrid.length;... Continue Reading →

Datagrid – delete selected row

Again, this is all just SelectableList behaviours but how often does anyone use datagrids to remember this?! dataGrid.removeItemAt(dataGrid.selectedIndex); http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/controls/SelectableList.html

Get frame number from label AS3

function getFrameByLabel(yourMovieClip:MovieClip, frameLabel: String ):int { var scene:Scene = yourMovieClip.currentScene; var frameNumber:int = -1; for( var i:int ; i < scene.labels.length ; ++i ) { if( scene.labels[i].name == frameLabel ) frameNumber = scene.labels[i].frame; } return frameNumber; } Src: http://stackoverflow.com/questions/4846858/as3-simple-way-to-get-the-frame-number-of-a-frame-label

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑