Sep 19

let's imagine this scenario:

we instantiate a certain number of instances of object A on the stage (_root) .. and we want each object to be receive a different value, and have that object do something with it

a real life example would be: create a client object and pass the client name as an argument to that object.

and let's assume that we have a complex class hierarchy that requires code optimization, which generally means that we need to know how to find the code without scrolling through a 5 page long classes.

for that, we can create an Event Manager class that listens to events from all objects in the structure and handles the calls and manages the data.

a simple example would be:
Read the rest of this entry »




Sep 19

I am not sure that this is the best or only way of doing it.. but here's what I found so far
what used to be _root.mcName in AS2 is gone... and now the while concept of root is also gone

according to Adobe (from the Flash CS3 help file)

the root property is the top-most display object in the portion of the display list's tree structure represented by that SWF file

however, if you have an object on the stage with name chalk for example you can't access it by saying: root.chalk

because root is the parent displayObject of a stage, where objects are added.

so, on the document class or on the frames, if you write:
Read the rest of this entry »




Sep 19

One of the biggest changes to Actiosncript 3.0 for me (which took me forever to figure out) is the method to add an object from the library by its identifier, in case that identifier was ordered.

take this screenshot for example:

library.jpg

to add an instance of the switchButtons movieClip to the stage all you have to write is:

var sb = new switchButtons();
stage.addChild(sb);

Read the rest of this entry »




Sep 19

to use the Fuse classes in a custom Actionscript class, here's how it works:

import com.mosesSupposes.fuse.*;

class customClass{
	// constructor
	function customClass(){

 		// this has to be called in the
		// constructor function or the
		// onLoad function to register the classes

		ZigoEngine.register( Fuse, PennerEasing );

		var AnimVarFuse = new Fuse();

		AnimVar.push(
				{
					target:this.child_mc,
					alpha:100 ,
					seconds:0.5,
					delay:0.5
				},

				{
					scope:this,
					func:functionName
				}
			);

		AnimVar.start();

	}

	function functionName(){

		// this is a function that will be called
		// once the animation is over
		// the scope refers to where
		// the function is declared.. the scope
		// can be _root if the function is on
		// the highest level

	}

}

Read the rest of this entry »