r3dux.org

A number-pimping side project from the valleys in *NEW* upside-down flavour.

  • Home
  • ABOUT
  • OLD SITE
  • SEARCH
  • FEEDBACK

ActionScript 3.0: Event Propagation

r3dux | March 29, 2010

I learnt AS3 in a hurry – I had a couple of weeks to get my head around it and get things working – no nicities – just get it working so you can teach it… And what I missed by scrabbling through the ActionScript 3.0 Bible was the propagating nature of the event model. And it’s awesome! You layer things on other things and the event propagates down the tree until it hits the last branch..

In the example below I just create three boxes bound to a Box class, and when adding them to the screen I don’t add them all to the stage – I just add the first one to the stage, add the second one to the first one, and add the last one to the middle one, and just look at MOUSE_OVER and MOUSE_OUT events. Because they’re MovieClips added to MovieClips etc, the event travels down the tree and hits each branch using the current status to work on. Move your mouse over the boxes below to see what I mean:

That’s going to come in really useful… I can just feel it.

Source Code:

Box class:

package
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
 
	public class Box extends MovieClip
	{
 
		public function Box():void
		{
			this.addEventListener(MouseEvent.MOUSE_OVER, isOver);
			this.addEventListener(MouseEvent.MOUSE_OUT, isOut);
		}
 
		private function isOver(evt:MouseEvent):void
		{
			this.alpha = 0.5;
		}
 
		private function isOut(evt:MouseEvent):void
		{
			this.alpha = 1;
		}
	}
}
var topBox:Box = new Box;
topBox.x = 150;
topBox.y = 150;
addChild(topBox);
 
var middleBox:Box = new Box;
middleBox.x = 100; // Remember this is -RELATIVE- to the MovieClip this MovieClip is being embedded in....
middleBox.y = 100;
topBox.addChild(middleBox);
 
var bottomBox:Box = new Box;
bottomBox.x = 100;
bottomBox.y = 100;
middleBox.addChild(bottomBox);

Comments
2 Comments »
Categories
Coding
Tags
ActionScript 3.0, Event, Propagation
Comments rss Comments rss
Trackback Trackback

The Time Controlling Properties of SimCity

r3dux |

Sim City: Time Vampire

Ahh, SimCity… I remember this happening well, and leading to a No SimCity After 8pm rule ;)

Comments
No Comments »
Categories
Gaming, Humour
Tags
SimCity, Time Vampire
Comments rss Comments rss
Trackback Trackback

ActionScript 3.0: An Introduction to ActionScript 3.0 in Flash CS4 – Week 3 Lesson 2

r3dux | March 26, 2010

We’re making good progress here in Week 4 of CUFDIG302A – Author Interactive Sequences, so we’re looking at more Symbols and Instances, and how we can use Timers to call functions at specified intervals.

If you’ve not gone through any of the previous weeks slides and you’re new to coding, then take a step back to and take it order – it’ll really help.

Flash Slides Week 3 Lesson 2

I’ve been a bit busy of late and been finding it hard to get the time and inclination to get the slides together in the different format soon after they’re done. Comments, suggestions, thanks etc. are always welcome and give me incentive to keep on keepin’ on…

As usual, the download link to the slides along with some legal gubbins regarding their use is after the break, so jump on in and assert your control!

Read the rest of this entry »

Comments
No Comments »
Categories
Coding
Tags
ActionScript, CS4, CUFDIG302A, Flash, Instances, Symbols, Timers
Comments rss Comments rss
Trackback Trackback

Photoshop CS5: Content Aware Fill

r3dux | March 25, 2010
YouTube Preview Image

You’ve got to admit, that’s pretty awesome… (best viewed full screen so you can really see what going on, btw).

Update: Get this functionality now. For free. In GIMP. Via the resynthesizer plug-in.

Update 2: Here’s a guide to using the resynthesizer plug-in, which does goes through the steps to modify the exact same images as in the video, but in GIMP! Sweet!

Update 3: I decided to write my own guide… =D

Comments
1 Comment »
Categories
Imagery, Tech
Tags
Content Aware Fill, CS5, GIMP, Photoshop, plug-in, resynthesizer
Comments rss Comments rss
Trackback Trackback

Resistance is Futile

r3dux | March 24, 2010

Resistance is Futile

Comments
4 Comments »
Categories
Humour, Imagery
Tags
Borg, Futile, Resistance
Comments rss Comments rss
Trackback Trackback

« Previous Entries

Translate

Categories

Archives

Tags

3D ActionScript ActionScript 3.0 Adobe AI Ballarat Bash C++ Class Convert CS4 Effect Error Film Flash GLSL Gnome Hack How-To install Jaunty Java Kinect Linkage Linux Mash-Up Microsoft Motion OpenGL Particle Problem PS3 Remix Retro script Slides Sound Systems Texture Ubuntu Video VirtualBox Wii Windows XBox

Gamercard

OpenR3dux

Misc.

Flattr this

RSS Feed

r3dux twitter feed



“You know you've achieved perfection in design, not when you have nothing more to add, but when you have nothing more to take away.”

 - Antoine de Saint Exupery

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox