Flash, Actionscript, Design, Games and Programming.
In: Actionscript|Flash
28 Apr 2009Digging through my folder of Flash experiments, I came accross this one from last year. [kml_flashembed fversion="9.0.0" movie="flash-content/ColourLovers/ColourLovers.swf" targetclass="flashmovie" publishmethod="static" width="500" height="500"] [/kml_flashembed] Here, I’m accessing an XML feed from ColourLovers, a Kuler-like design site, featuring thousands of user submitted colour pallettes. I pull in a random colour pallette and layout some boxes of that [...]
Just a quick one today – how to detect if the mouse has left the stage. ?View Code ACTIONSCRIPT3stage.addEventListener(Event.MOUSE_LEAVE, leaveStageFunc); function leaveStageFunc(e:Event):void{ //This event is fired when the mouse leaves the stage. trace("You left the stage!"); }
Part 4 of my Actionscript 3 basics is Dynamic Resizing! Have you ever wanted your flash file to fill the browser, no matter how big or small the user views it? Worry not, as the following code should help you do just that! [kml_flashembed fversion="9.0.0" movie="flash-content/StageResize/stageTest.swf" targetclass="flashmovie" publishmethod="static" width="400" height="400"] [/kml_flashembed] No matter what dimensions [...]
Today I’m continuing my AS3 basics series with a post about Keyboard Events. The following code should get you up and running with Keyboard Events is AS3. ?View Code ACTIONSCRIPT3//We add listeners to the stage, listening for key-up and key-down events. stage.addEventListener( KeyboardEvent.KEY_DOWN, keyDownHandler ); stage.addEventListener( KeyboardEvent.KEY_UP, keyUpHandler ); //This function will happen for [...]
Number two in my basic Actionscript 3 functionality is MOUSE EVENTS! The following code will show you how to access the mouse’s X and Y position, scroll wheel action and direction and clicking and double clicking. ?View Code ACTIONSCRIPT3//Mouse events! //To use the double click event, you must first enable it for each object you [...]
This is the blog of Lawrie Cape, an interactive developer from Leeds, England.